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.5.7.tar.gz:main
15 SPKGS[standard]= complete
19 OPTIONS_AVAILABLE= none
20 OPTIONS_STANDARD= none
22 BUILD_DEPENDS= asciidoc:single:standard
23 BUILDRUN_DEPENDS= libevent:single:standard
29 USERGROUP_SPKG= primary
31 USES= cpe gmake pkgconfig ssl zlib zstd cclibs:primary
33 LICENSE= BSD3CLAUSE:primary
34 LICENSE_FILE= BSD3CLAUSE:{{WRKSRC}}/LICENSE
37 CPE_VENDOR= torproject
38 FPC_EQUIVALENT= security/tor
41 CONFIGURE_ARGS= --with-openssl-dir="{{OPENSSLBASE}}"
42 --enable-linker-hardening
47 CONFIGURE_ENV= TOR_CPPFLAGS_libevent="-I{{LOCALBASE}}/include"
48 TOR_LDFLAGS_libevent="-L{{LOCALBASE}}/lib/"
49 TOR_LIBEVENT_LIBS="-levent"
50 tor_cv_cflags__Wextra_semi=no
52 PLIST_SUB= USER="{{USERS}}"
55 SUB_LIST= USER="{{USERS}}"
59 ${REINPLACE_CMD} -E -e "s@(-z) (relro|now)@-Wl,\1,\2@g" \
61 ${REINPLACE_CMD} -e 's|lib/tor|db/tor|' \
62 ${WRKSRC}/src/config/torrc.*.in \
63 ${WRKSRC}/doc/man/tor.1.* \
64 ${WRKSRC}/doc/man/tor.html.in
65 ${REINPLACE_CMD} -e "s@-ltcmalloc@${LOCALBASE}/lib/libtcmalloc.so@" \
69 ${MKDIR} ${STAGEDIR}/var/log/tor \
70 ${STAGEDIR}/var/run/tor \
71 ${STAGEDIR}/var/db/tor
73 [FILE:547:descriptions/desc.primary]
74 Tor: an anonymizing overlay network for TCP
76 Tor is a connection-based low-latency anonymous communication system which
77 addresses many flaws in the original onion routing design.
79 Tor is a toolset for a wide range of organizations and people that want to
80 improve their safety and security on the Internet. Using Tor can help you
81 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
82 more. Tor also provides a platform on which software developers can build
83 new applications with built-in anonymity, safety, and privacy features.
87 447fcaaa133e2ef22427e98098a60a9c495edf9ff3e0dd13f484b9ad0185f074 7816158 tor-0.4.5.7.tar.gz
90 [FILE:345:manifests/plist.primary]
91 @sample etc/tor/torrc.sample
94 tor-print-ed-signing-cert
99 tor-print-ed-signing-cert.1.gz
106 @dir(%%USER%%,%%GROUP%%,700) /var/db/tor
107 @dir(%%USER%%,%%GROUP%%,700) /var/log/tor
108 @dir(%%USER%%,%%GROUP%%,700) /var/run/tor
111 [FILE:106:manifests/plist.docs]
114 tor-print-ed-signing-cert.html
120 [FILE:4107:files/tor.in]
124 # REQUIRE: DAEMON FILESYSTEMS
127 # Add the following lines to /etc/rc.conf to enable tor.
128 # All these options will overide any settings in your local torrc as
129 # they are command line options.
131 # tor_enable (bool): Set it to "YES" to enable tor. Default: NO
132 # tor_instances (str): List of instances. Default: ""
133 # tor_conf (str): Points to your torrc file.
134 # Default: %%PREFIX%%/etc/tor/torrc
135 # tor_user (str): Tor daemon user. Default: %%USER%%
136 # tor_group (str): Tor group. Default: %%GROUP%%
137 # tor_pidfile (str): Tor pid file. Default: /var/run/tor/tor.pid
138 # tor_datadir (str): Tor datadir. Default: /var/db/tor
139 # tor_disable_default_instance (str): Doesn't run the default instance.
140 # Only valid when tor_instances is used.
142 # tor_setuid (str): Runtime setuid. Default: NO
144 # The instance definition that tor_instances expects:
145 # inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir}
154 load_rc_config ${name}
157 : ${tor_instances=""}
158 : ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
159 : ${tor_user="%%USER%%"}
160 : ${tor_group="%%GROUP%%"}
161 : ${tor_pidfile="/var/run/tor/tor.pid"}
162 : ${tor_datadir="/var/db/tor"}
163 : ${tor_disable_default_instance="NO"}
166 instance=${slave_instance}
167 if [ -n "${instance}" ]; then
169 inst_name=${inst_def%%:*}
170 [ "${inst_name}" != "main" ] || err 1 "${name} instance can't be named 'main'"
171 inst_def=${inst_def#$inst_name}
172 if [ -n "$inst_def" ]; then
173 # extended instance: parameters are set explicitly
174 inst_def=${inst_def#:}
175 tor_conf=${inst_def%%:*}
176 inst_def=${inst_def#$tor_conf:}
177 tor_user=${inst_def%%:*}
178 inst_def=${inst_def#$tor_user:}
179 tor_group=${inst_def%%:*}
180 inst_def=${inst_def#$tor_group:}
181 tor_pidfile=${inst_def%%:*}
182 tor_datadir=${inst_def#$tor_pidfile:}
183 if [ -z "${tor_conf}" -o -z "${tor_user}" -o -z "${tor_group}" -o -z "${tor_pidfile}" -o -z "${tor_datadir}" ]; then
184 warn "invalid tor instance ${inst_name} settings: ${instance}"
188 # regular instance: default parameters are used
189 tor_conf=${tor_conf}@${inst_name}
190 tor_pidfile=${tor_pidfile}@${inst_name}
191 tor_datadir=${tor_datadir}/instance@${inst_name}
193 if ! [ -r ${tor_conf} ]; then
194 warn "tor instance ${inst_name} config file ${tor_conf} doesn't exist or isn't readable"
195 warn "you can copy the sample config %%PREFIX%%/etc/tor/torrc.sample and modify it"
198 if ! [ -d ${tor_datadir} ]; then
199 mkdir -p ${tor_datadir} &&
200 chown ${tor_user}:${tor_group} ${tor_datadir} &&
201 chmod 0700 ${tor_datadir} &&
202 echo "${name}: created the instance data directory ${tor_datadir}"
206 if [ -z "${instance}" -a -n "${tor_instances}" ]; then
209 for i in ${tor_instances}; do
211 if [ -z "${inst_only}" -o "${inst_name}" = "${inst_only}" ]; then
212 echo -n "${name} instance ${inst_name}: "
213 if ! slave_instance=${i} %%PREFIX%%/etc/rc.d/tor "$1"; then
216 inst_done=$((inst_done+1))
219 if [ -z "${inst_only}" -o "${inst_only}" = "main" ]; then
220 checkyesno tor_disable_default_instance && return $exit_code
221 echo -n "${name} main instance: "
222 elif [ -n "${inst_only}" ]; then
223 [ $inst_done -gt 0 ] || err 1 "${name} instance '$inst_only' isn't defined"
228 required_files=${tor_conf}
229 required_dirs=${tor_datadir}
230 pidfile=${tor_pidfile}
231 command="%%PREFIX%%/bin/${name}"
232 command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir}"
233 extra_commands="reload"
235 if [ $tor_setuid = "YES" ]; then
236 if ! grep -q "^User ${tor_user}$" ${tor_conf}; then
237 echo "User ${tor_user}" >> ${tor_conf}
242 if grep -q "^User ${tor_user}$" ${tor_conf}; then
243 sed -i '' -e "s/^User ${tor_user}$//" ${tor_conf}
247 if ! run_rc_command "$1"; then