Ravenports generated: 29 Apr 2018 18:37
[ravenports.git] / bucket_A0 / tor
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               tor
4 VERSION=                0.3.2.10
5 KEYWORDS=               security net
6 VARIANTS=               standard
7 SDESC[standard]=        Anonymizing overlay network for TCP
8 HOMEPAGE=               https://www.torproject.org/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            TOR/
13 DISTFILE[1]=            tor-0.3.2.10.tar.gz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        complete
16                         primary
17                         docs
18
19 OPTIONS_AVAILABLE=      none
20 OPTIONS_STANDARD=       none
21
22 BUILD_DEPENDS=          asciidoc:single:py27
23 BUILDRUN_DEPENDS=       libevent:single:standard
24                         xz:single:standard
25
26 USERS=                  _tor
27 GROUPS=                 _tor
28 USERGROUP_SPKG=         primary
29
30 USES=                   cpe gmake pkgconfig ssl zlib cclibs:primary
31
32 LICENSE=                BSD3CLAUSE:primary
33 LICENSE_FILE=           BSD3CLAUSE:{{WRKSRC}}/LICENSE
34 LICENSE_SCHEME=         solo
35
36 CPE_VENDOR=             torproject
37 FPC_EQUIVALENT=         security/tor
38
39 MUST_CONFIGURE=         gnu
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"
45
46 PLIST_SUB=              USER="{{USERS}}"
47                         GROUP="{{GROUPS}}"
48 RC_SUBR=                tor:primary
49 SUB_LIST=               USER="{{USERS}}"
50                         GROUP="{{GROUPS}}"
51
52 post-patch:
53         ${REINPLACE_CMD} -E -e "s@(-z) (relro|now)@-Wl,\1,\2@g" \
54                 ${WRKSRC}/configure
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@" \
60                 ${WRKSRC}/configure
61
62 post-install:
63         @${MKDIR} ${STAGEDIR}/var/log/tor \
64                 ${STAGEDIR}/var/run/tor \
65                 ${STAGEDIR}/var/db/tor
66
67 [FILE:547:descriptions/desc.primary]
68 Tor: an anonymizing overlay network for TCP
69
70 Tor is a connection-based low-latency anonymous communication system which
71 addresses many flaws in the original onion routing design.
72
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.
78
79
80 [FILE:98:distinfo]
81 60df77c31dcf94fdd686c8ca8c34f3b70243b33a7344ecc0b719d5ca2617cbee      6421984 tor-0.3.2.10.tar.gz
82
83
84 [FILE:299:manifests/plist.primary]
85 bin/
86  tor
87  tor-gencert
88  tor-resolve
89  torify
90 @sample etc/tor/torrc.sample
91 share/man/man1/
92  tor-gencert.1.gz
93  tor-resolve.1.gz
94  tor.1.gz
95  torify.1.gz
96 share/tor/
97  geoip
98  geoip6
99 @dir(%%USER%%,%%GROUP%%,700) /var/run/tor
100 @dir(%%USER%%,%%GROUP%%,700) /var/log/tor
101 @dir(%%USER%%,%%GROUP%%,700) /var/db/tor
102
103
104 [FILE:74:manifests/plist.docs]
105 share/doc/tor/
106  tor-gencert.html
107  tor-resolve.html
108  tor.html
109  torify.html
110
111
112 [FILE:4107:files/tor.in]
113 #!/bin/sh
114 #
115 # PROVIDE: tor
116 # REQUIRE: DAEMON FILESYSTEMS
117 # BEFORE: LOGIN
118 #
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.
122 #
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.
133 #                       Default: NO
134 # tor_setuid (str):     Runtime setuid.  Default: NO
135 #
136 # The instance definition that tor_instances expects:
137 # inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir}
138 #
139
140 . /etc/rc.subr
141
142 name="tor"
143 rcvar=tor_enable
144 exit_code=0
145
146 load_rc_config ${name}
147
148 : ${tor_enable="NO"}
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"}
156 : ${tor_setuid="NO"}
157
158 instance=${slave_instance}
159 if [ -n "${instance}" ]; then
160   inst_def=${instance}
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}"
177       exit 1
178     fi
179   else
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}
184   fi
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"
188     exit 1
189   fi
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}"
195   fi
196 fi
197
198 if [ -z "${instance}" -a -n "${tor_instances}" ]; then
199   inst_only="$2"
200   inst_done=0
201   for i in ${tor_instances}; do
202     inst_name=${i%%:*}
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
206         exit_code=1
207       fi
208       inst_done=$((inst_done+1))
209     fi
210   done
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"
216     return  $exit_code
217   fi
218 fi
219
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"
226
227 if [ $tor_setuid = "YES" ]; then
228   if ! grep -q "^User ${tor_user}$" ${tor_conf}; then
229     echo "User ${tor_user}" >> ${tor_conf}
230   fi
231   tor_user="root"
232   tor_group="wheel"
233 else
234   if grep -q "^User ${tor_user}$" ${tor_conf}; then
235     sed -i '' -e "s/^User ${tor_user}$//" ${tor_conf}
236   fi
237 fi
238
239 if ! run_rc_command "$1"; then
240   exit_code=1
241 fi
242
243 return $exit_code
244