diff -r 221a37376cee -r cbbc8daa8174 tor/tor.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tor/tor.spec Wed Jan 22 21:02:10 2014 +0100 @@ -0,0 +1,134 @@ +## +## tor.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package version +%define V_dist 0.2.3.14-alpha +%define V_opkg 0.2.3.14 + +# package information +Name: tor +Summary: Anonymous Internet Communication System +URL: http://www.torproject.org/ +Vendor: R. Dingledine & N. Mathewson +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: PLUS +Group: Network +License: LGPL +Version: %{V_opkg} +Release: 20120427 + +# list of sources +Source0: http://www.torproject.org/dist/tor-%{V_dist}.tar.gz +Source1: rc.tor +Source2: torrc + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101, gcc +PreReq: OpenPKG, openpkg >= 20100101, tsocks +BuildPreReq: openssl, libevent, zlib +PreReq: openssl, libevent, zlib + +%description + Tor is a toolset for a wide range of organizations and people + that want to improve their safety and security on the Internet. + Using Tor can help you anonymize web browsing and publishing, + instant messaging, IRC, SSH, and other applications that use the TCP + protocol. Tor also provides a platform on which software developers + can build new applications with built-in anonymity, safety, and + privacy features. Your traffic is safer when you use Tor, because + communications are bounced around a distributed network of servers, + called onion routers. Instead of taking a direct route from source to + destination, data packets on the Tor network take a random pathway + through several servers that cover your tracks so no observer at any + single point can tell where the data came from or where it's going. + +%track + prog tor = { + version = %{V_dist} + url = http://www.torproject.org/dist/ + regex = tor-(\d+\.\d+(\.\d+)*(-(alpha|beta|rc))?)\.tar\.gz + } + +%prep + %setup -q -n tor-%{V_dist} + +%build + libs="" + case "%{l_platform -t}" in + *-linux* ) libs="$libs -lrt" ;; + esac + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + LIBS="$libs" \ + ./configure \ + --prefix=%{l_prefix} \ + --mandir=%{l_prefix}/man \ + --with-ssl-dir=%{l_prefix} \ + --with-libevent-dir=%{l_prefix} \ + --disable-asciidoc + %{l_make} %{l_mflags -O} + +%install + %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true + mv $RPM_BUILD_ROOT%{l_prefix}/etc/tor/torrc.sample \ + $RPM_BUILD_ROOT%{l_prefix}/etc/tor/torrc + %{l_shtool} subst \ + -e 's;exec tsocks;exec %{l_prefix}/bin/tsocks;' \ + $RPM_BUILD_ROOT%{l_prefix}/bin/torify + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.tor} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE torrc} $RPM_BUILD_ROOT%{l_prefix}/etc/tor/ + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/var/tor/db + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%config %{l_prefix}/etc/tor/*' \ + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/tor' \ + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/tor/db' + +%files -f files + +%clean + +%post + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} tor status 2>/dev/null` + [ ".$tor_active" = .yes ] && %{l_rc} tor restart + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} tor stop 2>/dev/null + rm -f $RPM_INSTALL_PREFIX/var/tor/tor.* >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/tor/db/* >/dev/null 2>&1 || true + exit 0 +