# HG changeset patch # User Michael Schloh von Bennewitz # Date 1390420930 -3600 # Node ID cbbc8daa8174a371e27202bed6fb2e0ccaff0d50 # Parent 221a37376cee2de4b08fe696df75201eeebf32dd Import package vendor original specs for necessary manipulations. diff -r 221a37376cee -r cbbc8daa8174 tor/rc.tor --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tor/rc.tor Wed Jan 22 21:02:10 2014 +0100 @@ -0,0 +1,60 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.tor -- Run-Commands +## + +%config + tor_enable="$openpkg_rc_def" + tor_log_prolog="true" + tor_log_epilog="true" + tor_log_numfiles="10" + tor_log_minsize="1M" + tor_log_complevel="9" + +%common + tor_logfile="@l_prefix@/var/tor/tor.log" + tor_pidfile="@l_prefix@/var/tor/tor.pid" + tor_signal () { + [ -f $tor_pidfile ] && kill -$1 `cat $tor_pidfile` + } + +%status -u @l_rusr@ -o + tor_usable="unknown" + tor_active="no" + rcService tor enable yes && \ + tor_signal 0 && tor_active="yes" + echo "tor_enable=\"$tor_enable\"" + echo "tor_usable=\"$tor_usable\"" + echo "tor_active=\"$tor_active\"" + +%start -u @l_rusr@ + rcService tor enable yes || exit 0 + rcService tor active yes && exit 0 + @l_prefix@/bin/tor + +%stop -u @l_rusr@ + rcService tor enable yes || exit 0 + rcService tor active no && exit 0 + tor_signal TERM + sleep 2 + rm -f $tor_pidfile >/dev/null 2>&1 || true + +%restart -u @l_rusr@ + rcService tor enable yes || exit 0 + rcService tor active no && exit 0 + rc tor stop start + +%reload -u @l_rusr@ + rcService tor enable yes || exit 0 + rcService tor active no && exit 0 + tor_signal HUP + +%daily -u @l_susr@ + rcService tor enable yes || exit 0 + shtool rotate -f \ + -n ${tor_log_numfiles} -s ${tor_log_minsize} -d \ + -z ${tor_log_complevel} -m 664 -o @l_rusr@ -g @l_rgrp@ \ + -P "${tor_log_prolog}" \ + -E "${tor_log_epilog}; rc tor restart" \ + ${tor_logfile} + 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 + diff -r 221a37376cee -r cbbc8daa8174 tor/torrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tor/torrc Wed Jan 22 21:02:10 2014 +0100 @@ -0,0 +1,39 @@ +## +## torrc -- Tor Daemon Configuration +## + +# ==== CLIENT CONFIGURATION ==== + +RunAsDaemon 1 +DataDirectory @l_prefix@/var/tor/db +PIDFile @l_prefix@/var/tor/tor.pid +Log notice file @l_prefix@/var/tor/tor.log + +SocksPort 9050 +SocksBindAddress 127.0.0.1 +SocksPolicy accept 127.0.0.1/8 +SocksPolicy reject * +OutboundBindAddress 0.0.0.0 + +AllowUnverifiedNodes middle,rendezvous +#DirServer 18.244.0.188:9031 FFCB 46DB 1339 DA84 674C 70D7 CB58 6434 C437 0441 +#DirServer 18.244.0.114:80 719B E45D E224 B607 C537 07D0 E214 3E2D 423E 74CF +#DirServer 86.59.5.130:80 847B 1F85 0344 D787 6491 A548 92F9 0493 4E4E B85D + +# ==== SERVER CONFIGURATION ==== + +#HiddenServiceDir @l_prefix@/var/tor/db/service/ +#HiddenServicePort 80 127.0.0.1:80 +#HiddenServicePort 22 127.0.0.1:22 + +#Nickname ExampleTOR +#Address tor.example.com +#ContactInfo TOR Administrator +#ORPort 9001 +#ORBindAddress 0.0.0.0:9001 +#DirPort 9030 +#DirBindAddress 0.0.0.0:9030 +#ExitPolicy accept *:6660-6667,reject *:* +#ExitPolicy accept *:119 +#ExitPolicy reject *:* +