rpms/bittorrent/FC-4 bittorrent.spec, 1.14, 1.15 bttrack.init, 1.1, 1.2 btseed.init, 1.1, 1.2 sources, 1.6, 1.7 .cvsignore, 1.6, 1.7

Paul Howarth (pghmcfc) fedora-extras-commits at redhat.com
Thu Sep 22 10:00:41 UTC 2005


Author: pghmcfc

Update of /cvs/extras/rpms/bittorrent/FC-4
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3732

Modified Files:
	bittorrent.spec bttrack.init btseed.init sources .cvsignore 
Log Message:
* Thu Sep 15 2005 Paul Howarth <paul at city-fan.org> 4.0.4-1
- new upstream release 4.0.4 (#168323)
- tidy up description text
- improved initscripts (#158273)
- for versions on Fedora Core >= 4 or RHEL, put server data under /srv rather
  than %{_localstatedir}
- separate logs/logrotate scripts for tracker and seeder
- have the gui subpackage obsolete the official BitTorrent RPM package, which
  is called BitTorrent, includes the GUI in the same package and is built
  using python's dist tools and hence doesn't include all dependencies,
  provide initscripts etc.; this provides a clean upgrade path to Extras
- don't delete user/group torrent on uninstall
  (see https://www.redhat.com/archives/fedora-extras-commits/2005-June/msg00271.html)
- move icon to %{_datadir}/icons/hicolor/48x48/apps instead of
  %{_datadir}/pixmaps and update icon cache on installation if
  necessary (#162465)
- no need to set CFLAGS in %build for noarch package
- don't generate redundant python-abi dependency for FC >= 4
- don't need to edit out "env python2"... stuff



Index: bittorrent.spec
===================================================================
RCS file: /cvs/extras/rpms/bittorrent/FC-4/bittorrent.spec,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- bittorrent.spec	24 May 2005 11:18:05 -0000	1.14
+++ bittorrent.spec	22 Sep 2005 10:00:39 -0000	1.15
@@ -3,7 +3,7 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 Name:           bittorrent
-Version:        4.0.2
+Version:        4.0.4
 Release:        1%{?dist}
 Summary:        BitTorrent swarming network file transfer tool
 
@@ -19,24 +19,24 @@
 BuildArch:      noarch
 
 BuildRequires:  python-devel desktop-file-utils
-Requires:       python
+# FC4 and later auto-generate python version dependency
+%if %{!?fedora:0}%{?fedora} < 4 || %{!?rhel:0}%{?rhel}
 Requires:       python-abi = %(%{__python} -c "import sys ; print sys.version[:3]")
+%endif
 
 Requires(pre):  %{_sbindir}/useradd
 Requires(post): /sbin/chkconfig
 Requires(post): /sbin/service
 Requires(preun): /sbin/chkconfig
 Requires(preun): /sbin/service
-Requires(postun): %{_sbindir}/userdel
-Requires(postun): %{_sbindir}/groupdel
 Requires(postun): /sbin/service
 
 %description
-BitTorrent is a tool for copying files from one machine to
-another. FTP punishes sites for being popular: Since all uploading is
-done from one place, a popular site needs big iron and big
-bandwidth. With BitTorrent, clients automatically mirror files they
-download, making the publisher's burden almost nothing.
+BitTorrent is a tool for copying files from one machine to another. FTP
+punishes sites for being popular: Since all uploading is done from one place,
+a popular site needs big iron and big bandwidth. With BitTorrent, clients
+automatically mirror files they download, making the publisher's burden almost
+nothing.
 
 %package        gui
 Summary:        GUI versions of the BitTorrent file transfer tool
@@ -45,29 +45,51 @@
 Requires:       %{name} = %{version}-%{release}
 Requires(post): desktop-file-utils
 Requires(postun): desktop-file-utils
+Obsoletes:	BitTorrent <= %{version}
+Provides:	BitTorrent = %{version}-%{release}
 
 %description    gui
 This package contains the GUI versions of the BitTorrent file transfer
 tool.
 
+# Fedora >= 4 has /srv, as does RHEL >= 4
+%if %{!?fedora:0}%{?fedora} >= 4 || %{!?rhel:0}%{?rhel} >= 4
+%define bt_dir      /srv/bittorrent/data
+%define bt_statedir /srv/bittorrent/state
+%else
+%define bt_dir      %{_localstatedir}/spool/bittorrent
+%define bt_statedir %{_localstatedir}/lib/bittorrent
+%endif
+
 %prep
 %setup -q -n BitTorrent-%{version}
 %{__sed} -i "s/appdir = .*/appdir = '%{name}-%{version}'/" BitTorrent/__init__.py
 
 %{__cat} <<EOF >btseed.sysconfig
-#DIR=%{_localstatedir}/spool/bittorrent
-OPTIONS="--max_upload_rate 350"
+DIR=%{bt_dir}
+OPTIONS="--max_upload_rate 350 --display_interval 300"
+SEEDLOG=%{_localstatedir}/log/bittorrent/btseed.log
 EOF
 
 %{__cat} <<EOF >bttrack.sysconfig
-#PORT=6969
-#DIR=%{_localstatedir}/spool/bittorrent
-#STATEFILE=%{_localstatedir}/lib/bittorrent/bttrack
-#LOGFILE=%{_localstatedir}/log/bittorrent/bttrack.log
-OPTIONS="--show_names 1 --hupmonitor 1"
+PORT=6969
+DIR=%{bt_dir}
+STATEFILE=%{bt_statedir}/bttrack
+LOGFILE=%{_localstatedir}/log/bittorrent/bttrack.log
+OPTIONS="--min_time_between_log_flushes 4.0 --show_names 1 --hupmonitor 1"
+EOF
+
+%{__cat} <<EOF >btseed.logrotate
+%{_localstatedir}/log/bittorrent/btseed.log {
+	notifempty
+	missingok
+	postrotate
+		/sbin/service btseed condrestart 2>/dev/null >/dev/null || true
+	endscript
+}
 EOF
 
-%{__cat} <<EOF >torrent.logrotate
+%{__cat} <<EOF >bttrack.logrotate
 %{_localstatedir}/log/bittorrent/bttrack.log {
 	notifempty
 	missingok
@@ -78,24 +100,26 @@
 EOF
 
 %build
-CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
+%{__python} setup.py build
 
 %install
 %{__rm} -rf $RPM_BUILD_ROOT
 %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
-%{__sed} -i -e 's/env python2/env python/' $RPM_BUILD_ROOT%{_bindir}/*
 
 %{_bindir}/desktop-file-install --vendor %{desktopvendor} \
 	--dir $RPM_BUILD_ROOT%{_datadir}/applications \
 	--add-category X-Fedora \
 	%{SOURCE1}
-%{__install} -d $RPM_BUILD_ROOT%{_localstatedir}/{spool,lib,log}/bittorrent
-%{__install} -m 0644 -D %{SOURCE2}        $RPM_BUILD_ROOT%{_datadir}/pixmaps/bittorrent.png
+%{__install} -d $RPM_BUILD_ROOT%{bt_dir}
+%{__install} -d $RPM_BUILD_ROOT%{bt_statedir}
+%{__install} -d $RPM_BUILD_ROOT%{_localstatedir}/log/bittorrent
+%{__install} -m 0644 -D %{SOURCE2}        $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/bittorrent.png
 %{__install} -m 0755 -D %{SOURCE3}        $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/btseed
 %{__install} -m 0755 -D %{SOURCE4}        $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/bttrack
 %{__install} -m 0644 -D btseed.sysconfig  $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/btseed
 %{__install} -m 0644 -D bttrack.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/bttrack
-%{__install} -m 0644 -D torrent.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/bittorrent
+%{__install} -m 0644 -D btseed.logrotate  $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/btseed
+%{__install} -m 0644 -D bttrack.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/bttrack
 
 %clean
 %{__rm} -rf $RPM_BUILD_ROOT
@@ -117,19 +141,20 @@
 fi
 
 %postun
-if [ $1 -eq 0 ]; then
-	%{_sbindir}/userdel  torrent &>/dev/null || :
-	%{_sbindir}/groupdel torrent &>/dev/null || :
-else
+if [ $1 -gt 0 ]; then
 	/sbin/service btseed  condrestart &>/dev/null || :
 	/sbin/service bttrack condrestart &>/dev/null || :
 fi
 
 %post gui
 %{_bindir}/update-desktop-database %{_datadir}/applications &>/dev/null || :
+/bin/touch --no-create %{_datadir}/icons/hicolor || :
+[ -x %{_bindir}/gtk-update-icon-cache ] && %{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || :
 
 %postun gui
 %{_bindir}/update-desktop-database %{_datadir}/applications &>/dev/null || :
+/bin/touch --no-create %{_datadir}/icons/hicolor || :
+[ -x %{_bindir}/gtk-update-icon-cache ] && %{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor || :
 
 %files
 %defattr(-,root,root,-)
@@ -147,12 +172,13 @@
 %{python_sitelib}/BitTorrent/*.py
 %{python_sitelib}/BitTorrent/*.pyc
 %ghost %{python_sitelib}/BitTorrent/*.pyo
-%attr(-,torrent,torrent) %dir %{_localstatedir}/spool/bittorrent
-%attr(-,torrent,torrent) %dir %{_localstatedir}/lib/bittorrent
+%attr(-,torrent,torrent) %dir %{bt_dir}
+%attr(-,torrent,torrent) %dir %{bt_statedir}
 %attr(-,torrent,torrent) %dir %{_localstatedir}/log/bittorrent
 %{_sysconfdir}/rc.d/init.d/btseed
 %{_sysconfdir}/rc.d/init.d/bttrack
-%config(noreplace) %{_sysconfdir}/logrotate.d/bittorrent
+%config(noreplace) %{_sysconfdir}/logrotate.d/btseed
+%config(noreplace) %{_sysconfdir}/logrotate.d/bttrack
 %config(noreplace) %{_sysconfdir}/sysconfig/btseed
 %config(noreplace) %{_sysconfdir}/sysconfig/bttrack
 
@@ -162,20 +188,40 @@
 %{_bindir}/btmaketorrentgui.py
 %{_datadir}/applications/%{desktopvendor}-bittorrent.desktop
 %{_datadir}/pixmaps/%{name}-%{version}
-%{_datadir}/pixmaps/bittorrent.png
+%{_datadir}/icons/hicolor/48x48/apps/bittorrent.png
 
 %changelog
-* Tue May 24 2005 Paul Howarth <paul at city-fan.org> 4.0.2-1%{?dist}
-- Update to 4.0.2
+* Thu Sep 15 2005 Paul Howarth <paul at city-fan.org> 4.0.4-1
+- new upstream release 4.0.4 (#168323)
+- tidy up description text
+- improved initscripts (#158273)
+- for versions on Fedora Core >= 4 or RHEL, put server data under /srv rather
+  than %{_localstatedir}
+- separate logs/logrotate scripts for tracker and seeder
+- have the gui subpackage obsolete the official BitTorrent RPM package, which
+  is called BitTorrent, includes the GUI in the same package and is built
+  using python's dist tools and hence doesn't include all dependencies,
+  provide initscripts etc.; this provides a clean upgrade path to Extras
+- don't delete user/group torrent on uninstall
+  (see https://www.redhat.com/archives/fedora-extras-commits/2005-June/msg00271.html)
+- move icon to %{_datadir}/icons/hicolor/48x48/apps instead of
+  %{_datadir}/pixmaps and update icon cache on installation if
+  necessary (#162465)
+- no need to set CFLAGS in %%build for noarch package
+- don't generate redundant python-abi dependency for FC >= 4
+- don't need to edit out "env python2"... stuff
+
+* Tue May 24 2005 Paul Howarth <paul at city-fan.org> 4.0.2-1
+- update to 4.0.2
 
-* Mon May 23 2005 Paul Howarth <paul at city-fan.org> 4.0.1-2%{?dist}
+* Mon May 23 2005 Paul Howarth <paul at city-fan.org> 4.0.1-2
 - use macros consistently throughout
 - add initscripts so users can easily set up trackers and seeders
   on their own (#158273)
 - add user torrent for tracker/seeder
 - add logrotate script for tracker
 
-* Wed May 18 2005 Paul Howarth <paul at city-fan.org> 4.0.1-1%{?dist}
+* Wed May 18 2005 Paul Howarth <paul at city-fan.org> 4.0.1-1
 - new upstream release 4.0.1 (#157632)
 - add dist tag
 - source now found on sourceforge.net


Index: bttrack.init
===================================================================
RCS file: /cvs/extras/rpms/bittorrent/FC-4/bttrack.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- bttrack.init	22 May 2005 22:55:32 -0000	1.1
+++ bttrack.init	22 Sep 2005 10:00:39 -0000	1.2
@@ -13,13 +13,13 @@
 [ "${NETWORKING}" = "no" ] && exit 0
 
 
-#default
+# defaults
 PORT=6969
-STATEFILE=/var/lib/bittorrent/bttrack
+STATEFILE=/srv/bittorrent/state/bttrack
 OPTIONS=
 LOGFILE=/var/log/bittorrent/bttrack.log
-# directly of torrents that the tracker is allowed to serve
-DIR="/var/spool/bittorrent"
+# directory of torrents that the tracker is allowed to serve
+DIR="/srv/bittorrent/data"
 
 # source the config
 . /etc/sysconfig/bttrack
@@ -32,10 +32,13 @@
 case "$1" in
   start)
 	echo -n $"Starting BitTorrent tracker: "
-	daemon --user $btuser $prog --port $PORT --dfile $STATEFILE \
-		--logfile $LOGFILE $OPTIONS --allowed_dir $DIR &
+	runuser -s /bin/sh -c "$prog --port $PORT --dfile $STATEFILE --logfile $LOGFILE \
+		$OPTIONS --allowed_dir $DIR" $btuser &> /dev/null &
+	disown -ar
+	usleep 500000
+	status bttrack.py &> /dev/null && echo_success || echo_failure
 	RETVAL=$?
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bttrack
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bttrack.py
 	echo
 	;;
   stop)
@@ -43,7 +46,7 @@
 	killproc $prog
 	#killproc "/usr/bin/python $prog"
 	RETVAL=$?
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bttrack
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bttrack.py
 	echo
 	;;
   restart|reload)
@@ -52,14 +55,14 @@
 	RETVAL=$?
         ;;
   condrestart)
-        if [ -f /var/lock/subsys/bttrack ]; then
+        if [ -f /var/lock/subsys/bttrack.py ]; then
                 $0 stop
 		$0 start
         fi
 	RETVAL=$?
         ;;
   status)
-        status bttrack
+        status bttrack.py
 	RETVAL=$?
         ;;
   *)


Index: btseed.init
===================================================================
RCS file: /cvs/extras/rpms/bittorrent/FC-4/btseed.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- btseed.init	22 May 2005 22:55:32 -0000	1.1
+++ btseed.init	22 Sep 2005 10:00:39 -0000	1.2
@@ -16,7 +16,10 @@
 [ "${NETWORKING}" = "no" ] && exit 0
 
 # default directory for torrents to seed
-DIR=/var/spool/bittorrent
+DIR=/srv/bittorrent/data
+
+# default log file
+SEEDLOG=/var/log/btseed.log
 
 # source the config
 . /etc/sysconfig/btseed
@@ -28,9 +31,12 @@
 case "$1" in
   start)
 	echo -n $"Starting BitTorrent seed client: "
-	daemon --user $btuser $prog $OPTIONS $DIR &
+	runuser -s /bin/sh -c "$prog $OPTIONS $DIR" $btuser &> $SEEDLOG &
+	disown -ar
+	usleep 500000
+	status btlaunchmany.py &> /dev/null && echo_success || echo_failure
 	RETVAL=$?
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/btseed
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/btlaunchmany.py
 	echo
 	;;
   stop)
@@ -38,7 +44,7 @@
 	killproc $prog
 	#killproc "/usr/bin/python $prog"
 	RETVAL=$?
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/btseed
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/btlaunchmany.py
 	echo
 	;;
   restart|reload)
@@ -47,14 +53,14 @@
 	RETVAL=$?
         ;;
   condrestart)
-        if [ -f /var/lock/subsys/btseed ]; then
+        if [ -f /var/lock/subsys/btlaunchmany.py ]; then
                 $0 stop
 		$0 start
         fi
 	RETVAL=$?
         ;;
   status)
-        status btseed
+        status btlaunchmany.py
 	RETVAL=$?
         ;;
   *)


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/bittorrent/FC-4/sources,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sources	24 May 2005 11:18:05 -0000	1.6
+++ sources	22 Sep 2005 10:00:39 -0000	1.7
@@ -1 +1 @@
-4640b7c1bac3146d628f54b20afb87b7  BitTorrent-4.0.2.tar.gz
+7f03514dd4d684728a4e54c6ffce7d1f  BitTorrent-4.0.4.tar.gz


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/bittorrent/FC-4/.cvsignore,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- .cvsignore	24 May 2005 11:18:05 -0000	1.6
+++ .cvsignore	22 Sep 2005 10:00:39 -0000	1.7
@@ -1 +1 @@
-BitTorrent-4.0.2.tar.gz
+BitTorrent-4.0.4.tar.gz




More information about the fedora-extras-commits mailing list