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