Ticket #9327: Portfile

File Portfile, 2.2 KB (added by kayos@…, 18 years ago)

Portfile for tmpreaper-1.6.5

Line 
1# $Id: Portfile,v 1.22 2006/05/08 18:42:53 toby Exp $
2
3PortSystem 1.0
4name             tor
5version          0.1.1.20
6revision         1
7categories       security
8maintainers      toby@opendarwin.org
9description      anonymizing overlay network for TCP
10long_description \
11        Tor provides a distributed network of servers \
12        (onion routers). Users bounce their TCP streams \
13        (web traffic, FTP, SSH, etc.) around the \
14        routers. This makes it hard for recipients, \
15        observers, and even the onion routers \
16        themselves to track the source of the stream.
17homepage         http://tor.eff.org/
18platforms        darwin
19master_sites     ${homepage}dist/
20checksums        sha1 34af6983edd96d79c73e360aebc74d77d9bb828b
21depends_lib      lib:XXX:libevent
22configure.env    CPPFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib
23configure.args   --mandir=${prefix}/share/man
24
25test.run         yes
26test.target      check
27
28set torGroup    tor
29set torUser     tor
30
31post-destroot {
32        xinstall -o tor -g tor -m 755 -d ${destroot}${prefix}/var/run/tor
33        destroot.keepdirs-append ${destroot}${prefix}/var/run/tor
34        system "chown -R tor:tor ${destroot}${prefix}/var/run/tor"
35
36        xinstall -o tor -g tor -m 755 -d ${destroot}${prefix}/var/lib/tor
37        destroot.keepdirs-append ${destroot}${prefix}/var/lib/tor
38        system "chown -R tor:tor ${destroot}${prefix}/var/lib/tor"
39}
40
41pre-configure {
42        addgroup    ${torGroup}
43        adduser     ${torUser} gid=[existsgroup ${torGroup}]
44}
45
46platform darwin {
47        startupitem.create          yes
48        startupitem.name            Tor
49        startupitem.pidfile         auto ${prefix}/var/run/tor/tor.pid
50        startupitem.logfile         ${prefix}/var/log/tor.log
51
52        startupitem.start           "\${prefix}/bin/tor \\"
53        startupitem.start-append    "\t\t--pidfile ${prefix}/var/run/tor/tor.pid \\"
54        startupitem.start-append    "\t\t--datadirectory ${prefix}/var/lib/tor \\"
55        startupitem.start-append    "\t\t--user ${torUser} \\"
56        startupitem.start-append    "\t\t--group ${torGroup} 2>&1"
57
58        startupitem.stop            "if \[ -f \"${prefix}/var/run/tor/tor.pid\" \]; then"
59        startupitem.stop-append     "\tkill `cat ${prefix}/var/run/tor/tor.pid` \\"
60        startupitem.stop-append     "else"
61        startupitem.stop-append     "\t/usr/bin/killall -SIGUSR1 tor 2>/dev/null"
62        startupitem.stop-append     "fi"
63}