diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-06-06 23:20:28 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-06-06 23:20:28 +0000 |
commit | 37c45424d610e4ef077ff375a24240bb209f9eb8 (patch) | |
tree | b70a5da48b663cb8139e8639fecfe5ca57d2dfad /contrib | |
parent | efbeadd61085c758deee94acf8d5f0484e4cd315 (diff) | |
download | tor-37c45424d610e4ef077ff375a24240bb209f9eb8.tar.gz tor-37c45424d610e4ef077ff375a24240bb209f9eb8.zip |
Checkpoint work towards making tor.spec work with current tor and conform (more or less) to fedora.us packaging guidelines
svn:r1953
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/.cvsignore | 1 | ||||
-rw-r--r-- | contrib/tor.sh.in | 21 | ||||
-rw-r--r-- | contrib/tor.spec (renamed from contrib/tor.spec.in) | 59 |
3 files changed, 55 insertions, 26 deletions
diff --git a/contrib/.cvsignore b/contrib/.cvsignore index 70f664f59f..bd9dc78554 100644 --- a/contrib/.cvsignore +++ b/contrib/.cvsignore @@ -1,5 +1,4 @@ Makefile Makefile.in tor.sh -tor.spec torify diff --git a/contrib/tor.sh.in b/contrib/tor.sh.in index 151d119013..dfde1f6a45 100644 --- a/contrib/tor.sh.in +++ b/contrib/tor.sh.in @@ -2,8 +2,8 @@ # #tor The Onion Router # -#chkconfig:2345 90 10 -#description: Onion Router +# chkconfig: 2345 90 10 +# description: Onion Router TORUSER= TORGROUP= @@ -61,6 +61,22 @@ case "$1" in fi ;; + reload) + if [ -f $TORPID ]; then + echo -n "Sending HUP to tor..." + kill -HUP `cat $TORPID` + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + echo " ok" + else + echo " ERROR!" + fi + else + echo "Unable to kill tor: $TORPID does not exist" + RETVAL=1 + fi + ;; + restart) $0 stop if [ -f $TORPID ]; then @@ -69,6 +85,7 @@ case "$1" in $0 start ;; + status) PID=`cat $TORPID 2>/dev/null` if [ "$PID" != "" ]; then diff --git a/contrib/tor.spec.in b/contrib/tor.spec index 5d9c1356d7..9a48cecf72 100644 --- a/contrib/tor.spec.in +++ b/contrib/tor.spec @@ -1,26 +1,34 @@ -%define rellevel 2 -%define relbase std.%{rellevel} -%define rhrel %([ -f /etc/redhat-release ] && (sed -e 's/^Red Hat Linux release //' -e 's/ .*$//' -e 's/\\./_/g' -e 's/^.*$/.rh&/' < /etc/redhat-release)) +# TODO: +# Add /etc/logrotate.d/tor +# + %define blddate %(date -u +"%Y%m%d%H%M") -%define release %{relbase}%{rhrel}.%{blddate} -%define initdir /etc/rc.d/init.d +%define version 0.0.7 +%define version_extra rc2 +%define vepoch 0.1 +%define tor_version %{version}%{version_extra} +# not quite right XXXXX +%define release 0.std.%{vepoch}.%{version_extra} -Summary: tor: anonymizing overlay network for TCP Name: tor -Version: @VERSION@ -Vendor: R. Dingledine <arma@seul.org> +Version: %{version} Release: %{release} +Summary: Anonymizing overlay network for TCP +Vendor: R. Dingledine <arma@seul.org> +Packager: Nick Mathewson <nickm@seul.org> License: BSD-like Group: Applications/Internet URL: http://freehaven.net/tor/ -Source0: http://freehaven.net/tor/dist/tor-%{version}.tar.gz +Source0: http://freehaven.net/tor/dist/tor-%{tor_version}.tar.gz +Requires: openssl >= 0.9.6 +BuildRequires: openssl-devel >= 0.9.6 Requires(pre): shadow-utils, /usr/bin/id, /bin/date, /bin/sh Requires(pre): %{_sbindir}/useradd, %{_sbindir}/groupadd -BuildRoot: %{_tmppath}/%{name}-%{version}-%{relbase}-root +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description Tor is a connection-based low-latency anonymous communication system which @@ -58,7 +66,7 @@ group, set tor up to run as a daemon, and automatically start it at installation time. %prep -%setup -q +%setup -q -n tor-%{tor_version} # Patch the startup script to use the right user and group IDs. Force # the use of /bin/sh as the shell for the "tor" account. @@ -80,19 +88,19 @@ q %makeinstall # Install init script. -%__mkdir_p ${RPM_BUILD_ROOT}%{initdir} -%__install -m 755 contrib/tor.sh ${RPM_BUILD_ROOT}%{initdir}/tor +%__mkdir_p ${RPM_BUILD_ROOT}%{_initrddir} +%__install -p -m 755 contrib/tor.sh ${RPM_BUILD_ROOT}%{_initrddir}/tor # Directories that don't have any preinstalled files -%__mkdir_p -m 700 ${RPM_BUILD_ROOT}/var/lib/tor -%__mkdir_p -m 755 ${RPM_BUILD_ROOT}/var/run/tor -%__mkdir_p -m 755 ${RPM_BUILD_ROOT}/var/log/tor +%__mkdir_p -m 700 ${RPM_BUILD_ROOT}%{_localstatedir}/lib/tor +%__mkdir_p -m 755 ${RPM_BUILD_ROOT}%{_localstatedir}/run/tor +%__mkdir_p -m 755 ${RPM_BUILD_ROOT}%{_localstatedir}/log/tor %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %pre -[ -f %{initdir}/tor ] && /sbin/service tor stop +[ -f %{_initrddir}/tor ] && /sbin/service tor stop if [ ! -n "`/usr/bin/id -g tor 2>/dev/null`" ]; then # One would like to default the GID, but doing that properly would # require thought. @@ -118,20 +126,25 @@ fi %files %defattr(-,root,root) -%doc AUTHORS INSTALL LICENSE README +%doc AUTHORS INSTALL LICENSE README ChangeLog doc/HACKING doc/TODO doc/FAQ +#%{_mandir}/man1/tor.1.gz +#%{_mandir}/man1/torify.1.gz %{_mandir}/man*/* %{_bindir}/tor %{_bindir}/torify -%{initdir}/tor +%config %{_initrddir}/tor %dir %{_sysconfdir}/tor/ -%config(noreplace) %{_sysconfdir}/tor/torrc +%config(noreplace) %{_sysconfdir}/tor/torrc.sample %config(noreplace) %{_sysconfdir}/tor/dirservers %config(noreplace) %{_sysconfdir}/tor/tor-tsocks.conf -%attr(-,tor,tor) %dir /var/lib/tor -%attr(-,tor,tor) %dir /var/run/tor -%attr(-,tor,tor) %dir /var/log/tor +%attr(0700,tor,tor) %dir %{_localstatedir}/lib/tor +%attr(0755,tor,tor) %dir %{_localstatedir}/run/tor +%attr(0755,tor,tor) %dir %{_localstatedir}/log/tor %changelog +* Mon Jun 06 2004 Nick Mathewson <nickm@freehaven.net> 0.0.7-0.std.0.1.rc2 +- Make spec file more happy with fc2 packaging + * Sat Jan 17 2004 John Bashinski <jbash@velvet.com> - Basic spec file; tested with Red Hat 9. |