tor/tor.spec

Fri, 24 Jan 2014 17:02:56 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 24 Jan 2014 17:02:56 +0100
changeset 790
ab976cd2e548
parent 789
cbbc8daa8174
permissions
-rw-r--r--

Update vendor version and permit compilation of sloppy constructs.

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

mercurial