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.0.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
27 USERGROUP_SPKG= primary
29 USES= cpe gmake pkgconfig ssl zlib cclibs:primary
31 LICENSE= BSD3CLAUSE:primary
33 LICENSE_FILE= BSD3CLAUSE:{{WRKSRC}}/LICENSE
35 CPE_VENDOR= torproject
36 FPC_EQUIVALENT= security/tor
39 CONFIGURE_ARGS= --with-openssl-dir="{{OPENSSLBASE}}"
40 --enable-linker-hardening
41 CONFIGURE_ENV= TOR_CPPFLAGS_libevent="-I{{LOCALBASE}}/include"
42 TOR_LDFLAGS_libevent="-L{{LOCALBASE}}/lib/"
43 TOR_LIBEVENT_LIBS="-levent"
45 PLIST_SUB= USER="{{USERS}}"
48 SUB_LIST= USER="{{USERS}}"
52 @${REINPLACE_CMD} -E -e "s@(-z) (relro|now)@-Wl,\1,\2@g" \
54 @${REINPLACE_CMD} -e 's|lib/tor|db/tor|' \
55 ${WRKSRC}/src/config/torrc.*.in \
56 ${WRKSRC}/doc/tor.1.* \
57 ${WRKSRC}/doc/tor.html.in
58 @${REINPLACE_CMD} -e "s@-ltcmalloc@${LOCALBASE}/lib/libtcmalloc.so@" \
62 @${MKDIR} ${STAGEDIR}/var/log/tor \
63 ${STAGEDIR}/var/run/tor \
64 ${STAGEDIR}/var/db/tor
66 [FILE:547:descriptions/desc.primary]
67 Tor: an anonymizing overlay network for TCP
69 Tor is a connection-based low-latency anonymous communication system which
70 addresses many flaws in the original onion routing design.
72 Tor is a toolset for a wide range of organizations and people that want to
73 improve their safety and security on the Internet. Using Tor can help you
74 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
75 more. Tor also provides a platform on which software developers can build
76 new applications with built-in anonymity, safety, and privacy features.
80 9a8e6e49a1688dae64dca10f84a414ec9a4f393fb2256ae28e0c2e3239185ab1 5845205 tor-0.3.0.10.tar.gz
83 [FILE:299:manifests/plist.primary]
89 @sample etc/tor/torrc.sample
98 @dir(%%USER%%,%%GROUP%%,700) /var/run/tor
99 @dir(%%USER%%,%%GROUP%%,700) /var/log/tor
100 @dir(%%USER%%,%%GROUP%%,700) /var/db/tor
103 [FILE:74:manifests/plist.docs]
111 [FILE:4107:files/tor.in]
115 # REQUIRE: DAEMON FILESYSTEMS
118 # Add the following lines to /etc/rc.conf to enable tor.
119 # All these options will overide any settings in your local torrc as
120 # they are command line options.
122 # tor_enable (bool): Set it to "YES" to enable tor. Default: NO
123 # tor_instances (str): List of instances. Default: ""
124 # tor_conf (str): Points to your torrc file.
125 # Default: %%PREFIX%%/etc/tor/torrc
126 # tor_user (str): Tor daemon user. Default: %%USER%%
127 # tor_group (str): Tor group. Default: %%GROUP%%
128 # tor_pidfile (str): Tor pid file. Default: /var/run/tor/tor.pid
129 # tor_datadir (str): Tor datadir. Default: /var/db/tor
130 # tor_disable_default_instance (str): Doesn't run the default instance.
131 # Only valid when tor_instances is used.
133 # tor_setuid (str): Runtime setuid. Default: NO
135 # The instance definition that tor_instances expects:
136 # inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir}
145 load_rc_config ${name}
148 : ${tor_instances=""}
149 : ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
150 : ${tor_user="%%USER%%"}
151 : ${tor_group="%%GROUP%%"}
152 : ${tor_pidfile="/var/run/tor/tor.pid"}
153 : ${tor_datadir="/var/db/tor"}
154 : ${tor_disable_default_instance="NO"}
157 instance=${slave_instance}
158 if [ -n "${instance}" ]; then
160 inst_name=${inst_def%%:*}
161 [ "${inst_name}" != "main" ] || err 1 "${name} instance can't be named 'main'"
162 inst_def=${inst_def#$inst_name}
163 if [ -n "$inst_def" ]; then
164 # extended instance: parameters are set explicitly
165 inst_def=${inst_def#:}
166 tor_conf=${inst_def%%:*}
167 inst_def=${inst_def#$tor_conf:}
168 tor_user=${inst_def%%:*}
169 inst_def=${inst_def#$tor_user:}
170 tor_group=${inst_def%%:*}
171 inst_def=${inst_def#$tor_group:}
172 tor_pidfile=${inst_def%%:*}
173 tor_datadir=${inst_def#$tor_pidfile:}
174 if [ -z "${tor_conf}" -o -z "${tor_user}" -o -z "${tor_group}" -o -z "${tor_pidfile}" -o -z "${tor_datadir}" ]; then
175 warn "invalid tor instance ${inst_name} settings: ${instance}"
179 # regular instance: default parameters are used
180 tor_conf=${tor_conf}@${inst_name}
181 tor_pidfile=${tor_pidfile}@${inst_name}
182 tor_datadir=${tor_datadir}/instance@${inst_name}
184 if ! [ -r ${tor_conf} ]; then
185 warn "tor instance ${inst_name} config file ${tor_conf} doesn't exist or isn't readable"
186 warn "you can copy the sample config %%PREFIX%%/etc/tor/torrc.sample and modify it"
189 if ! [ -d ${tor_datadir} ]; then
190 mkdir -p ${tor_datadir} &&
191 chown ${tor_user}:${tor_group} ${tor_datadir} &&
192 chmod 0700 ${tor_datadir} &&
193 echo "${name}: created the instance data directory ${tor_datadir}"
197 if [ -z "${instance}" -a -n "${tor_instances}" ]; then
200 for i in ${tor_instances}; do
202 if [ -z "${inst_only}" -o "${inst_name}" = "${inst_only}" ]; then
203 echo -n "${name} instance ${inst_name}: "
204 if ! slave_instance=${i} %%PREFIX%%/etc/rc.d/tor "$1"; then
207 inst_done=$((inst_done+1))
210 if [ -z "${inst_only}" -o "${inst_only}" = "main" ]; then
211 checkyesno tor_disable_default_instance && return $exit_code
212 echo -n "${name} main instance: "
213 elif [ -n "${inst_only}" ]; then
214 [ $inst_done -gt 0 ] || err 1 "${name} instance '$inst_only' isn't defined"
219 required_files=${tor_conf}
220 required_dirs=${tor_datadir}
221 pidfile=${tor_pidfile}
222 command="%%PREFIX%%/bin/${name}"
223 command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir}"
224 extra_commands="reload"
226 if [ $tor_setuid = "YES" ]; then
227 if ! grep -q "^User ${tor_user}$" ${tor_conf}; then
228 echo "User ${tor_user}" >> ${tor_conf}
233 if grep -q "^User ${tor_user}$" ${tor_conf}; then
234 sed -i '' -e "s/^User ${tor_user}$//" ${tor_conf}
238 if ! run_rc_command "$1"; then