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