1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Anonymizing overlay network for TCP
8 HOMEPAGE= https://www.torproject.org/
13 DISTFILE[1]= tor-0.4.1.6.tar.gz:main
15 SPKGS[standard]= complete
19 OPTIONS_AVAILABLE= none
20 OPTIONS_STANDARD= none
22 BUILD_DEPENDS= asciidoc:single:py27
23 BUILDRUN_DEPENDS= libevent:single:standard
28 USERGROUP_SPKG= primary
30 USES= cpe gmake pkgconfig ssl zlib cclibs:primary
32 LICENSE= BSD3CLAUSE:primary
33 LICENSE_FILE= BSD3CLAUSE:{{WRKSRC}}/LICENSE
36 CPE_VENDOR= torproject
37 FPC_EQUIVALENT= security/tor
40 CONFIGURE_ARGS= --with-openssl-dir="{{OPENSSLBASE}}"
41 --enable-linker-hardening
42 CONFIGURE_ENV= TOR_CPPFLAGS_libevent="-I{{LOCALBASE}}/include"
43 TOR_LDFLAGS_libevent="-L{{LOCALBASE}}/lib/"
44 TOR_LIBEVENT_LIBS="-levent"
46 PLIST_SUB= USER="{{USERS}}"
49 SUB_LIST= USER="{{USERS}}"
53 ${REINPLACE_CMD} -E -e "s@(-z) (relro|now)@-Wl,\1,\2@g" \
55 ${REINPLACE_CMD} -e 's|lib/tor|db/tor|' \
56 ${WRKSRC}/src/config/torrc.*.in \
57 ${WRKSRC}/doc/tor.1.* \
58 ${WRKSRC}/doc/tor.html.in
59 ${REINPLACE_CMD} -e "s@-ltcmalloc@${LOCALBASE}/lib/libtcmalloc.so@" \
63 @${MKDIR} ${STAGEDIR}/var/log/tor \
64 ${STAGEDIR}/var/run/tor \
65 ${STAGEDIR}/var/db/tor
67 [FILE:547:descriptions/desc.primary]
68 Tor: an anonymizing overlay network for TCP
70 Tor is a connection-based low-latency anonymous communication system which
71 addresses many flaws in the original onion routing design.
73 Tor is a toolset for a wide range of organizations and people that want to
74 improve their safety and security on the Internet. Using Tor can help you
75 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
76 more. Tor also provides a platform on which software developers can build
77 new applications with built-in anonymity, safety, and privacy features.
81 2a88524ce426079fb9b828bc1b789f2c8ade3ed53c130851102debc3518bed71 7390096 tor-0.4.1.6.tar.gz
84 [FILE:403:manifests/plist.primary]
85 @sample etc/tor/torrc.sample
89 tor-print-ed-signing-cert
92 share/doc/tor/tor-print-ed-signing-cert.html
95 tor-print-ed-signing-cert.1.gz
102 @dir(%%USER%%,%%GROUP%%,700) /var/db/tor
103 @dir(%%USER%%,%%GROUP%%,700) /var/log/tor
104 @dir(%%USER%%,%%GROUP%%,700) /var/run/tor
107 [FILE:74:manifests/plist.docs]
115 [FILE:4107:files/tor.in]
119 # REQUIRE: DAEMON FILESYSTEMS
122 # Add the following lines to /etc/rc.conf to enable tor.
123 # All these options will overide any settings in your local torrc as
124 # they are command line options.
126 # tor_enable (bool): Set it to "YES" to enable tor. Default: NO
127 # tor_instances (str): List of instances. Default: ""
128 # tor_conf (str): Points to your torrc file.
129 # Default: %%PREFIX%%/etc/tor/torrc
130 # tor_user (str): Tor daemon user. Default: %%USER%%
131 # tor_group (str): Tor group. Default: %%GROUP%%
132 # tor_pidfile (str): Tor pid file. Default: /var/run/tor/tor.pid
133 # tor_datadir (str): Tor datadir. Default: /var/db/tor
134 # tor_disable_default_instance (str): Doesn't run the default instance.
135 # Only valid when tor_instances is used.
137 # tor_setuid (str): Runtime setuid. Default: NO
139 # The instance definition that tor_instances expects:
140 # inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir}
149 load_rc_config ${name}
152 : ${tor_instances=""}
153 : ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
154 : ${tor_user="%%USER%%"}
155 : ${tor_group="%%GROUP%%"}
156 : ${tor_pidfile="/var/run/tor/tor.pid"}
157 : ${tor_datadir="/var/db/tor"}
158 : ${tor_disable_default_instance="NO"}
161 instance=${slave_instance}
162 if [ -n "${instance}" ]; then
164 inst_name=${inst_def%%:*}
165 [ "${inst_name}" != "main" ] || err 1 "${name} instance can't be named 'main'"
166 inst_def=${inst_def#$inst_name}
167 if [ -n "$inst_def" ]; then
168 # extended instance: parameters are set explicitly
169 inst_def=${inst_def#:}
170 tor_conf=${inst_def%%:*}
171 inst_def=${inst_def#$tor_conf:}
172 tor_user=${inst_def%%:*}
173 inst_def=${inst_def#$tor_user:}
174 tor_group=${inst_def%%:*}
175 inst_def=${inst_def#$tor_group:}
176 tor_pidfile=${inst_def%%:*}
177 tor_datadir=${inst_def#$tor_pidfile:}
178 if [ -z "${tor_conf}" -o -z "${tor_user}" -o -z "${tor_group}" -o -z "${tor_pidfile}" -o -z "${tor_datadir}" ]; then
179 warn "invalid tor instance ${inst_name} settings: ${instance}"
183 # regular instance: default parameters are used
184 tor_conf=${tor_conf}@${inst_name}
185 tor_pidfile=${tor_pidfile}@${inst_name}
186 tor_datadir=${tor_datadir}/instance@${inst_name}
188 if ! [ -r ${tor_conf} ]; then
189 warn "tor instance ${inst_name} config file ${tor_conf} doesn't exist or isn't readable"
190 warn "you can copy the sample config %%PREFIX%%/etc/tor/torrc.sample and modify it"
193 if ! [ -d ${tor_datadir} ]; then
194 mkdir -p ${tor_datadir} &&
195 chown ${tor_user}:${tor_group} ${tor_datadir} &&
196 chmod 0700 ${tor_datadir} &&
197 echo "${name}: created the instance data directory ${tor_datadir}"
201 if [ -z "${instance}" -a -n "${tor_instances}" ]; then
204 for i in ${tor_instances}; do
206 if [ -z "${inst_only}" -o "${inst_name}" = "${inst_only}" ]; then
207 echo -n "${name} instance ${inst_name}: "
208 if ! slave_instance=${i} %%PREFIX%%/etc/rc.d/tor "$1"; then
211 inst_done=$((inst_done+1))
214 if [ -z "${inst_only}" -o "${inst_only}" = "main" ]; then
215 checkyesno tor_disable_default_instance && return $exit_code
216 echo -n "${name} main instance: "
217 elif [ -n "${inst_only}" ]; then
218 [ $inst_done -gt 0 ] || err 1 "${name} instance '$inst_only' isn't defined"
223 required_files=${tor_conf}
224 required_dirs=${tor_datadir}
225 pidfile=${tor_pidfile}
226 command="%%PREFIX%%/bin/${name}"
227 command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir}"
228 extra_commands="reload"
230 if [ $tor_setuid = "YES" ]; then
231 if ! grep -q "^User ${tor_user}$" ${tor_conf}; then
232 echo "User ${tor_user}" >> ${tor_conf}
237 if grep -q "^User ${tor_user}$" ${tor_conf}; then
238 sed -i '' -e "s/^User ${tor_user}$//" ${tor_conf}
242 if ! run_rc_command "$1"; then