rpms/bittorrent/devel bttrack.init, 1.1, 1.2 btseed.init, 1.1, 1.2 bittorrent.spec, 1.15, 1.16
Paul Howarth (pghmcfc)
fedora-extras-commits at redhat.com
Thu Jun 2 11:57:15 UTC 2005
Author: pghmcfc
Update of /cvs/extras/rpms/bittorrent/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27935
Modified Files:
bttrack.init btseed.init bittorrent.spec
Log Message:
* Thu Jun 2 2005 Paul Howarth <paul at city-fan.org> 4.1.1-2
- 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
Index: bttrack.init
===================================================================
RCS file: /cvs/extras/rpms/bittorrent/devel/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 2 Jun 2005 11:57:13 -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,11 @@
case "$1" in
start)
echo -n $"Starting BitTorrent tracker: "
- daemon --user $btuser $prog --port $PORT --dfile $STATEFILE \
- --logfile $LOGFILE $OPTIONS --allowed_dir $DIR &
+ # still sub-optimal startup: does not detach properly from terminal
+ (runuser -s /bin/sh -c "$prog --port $PORT --dfile $STATEFILE --logfile $LOGFILE \
+ $OPTIONS --allowed_dir $DIR" $btuser &) && 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 +44,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 +53,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/devel/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 2 Jun 2005 11:57:13 -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,11 @@
case "$1" in
start)
echo -n $"Starting BitTorrent seed client: "
- daemon --user $btuser $prog $OPTIONS $DIR &
+ # still sub-optimal startup: does not detach properly from terminal
+ (runuser -s /bin/sh -c "$prog $OPTIONS $DIR" $btuser > $SEEDLOG 2>&1 &) &&
+ 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 +43,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 +52,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: bittorrent.spec
===================================================================
RCS file: /cvs/extras/rpms/bittorrent/devel/bittorrent.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- bittorrent.spec 31 May 2005 19:07:14 -0000 1.15
+++ bittorrent.spec 2 Jun 2005 11:57:13 -0000 1.16
@@ -4,7 +4,7 @@
Name: bittorrent
Version: 4.1.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: BitTorrent swarming network file transfer tool
Group: Applications/Internet
@@ -32,11 +32,11 @@
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,52 @@
Requires: %{name} = %{version}-%{release}
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
+Obsoletes: BitTorrent <= %{version}
+Provides: BitTorrent
%description gui
This package contains the GUI versions of the BitTorrent file transfer
tool.
+# Fedora >= 4 has /srv, as does RHEL4
+# Older versions of RHEL don't provide other dependencies needed for this package, so don't cater for them
+%if "%{fedora}" >= "4" || 0%{?rhel}
+%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 >torrent.logrotate
+%{__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 >bttrack.logrotate
%{_localstatedir}/log/bittorrent/bttrack.log {
notifempty
missingok
@@ -89,13 +112,16 @@
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
--add-category X-Fedora \
%{SOURCE1}
-%{__install} -d $RPM_BUILD_ROOT%{_localstatedir}/{spool,lib,log}/bittorrent
+%{__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}/pixmaps/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
%{find_lang} bittorrent
%clean
@@ -152,12 +178,13 @@
%{python_sitelib}/khashmir/*.py
%{python_sitelib}/khashmir/*.pyc
%ghost %{python_sitelib}/khashmir/*.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
@@ -170,6 +197,17 @@
%{_datadir}/pixmaps/bittorrent.png
%changelog
+* Thu Jun 2 2005 Paul Howarth <paul at city-fan.org> 4.1.1-2%{?dist}
+- 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
+
* Tue May 31 2005 Paul Howarth <paul at city-fan.org> 4.1.1-1%{?dist}
- update to 4.1.1
- add "khashmir" python library
More information about the fedora-extras-commits
mailing list