Fri, 24 Jan 2014 17:02:56 +0100
Update vendor version and permit compilation of sloppy constructs.
1 ##
2 ## tor.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # package information
25 Name: tor
26 Summary: Anonymous Internet Communication System
27 URL: http://www.torproject.org/
28 Vendor: R. Dingledine & N. Mathewson
29 Packager: OpenPKG Foundation e.V.
30 Distribution: OpenPKG Community
31 Class: PLUS
32 Group: Network
33 License: LGPL
34 Version: 0.2.4.20
35 Release: 20140124
37 # list of sources
38 Source0: http://www.torproject.org/dist/tor-%{version}.tar.gz
39 Source1: rc.tor
40 Source2: torrc
42 # build information
43 BuildPreReq: OpenPKG, openpkg >= 20100101, gcc
44 PreReq: OpenPKG, openpkg >= 20100101, tsocks
45 BuildPreReq: openssl, libevent, zlib
46 PreReq: openssl, libevent, zlib
48 %description
49 Tor is a toolset for a wide range of organizations and people
50 that want to improve their safety and security on the Internet.
51 Using Tor can help you anonymize web browsing and publishing,
52 instant messaging, IRC, SSH, and other applications that use the TCP
53 protocol. Tor also provides a platform on which software developers
54 can build new applications with built-in anonymity, safety, and
55 privacy features. Your traffic is safer when you use Tor, because
56 communications are bounced around a distributed network of servers,
57 called onion routers. Instead of taking a direct route from source to
58 destination, data packets on the Tor network take a random pathway
59 through several servers that cover your tracks so no observer at any
60 single point can tell where the data came from or where it's going.
62 %track
63 prog tor = {
64 version = %{version}
65 url = http://www.torproject.org/dist/
66 regex = tor-(\d+\.\d+(\.\d+)*(-(alpha|beta|rc))?)\.tar\.gz
67 }
69 %prep
70 %setup -q
72 %build
73 libs=""
74 case "%{l_platform -t}" in
75 *-linux* ) libs="$libs -lrt" ;;
76 esac
77 CC="%{l_cc} -fpermissive" \
78 CFLAGS="%{l_cflags -O}" \
79 CPPFLAGS="%{l_cppflags}" \
80 CXX="%{l_cxx}" \
81 CXXFLAGS="%{l_cxxflags -O}" \
82 LDFLAGS="%{l_ldflags}" \
83 LIBS="$libs" \
84 ./configure \
85 --prefix=%{l_prefix} \
86 --mandir=%{l_prefix}/man \
87 --with-ssl-dir=%{l_prefix} \
88 --with-libevent-dir=%{l_prefix} \
89 --disable-asciidoc
90 %{l_make} %{l_mflags -O}
92 %install
93 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
94 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
95 mv $RPM_BUILD_ROOT%{l_prefix}/etc/tor/torrc.sample \
96 $RPM_BUILD_ROOT%{l_prefix}/etc/tor/torrc
97 %{l_shtool} subst \
98 -e 's;exec tsocks;exec %{l_prefix}/bin/tsocks;' \
99 $RPM_BUILD_ROOT%{l_prefix}/bin/torify
100 %{l_shtool} mkdir -f -p -m 755 \
101 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
102 %{l_shtool} install -c -m 755 %{l_value -s -a} \
103 %{SOURCE rc.tor} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
104 %{l_shtool} install -c -m 755 %{l_value -s -a} \
105 %{SOURCE torrc} $RPM_BUILD_ROOT%{l_prefix}/etc/tor/
106 %{l_shtool} mkdir -f -p -m 755 \
107 $RPM_BUILD_ROOT%{l_prefix}/var/tor/db
108 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
109 %{l_files_std} \
110 '%config %{l_prefix}/etc/tor/*' \
111 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/tor' \
112 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/tor/db'
114 %files -f files
116 %clean
118 %post
119 # after upgrade, restart service
120 [ $1 -eq 2 ] || exit 0
121 eval `%{l_rc} tor status 2>/dev/null`
122 [ ".$tor_active" = .yes ] && %{l_rc} tor restart
123 exit 0
125 %preun
126 # before erase, stop service and remove log files
127 [ $1 -eq 0 ] || exit 0
128 %{l_rc} tor stop 2>/dev/null
129 rm -f $RPM_INSTALL_PREFIX/var/tor/tor.* >/dev/null 2>&1 || true
130 rm -f $RPM_INSTALL_PREFIX/var/tor/db/* >/dev/null 2>&1 || true
131 exit 0