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.3.2.10.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 60df77c31dcf94fdd686c8ca8c34f3b70243b33a7344ecc0b719d5ca2617cbee 6421984 tor-0.3.2.10.tar.gz
84 [FILE:299:manifests/plist.primary]
90 @sample etc/tor/torrc.sample
99 @dir(%%USER%%,%%GROUP%%,700) /var/run/tor
100 @dir(%%USER%%,%%GROUP%%,700) /var/log/tor
101 @dir(%%USER%%,%%GROUP%%,700) /var/db/tor
104 [FILE:74:manifests/plist.docs]
112 [FILE:4107:files/tor.in]
116 # REQUIRE: DAEMON FILESYSTEMS
119 # Add the following lines to /etc/rc.conf to enable tor.
120 # All these options will overide any settings in your local torrc as
121 # they are command line options.
123 # tor_enable (bool): Set it to "YES" to enable tor. Default: NO
124 # tor_instances (str): List of instances. Default: ""
125 # tor_conf (str): Points to your torrc file.
126 # Default: %%PREFIX%%/etc/tor/torrc
127 # tor_user (str): Tor daemon user. Default: %%USER%%
128 # tor_group (str): Tor group. Default: %%GROUP%%
129 # tor_pidfile (str): Tor pid file. Default: /var/run/tor/tor.pid
130 # tor_datadir (str): Tor datadir. Default: /var/db/tor
131 # tor_disable_default_instance (str): Doesn't run the default instance.
132 # Only valid when tor_instances is used.
134 # tor_setuid (str): Runtime setuid. Default: NO
136 # The instance definition that tor_instances expects:
137 # inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir}
146 load_rc_config ${name}
149 : ${tor_instances=""}
150 : ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
151 : ${tor_user="%%USER%%"}
152 : ${tor_group="%%GROUP%%"}
153 : ${tor_pidfile="/var/run/tor/tor.pid"}
154 : ${tor_datadir="/var/db/tor"}
155 : ${tor_disable_default_instance="NO"}
158 instance=${slave_instance}
159 if [ -n "${instance}" ]; then
161 inst_name=${inst_def%%:*}
162 [ "${inst_name}" != "main" ] || err 1 "${name} instance can't be named 'main'"
163 inst_def=${inst_def#$inst_name}
164 if [ -n "$inst_def" ]; then
165 # extended instance: parameters are set explicitly
166 inst_def=${inst_def#:}
167 tor_conf=${inst_def%%:*}
168 inst_def=${inst_def#$tor_conf:}
169 tor_user=${inst_def%%:*}
170 inst_def=${inst_def#$tor_user:}
171 tor_group=${inst_def%%:*}
172 inst_def=${inst_def#$tor_group:}
173 tor_pidfile=${inst_def%%:*}
174 tor_datadir=${inst_def#$tor_pidfile:}
175 if [ -z "${tor_conf}" -o -z "${tor_user}" -o -z "${tor_group}" -o -z "${tor_pidfile}" -o -z "${tor_datadir}" ]; then
176 warn "invalid tor instance ${inst_name} settings: ${instance}"
180 # regular instance: default parameters are used
181 tor_conf=${tor_conf}@${inst_name}
182 tor_pidfile=${tor_pidfile}@${inst_name}
183 tor_datadir=${tor_datadir}/instance@${inst_name}
185 if ! [ -r ${tor_conf} ]; then
186 warn "tor instance ${inst_name} config file ${tor_conf} doesn't exist or isn't readable"
187 warn "you can copy the sample config %%PREFIX%%/etc/tor/torrc.sample and modify it"
190 if ! [ -d ${tor_datadir} ]; then
191 mkdir -p ${tor_datadir} &&
192 chown ${tor_user}:${tor_group} ${tor_datadir} &&
193 chmod 0700 ${tor_datadir} &&
194 echo "${name}: created the instance data directory ${tor_datadir}"
198 if [ -z "${instance}" -a -n "${tor_instances}" ]; then
201 for i in ${tor_instances}; do
203 if [ -z "${inst_only}" -o "${inst_name}" = "${inst_only}" ]; then
204 echo -n "${name} instance ${inst_name}: "
205 if ! slave_instance=${i} %%PREFIX%%/etc/rc.d/tor "$1"; then
208 inst_done=$((inst_done+1))
211 if [ -z "${inst_only}" -o "${inst_only}" = "main" ]; then
212 checkyesno tor_disable_default_instance && return $exit_code
213 echo -n "${name} main instance: "
214 elif [ -n "${inst_only}" ]; then
215 [ $inst_done -gt 0 ] || err 1 "${name} instance '$inst_only' isn't defined"
220 required_files=${tor_conf}
221 required_dirs=${tor_datadir}
222 pidfile=${tor_pidfile}
223 command="%%PREFIX%%/bin/${name}"
224 command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir}"
225 extra_commands="reload"
227 if [ $tor_setuid = "YES" ]; then
228 if ! grep -q "^User ${tor_user}$" ${tor_conf}; then
229 echo "User ${tor_user}" >> ${tor_conf}
234 if grep -q "^User ${tor_user}$" ${tor_conf}; then
235 sed -i '' -e "s/^User ${tor_user}$//" ${tor_conf}
239 if ! run_rc_command "$1"; then