tor/tor.spec

120 lines
3.8 KiB
RPMSpec
Raw Normal View History

2012-02-01 20:27:49 +04:00
%define runuser toruser
Name: tor
2016-04-07 00:24:59 +04:00
Version: 0.2.7.6
Release: 1
2012-02-01 20:27:49 +04:00
Summary: Anonymizing overlay network for TCP (The onion router)
URL: http://www.torproject.org/
Group: Networking/Other
License: BSD-like
Requires(post): systemd
2012-02-01 20:27:49 +04:00
Requires(post): rpm-helper
Requires(preun): rpm-helper
Requires: openssl >= 0.9.6
Requires: tsocks
2016-04-07 00:37:33 +04:00
Requires: vidalia
2012-02-01 20:27:49 +04:00
BuildRequires: openssl-devel >= 0.9.6
BuildRequires: libevent-devel
BuildRequires: zlib-devel
BuildRequires: autoconf2.5
#BuildRequires: transfig, tetex-latex
BuildRequires: ghostscript
2012-02-01 20:27:49 +04:00
Source0: http://www.torproject.org/dist/%{name}-%{version}.tar.gz
Source1: %{name}.logrotate
Source3: %{name}.sysconfig
Source4: %{name}.service
Source5: %{name}-tmpfiles.conf
2012-02-01 20:27:49 +04:00
%description
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. Scripts will automatically create a "%{runuser}" user and
group, and set tor up to run as a daemon when the system is rebooted.
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.
2012-02-01 20:27:49 +04:00
%prep
%setup -q
2012-02-01 20:27:49 +04:00
%build
%configure2_5x
%make
%install
%makeinstall
%define _logdir %{_var}/log
install -p -m 644 %{buildroot}%{_sysconfdir}/%{name}/torrc.sample %{buildroot}%{_sysconfdir}/%{name}/torrc
2012-02-01 20:27:49 +04:00
mkdir -p -m 755 %{buildroot}%{_sysconfdir}/logrotate.d
cat %{SOURCE1} > %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
2012-02-01 20:27:49 +04:00
mkdir -p -m 755 %{buildroot}%{_sysconfdir}/sysconfig/
cat %{SOURCE3} > %{buildroot}%{_sysconfdir}/sysconfig/%{name}
2012-02-01 20:27:49 +04:00
mkdir -p -m 700 %{buildroot}%{_localstatedir}/lib/%{name}
mkdir -p -m 755 %{buildroot}%{_var}/%{name}
mkdir -p -m 755 %{buildroot}%{_logdir}/%{name}
2012-02-01 20:27:49 +04:00
# Bash completion
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
echo 'complete -F _command $filenames torify' > %{buildroot}%{_sysconfdir}/bash_completion.d/%{name}
2012-02-01 20:27:49 +04:00
# Systemd support
install -D -p -m 0644 %SOURCE4 %{buildroot}%_unitdir/%name.service
install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf
2012-02-01 20:27:49 +04:00
%pre
%_pre_useradd %{runuser} / /bin/false
%post
%tmpfiles_create %{name}
2012-02-01 20:27:49 +04:00
%_post_service %{name}
%preun
%_preun_service %{name}
rm -f %{_localstatedir}/%{name}/cached-directory
rm -f %{_localstatedir}/%{name}/bw_accounting
rm -f %{_localstatedir}/%{name}/control_auth_cookie
rm -f %{_localstatedir}/%{name}/router.desc
rm -f %{_localstatedir}/%{name}/fingerprint
%postun
%_postun_userdel %{runuser}
%_postun_groupdel %{runuser}
%files
%doc ReleaseNotes INSTALL LICENSE README ChangeLog doc/HACKING
2012-02-01 20:27:49 +04:00
%{_mandir}/man*/*
%{_bindir}/tor
%{_bindir}/torify
%{_bindir}/tor-resolve
%{_bindir}/tor-gencert
%_unitdir/%name.service
%{_tmpfilesdir}/%{name}.conf
2012-02-01 20:27:49 +04:00
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/logrotate.d/%{name}
%dir %attr(0755,root,%{runuser}) %{_sysconfdir}/%{name}/
%config(noreplace) %attr(0644,root,%{runuser}) %{_sysconfdir}/%{name}/*
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%attr(0700,%{runuser},%{runuser}) %dir %{_localstatedir}/lib/%{name}
%attr(0750,%{runuser},%{runuser}) %dir %{_var}/%{name}
2012-02-01 20:27:49 +04:00
%attr(0750,%{runuser},%{runuser}) %dir %{_logdir}/%{name}
%{_sysconfdir}/bash_completion.d/%{name}
%{_datadir}/%{name}