Ravenports generated: 22 Sep 2024 04:10
[ravenports.git] / bucket_A0 / tor
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               tor
4 VERSION=                0.4.7.16
5 REVISION=               1
6 KEYWORDS=               security net
7 VARIANTS=               std
8 SDESC[std]=             Anonymizing overlay network for TCP
9 HOMEPAGE=               https://www.torproject.org/
10 CONTACT=                nobody
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            TOR/
14 DISTFILE[1]=            tor-0.4.7.16.tar.gz:main
15 DF_INDEX=               1
16 SPKGS[std]=             set
17                         primary
18                         docs
19                         man
20
21 OPTIONS_AVAILABLE=      none
22 OPTIONS_STANDARD=       none
23
24 BUILD_DEPENDS=          asciidoc:single:std
25                         nss:dev:std
26                         libevent:dev:std
27 BUILDRUN_DEPENDS=       libevent:primary:std
28                         nss:primary:std
29
30 USERS=                  _tor
31 GROUPS=                 _tor
32 USERGROUP_SPKG=         primary
33
34 USES=                   cpe gmake pkgconfig ssl zlib zstd xz cclibs:primary
35
36 LICENSE=                BSD3CLAUSE:primary
37 LICENSE_FILE=           BSD3CLAUSE:{{WRKSRC}}/LICENSE
38 LICENSE_SCHEME=         solo
39
40 CPE_VENDOR=             torproject
41 FPC_EQUIVALENT=         security/tor
42
43 MUST_CONFIGURE=         gnu
44 CONFIGURE_ARGS=         --with-openssl-dir="{{OPENSSLBASE}}"
45                         --enable-linker-hardening
46                         --enable-zstd
47                         --enable-lzma
48                         --enable-nss
49                         --disable-systemd
50 CONFIGURE_ENV=          TOR_CPPFLAGS_libevent="-I{{LOCALBASE}}/include"
51                         TOR_LDFLAGS_libevent="-L{{LOCALBASE}}/lib/"
52                         TOR_LIBEVENT_LIBS="-levent"
53                         tor_cv_cflags__Wextra_semi=no
54
55 PLIST_SUB=              USER="{{USERS}}"
56                         GROUP="{{GROUPS}}"
57 RC_SUBR=                tor:primary
58 SUB_LIST=               USER="{{USERS}}"
59                         GROUP="{{GROUPS}}"
60
61 post-patch:
62         ${REINPLACE_CMD} -E -e "s@(-z) (relro|now)@-Wl,\1,\2@g" \
63                 ${WRKSRC}/configure
64         ${REINPLACE_CMD} -e 's|lib/tor|db/tor|' \
65                 ${WRKSRC}/src/config/torrc.*.in \
66                 ${WRKSRC}/doc/man/tor.1.* \
67                 ${WRKSRC}/doc/man/tor.html.in
68         ${REINPLACE_CMD} -e '/SOURCE_DATE_EPOCH/d' ${WRKSRC}/doc/asciidoc-helper.sh
69         ${REINPLACE_CMD} -e "s@-ltcmalloc@${LOCALBASE}/lib/libtcmalloc.so@" \
70                 ${WRKSRC}/configure
71
72 post-install:
73         ${MKDIR} ${STAGEDIR}/var/log/tor \
74                 ${STAGEDIR}/var/run/tor \
75                 ${STAGEDIR}/var/db/tor
76
77 [FILE:547:descriptions/desc.primary]
78 Tor: an anonymizing overlay network for TCP
79
80 Tor is a connection-based low-latency anonymous communication system which
81 addresses many flaws in the original onion routing design.
82
83 Tor is a toolset for a wide range of organizations and people that want to
84 improve their safety and security on the Internet. Using Tor can help you
85 anonymize web browsing and publishing, instant messaging, IRC, SSH, and
86 more. Tor also provides a platform on which software developers can build
87 new applications with built-in anonymity, safety, and privacy features.
88
89
90 [FILE:98:distinfo]
91 5aeeb071bd5c12eb2eec140a87f94052ecaeb03b5e1cee7d1e5cf1a3cbee7a7c      8120424 tor-0.4.7.16.tar.gz
92
93
94 [FILE:238:manifests/plist.primary]
95 @sample etc/tor/torrc.sample
96 bin/
97  tor
98  tor-print-ed-signing-cert
99  tor-resolve
100  torify
101 share/tor/
102  geoip
103  geoip6
104 @dir(%%USER%%,%%GROUP%%,700) /var/db/tor
105 @dir(%%USER%%,%%GROUP%%,700) /var/log/tor
106 @dir(%%USER%%,%%GROUP%%,700) /var/run/tor
107
108
109 [FILE:106:manifests/plist.docs]
110 share/doc/tor/
111  tor-gencert.html
112  tor-print-ed-signing-cert.html
113  tor-resolve.html
114  tor.html
115  torify.html
116
117
118 [FILE:92:manifests/plist.man]
119 share/man/man1/
120  tor-gencert.1
121  tor-print-ed-signing-cert.1
122  tor-resolve.1
123  tor.1
124  torify.1
125
126
127 [FILE:4107:files/tor.in]
128 #!/bin/sh
129 #
130 # PROVIDE: tor
131 # REQUIRE: DAEMON FILESYSTEMS
132 # BEFORE: LOGIN
133 #
134 # Add the following lines to /etc/rc.conf to enable tor.
135 # All these options will overide any settings in your local torrc as
136 # they are command line options.
137 #
138 # tor_enable (bool):    Set it to "YES" to enable tor. Default: NO
139 # tor_instances (str):  List of instances. Default: ""
140 # tor_conf (str):       Points to your torrc file.
141 #                       Default: %%PREFIX%%/etc/tor/torrc
142 # tor_user (str):       Tor daemon user. Default: %%USER%%
143 # tor_group (str):      Tor group. Default: %%GROUP%%
144 # tor_pidfile (str):    Tor pid file.  Default: /var/run/tor/tor.pid
145 # tor_datadir (str):    Tor datadir.  Default: /var/db/tor
146 # tor_disable_default_instance (str):   Doesn't run the default instance.
147 #                       Only valid when tor_instances is used.
148 #                       Default: NO
149 # tor_setuid (str):     Runtime setuid.  Default: NO
150 #
151 # The instance definition that tor_instances expects:
152 # inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir}
153 #
154
155 . /etc/rc.subr
156
157 name="tor"
158 rcvar=tor_enable
159 exit_code=0
160
161 load_rc_config ${name}
162
163 : ${tor_enable="NO"}
164 : ${tor_instances=""}
165 : ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
166 : ${tor_user="%%USER%%"}
167 : ${tor_group="%%GROUP%%"}
168 : ${tor_pidfile="/var/run/tor/tor.pid"}
169 : ${tor_datadir="/var/db/tor"}
170 : ${tor_disable_default_instance="NO"}
171 : ${tor_setuid="NO"}
172
173 instance=${slave_instance}
174 if [ -n "${instance}" ]; then
175   inst_def=${instance}
176   inst_name=${inst_def%%:*}
177   [ "${inst_name}" != "main" ] || err 1 "${name} instance can't be named 'main'"
178   inst_def=${inst_def#$inst_name}
179   if [ -n "$inst_def" ]; then
180     # extended instance: parameters are set explicitly
181     inst_def=${inst_def#:}
182     tor_conf=${inst_def%%:*}
183     inst_def=${inst_def#$tor_conf:}
184     tor_user=${inst_def%%:*}
185     inst_def=${inst_def#$tor_user:}
186     tor_group=${inst_def%%:*}
187     inst_def=${inst_def#$tor_group:}
188     tor_pidfile=${inst_def%%:*}
189     tor_datadir=${inst_def#$tor_pidfile:}
190     if [ -z "${tor_conf}" -o -z "${tor_user}" -o -z "${tor_group}" -o -z "${tor_pidfile}" -o -z "${tor_datadir}" ]; then
191       warn "invalid tor instance ${inst_name} settings: ${instance}"
192       exit 1
193     fi
194   else
195     # regular instance: default parameters are used
196     tor_conf=${tor_conf}@${inst_name}
197     tor_pidfile=${tor_pidfile}@${inst_name}
198     tor_datadir=${tor_datadir}/instance@${inst_name}
199   fi
200   if ! [ -r ${tor_conf} ]; then
201     warn "tor instance ${inst_name} config file ${tor_conf} doesn't exist or isn't readable"
202     warn "you can copy the sample config %%PREFIX%%/etc/tor/torrc.sample and modify it"
203     exit 1
204   fi
205   if ! [ -d ${tor_datadir} ]; then
206     mkdir -p ${tor_datadir} &&
207     chown ${tor_user}:${tor_group} ${tor_datadir} &&
208     chmod 0700 ${tor_datadir} &&
209     echo "${name}: created the instance data directory ${tor_datadir}"
210   fi
211 fi
212
213 if [ -z "${instance}" -a -n "${tor_instances}" ]; then
214   inst_only="$2"
215   inst_done=0
216   for i in ${tor_instances}; do
217     inst_name=${i%%:*}
218     if [ -z "${inst_only}" -o "${inst_name}" = "${inst_only}" ]; then
219       echo -n "${name} instance ${inst_name}: "
220       if ! slave_instance=${i} %%PREFIX%%/etc/rc.d/tor "$1"; then
221         exit_code=1
222       fi
223       inst_done=$((inst_done+1))
224     fi
225   done
226   if [ -z "${inst_only}" -o "${inst_only}" = "main" ]; then
227     checkyesno tor_disable_default_instance && return $exit_code
228     echo -n "${name} main instance: "
229   elif [ -n "${inst_only}" ]; then
230     [ $inst_done -gt 0 ] || err 1 "${name} instance '$inst_only' isn't defined"
231     return  $exit_code
232   fi
233 fi
234
235 required_files=${tor_conf}
236 required_dirs=${tor_datadir}
237 pidfile=${tor_pidfile}
238 command="%%PREFIX%%/bin/${name}"
239 command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir}"
240 extra_commands="reload"
241
242 if [ $tor_setuid = "YES" ]; then
243   if ! grep -q "^User ${tor_user}$" ${tor_conf}; then
244     echo "User ${tor_user}" >> ${tor_conf}
245   fi
246   tor_user="root"
247   tor_group="wheel"
248 else
249   if grep -q "^User ${tor_user}$" ${tor_conf}; then
250     sed -i '' -e "s/^User ${tor_user}$//" ${tor_conf}
251   fi
252 fi
253
254 if ! run_rc_command "$1"; then
255   exit_code=1
256 fi
257
258 return $exit_code
259