## This package understands the following switches: %bcond_without fedora %bcond_without noarch %global username toranon %global uid 19 %global homedir %_var/lib/%name %global logdir %_var/log/%name %{?with_noarch:%global noarch BuildArch: noarch} %{!?release_func:%global release_func() %%{?prerelease:0.}%1%%{?prerelease:.%%prerelease}%%{?dist}} Name: tor Version: 0.2.1.32 Release: %release_func 1400 Group: System Environment/Daemons License: BSD Summary: Anonymizing overlay network for TCP (The onion router) URL: http://tor.eff.org Requires: %name-core = %version-%release Requires: %name-lsb = %version-%release %package core Summary: Core programs for tor Group: System Environment/Daemons URL: http://www.torproject.org Source0: https://www.torproject.org/dist/%name-%version.tar.gz Source1: https://www.torproject.org/dist/%name-%version.tar.gz.asc Source2: tor.logrotate BuildRoot: %_tmppath/%name-%version-%release-root BuildRequires: libevent-devel openssl-devel transfig ghostscript BuildRequires: /usr/bin/latex BuildRequires: texlive-texmf-fonts BuildRequires: fedora-usermgmt-devel Provides: user(%username) = %uid Provides: group(%username) = %uid Requires: init(%name) Requires(pre): /etc/logrotate.d Requires(postun): /etc/logrotate.d %{?FE_USERADD_REQ} %package doc Summary: Documentation for tor Group: System Environment/Daemons Requires: %name-core = %version-%release %{?noarch} %package lsb Summary: LSB initscripts for tor Group: System Environment/Daemons Provides: init(%name) = lsb Conflicts: init(%name) = sysv Requires: %name-core = %version-%release Source10: tor.lsb Requires(pre): %name-core Requires(postun): lsb-core-noarch %name-core Requires(post): lsb-core-noarch Requires(preun): lsb-core-noarch %{?noarch} %package sysv Summary: Tor initscripts for Red Hat's proprietary initsystem Group: System Environment/Daemons Provides: init(%name) = sysv Conflicts: init(%name) = lsb Requires: %name-core = %version-%release Source30: tor.sysv Requires(pre): %name-core Requires(post): chkconfig Requires(preun): chkconfig # This is for /sbin/service Requires(preun): initscripts # This is for /sbin/service Requires(postun): initscripts %{?noarch} %package upstart Summary: upstart initscripts for %name Group: System Environment/Base Source20: %name.upstart Provides: init(%name) = upstart Requires: %name-core = %version-%release Requires(pre): /etc/init Requires(post): /usr/bin/killall Requires(postun): /sbin/initctl %{?noarch} %description Tor is a connection-based low-latency anonymous communication system. Applications connect to the local Tor proxy using the SOCKS protocol. The local proxy chooses a path through a set of relays, in which each relay knows its predecessor and successor, but no others. Traffic flowing down the circuit is unwrapped by a symmetric key at each relay, which reveals the downstream relay. Warnings: Tor does no protocol cleaning. That means there is a danger that application protocols and associated programs can be induced to reveal information about the initiator. Tor depends on Privoxy and similar protocol cleaners to solve this problem. This is alpha code, and is even more likely than released code to have anonymity-spoiling bugs. The present network is very small -- this further reduces the strength of the anonymity provided. Tor is not presently suitable for high-stakes anonymity. %description core Tor is a connection-based low-latency anonymous communication system. This package provides the "tor" program, which serves as both a client and a relay node. %description doc Tor is a connection-based low-latency anonymous communication system. This package provides documentation for "tor". %description lsb Tor is a connection-based low-latency anonymous communication system. This package contains the LSB compliant initscripts to start the "tor" daemon. %description sysv Tor is a connection-based low-latency anonymous communication system. This package contains the initscripts to start the "tor" daemon with Red Hat's proprietary initsystem. %description upstart Tor is a connection-based low-latency anonymous communication system. This package contains the upstart compliant initscripts to start the "tor" daemon. %prep %setup -q sed -i -e 's!^\(\# *\)\?DataDirectory .*!DataDirectory %homedir/.tor!' src/config/torrc.sample.in cat <>src/config/torrc.sample.in Log notice syslog User %username EOF %build export LDFLAGS='-Wl,--as-needed' %configure make %{?_smp_mflags} make -C doc/design-paper tor-design.pdf %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT mv $RPM_BUILD_ROOT%_sysconfdir/tor/torrc{.sample,} mkdir -p $RPM_BUILD_ROOT{%_sysconfdir/logrotate.d,%_initrddir,%logdir,%homedir,%_var/run/%name} install -p -m0755 %SOURCE10 $RPM_BUILD_ROOT%_initrddir/tor install -p -m0644 %SOURCE2 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/tor install -pD -m 0644 %SOURCE20 $RPM_BUILD_ROOT/etc/init/tor.conf %pre core %__fe_groupadd %uid -r %username &>/dev/null || : %__fe_useradd %uid -r -s /sbin/nologin -d %homedir -M \ -c 'TOR anonymizing user' -g %username %username &>/dev/null || : %postun core %__fe_userdel %username &>/dev/null || : %__fe_groupdel %username &>/dev/null || : %post lsb /usr/lib/lsb/install_initd %_initrddir/tor %preun lsb test "$1" != 0 || %_initrddir/tor stop &>/dev/null || : test "$1" != 0 || /usr/lib/lsb/remove_initd %_initrddir/tor %postun lsb test "$1" = 0 || env -i %_initrddir/tor try-restart &>/dev/null %post sysv # This adds the proper /etc/rc*.d links for the script /sbin/chkconfig --add