[arch-commits] Commit in deluge/trunk (9 files)

Jan Steffens heftig at archlinux.org
Fri Mar 9 12:50:38 EST 2012


    Date: Friday, March 9, 2012 @ 12:50:37
  Author: heftig
Revision: 152816

1.3.4. revamp scripts

Added:
  deluge/trunk/deluge-web.service
  deluge/trunk/deluge.tmpfiles.conf
  deluge/trunk/deluged.conf
    (from rev 152801, deluge/trunk/deluged.conf.d)
  deluge/trunk/deluged.service
Modified:
  deluge/trunk/PKGBUILD
  deluge/trunk/deluge-web	(contents, properties)
  deluge/trunk/deluge.install
  deluge/trunk/deluged	(contents, properties)
Deleted:
  deluge/trunk/deluged.conf.d

----------------------+
 PKGBUILD             |   31 +++++++++++++++++++------------
 deluge-web           |   13 ++++++++-----
 deluge-web.service   |    8 ++++++++
 deluge.install       |   16 ++++++++--------
 deluge.tmpfiles.conf |    1 +
 deluged              |   13 ++++++-------
 deluged.conf         |    2 ++
 deluged.conf.d       |    1 -
 deluged.service      |    9 +++++++++
 9 files changed, 61 insertions(+), 33 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-03-09 17:34:10 UTC (rev 152815)
+++ PKGBUILD	2012-03-09 17:50:37 UTC (rev 152816)
@@ -4,8 +4,8 @@
 # Contributor: Hugo Doria <hugo at archlinux.org>
 
 pkgname=deluge
-pkgver=1.3.3
-pkgrel=5
+pkgver=1.3.4
+pkgrel=1
 pkgdesc="A BitTorrent client with multiple user interfaces in a client/server model"
 arch=('any')
 url="http://deluge-torrent.org/"
@@ -21,19 +21,22 @@
 backup=(etc/conf.d/deluged)
 install=deluge.install
 source=(http://download.deluge-torrent.org/source/$pkgname-$pkgver.tar.bz2
-        deluged deluged.conf.d deluge-web)
-md5sums=('4027c60bb5d1c5da61e97a47e62ab1ab'
-         '7d5790eeb14cd0b47d1bb3e0a19c9935'
-         '332d23fe0d21ce92b494efd73322856c'
-         '6c913ec7322eaa60494ac9d53103005f')
+        deluge.tmpfiles.conf deluged deluge-web deluged.service deluge-web.service deluged.conf)
+md5sums=('44166604853180bb44de2d86b3705bf7'
+         'c50385d32a2db0ef3f46b8caadb0e988'
+         'd58897b9deab9c46c1cff24c30e0f92a'
+         '358dcf943f2251abee6caac62cb10f40'
+         '496f1709ca609e65b8bd592c3705f596'
+         '6a30f7a98ee234b08e255e81f08a65d8'
+         '71d556cf7ce3bb59391797827347e80c')
 
 build() {
-  cd "$srcdir/$pkgname-$pkgver"
+  cd $pkgname-$pkgver
   python2 setup.py build
 }
 
 package() {
-  cd "$srcdir/$pkgname-$pkgver"
+  cd $pkgname-$pkgver
   python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
   install -Dm644 deluge/data/pixmaps/deluge.svg "$pkgdir/usr/share/pixmaps/deluge.svg"
 
@@ -42,8 +45,12 @@
       -i "$_dir/Win32IconImagePlugin.py" \
       -i "$_dir/web/gen_gettext.py"
 
+  cd ..
   install -d "$pkgdir/srv/deluge"
-  install -D "$srcdir/deluged" "$pkgdir/etc/rc.d/deluged"
-  install -D "$srcdir/deluge-web" "$pkgdir/etc/rc.d/deluge-web"
-  install -Dm644 "$srcdir/deluged.conf.d" "$pkgdir/etc/conf.d/deluged"
+  install -Dm644 deluge.tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/deluge.conf"
+  install -D deluged "$pkgdir/etc/rc.d/deluged"
+  install -D deluge-web "$pkgdir/etc/rc.d/deluge-web"
+  install -Dm644 deluged.service "$pkgdir/lib/systemd/system/deluged.service"
+  install -Dm644 deluge-web.service "$pkgdir/lib/systemd/system/deluge-web.service"
+  install -Dm644 deluged.conf "$pkgdir/etc/conf.d/deluged"
 }

Modified: deluge-web
===================================================================
--- deluge-web	2012-03-09 17:34:10 UTC (rev 152815)
+++ deluge-web	2012-03-09 17:50:37 UTC (rev 152816)
@@ -4,18 +4,21 @@
 . /etc/rc.d/functions
 . /etc/conf.d/deluged
 
-[[ -f /var/run/deluge-web.pid ]] && PID=$(cat /var/run/deluge-web.pid)
-[[ -d /proc/$PID ]] || PID=
+PIDFILE=/run/deluge/deluge-web.pid
+WEB_OPTIONS="-f $WEB_OPTIONS"
 
+[[ -f $PIDFILE ]] && PID=$(<$PIDFILE)
+kill -0 $PID || PID=
+
 case "$1" in
   start)
     stat_busy "Starting Deluge WebUI"
-    [[ -z $PID ]] && su -l -s /bin/sh -c "/usr/bin/deluge-web -f >/dev/null" $DELUGE_USER
+    [[ -z $PID ]] && su -l -s /bin/sh -c "/usr/bin/deluge-web $WEB_OPTIONS >/dev/null" deluge
     if [ $? -gt 0 ]; then
       stat_fail
     else
       sleep 1
-      echo $(pgrep -u $DELUGE_USER deluge-web) > /var/run/deluge-web.pid
+      echo $(pgrep -u deluge deluge-web) > $PIDFILE
       add_daemon deluge-web
       stat_done
     fi
@@ -26,7 +29,7 @@
     if [ $? -gt 0 ]; then
       stat_fail
     else
-      rm /var/run/deluge-web.pid
+      rm $PIDFILE
       rm_daemon deluge-web
       stat_done
     fi


Property changes on: deluge/trunk/deluge-web
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Added: deluge-web.service
===================================================================
--- deluge-web.service	                        (rev 0)
+++ deluge-web.service	2012-03-09 17:50:37 UTC (rev 152816)
@@ -0,0 +1,8 @@
+[Unit]
+Description=Deluge WebUI
+After=deluged.service
+
+[Service]
+User=deluge
+EnvironmentFile=/etc/conf.d/deluged
+ExecStart=/usr/bin/deluge-web $WEB_OPTIONS

Modified: deluge.install
===================================================================
--- deluge.install	2012-03-09 17:34:10 UTC (rev 152815)
+++ deluge.install	2012-03-09 17:50:37 UTC (rev 152816)
@@ -1,19 +1,19 @@
 post_install() {
-  getent group deluge &>/dev/null || usr/sbin/groupadd -g 125 deluge
+  getent group deluge &>/dev/null || groupadd -g 125 deluge
   if ! getent passwd deluge &>/dev/null; then
     useradd -c 'Deluge user' -u 125 -g deluge -d /srv/deluge -s /bin/false deluge
     passwd -l deluge &>/dev/null
   fi
 
-  chown deluge:deluge srv/deluge
-
+  mkdir -p run/deluge
+  chown deluge:deluge srv/deluge run/deluge
+  
   post_upgrade
 
-cat << _EOF
->>> The standalone daemon started using /etc/rc.d/deluged uses the "deluge" user
-    by default. Its default download directory is /srv/deluge. You can change
-    the user by editing /etc/conf.d/deluged.
-_EOF
+cat <<EOF
+>>> The optional headless daemon started using /etc/rc.d/deluged uses the "deluge" user.
+    Its default download directory is /srv/deluge.
+EOF
 }
 
 post_upgrade() {

Added: deluge.tmpfiles.conf
===================================================================
--- deluge.tmpfiles.conf	                        (rev 0)
+++ deluge.tmpfiles.conf	2012-03-09 17:50:37 UTC (rev 152816)
@@ -0,0 +1 @@
+d /run/deluge      0755 deluge deluge -

Modified: deluged
===================================================================
--- deluged	2012-03-09 17:34:10 UTC (rev 152815)
+++ deluged	2012-03-09 17:50:37 UTC (rev 152816)
@@ -4,18 +4,19 @@
 . /etc/rc.d/functions
 . /etc/conf.d/deluged
 
-[[ -f /var/run/deluged.pid ]] && PID=$(cat /var/run/deluged.pid)
-[[ -d /proc/$PID ]] || PID=
+PIDFILE=/run/deluge/deluged.pid
+OPTIONS="-P $PIDFILE $OPTIONS"
 
+[[ -f $PIDFILE ]] && PID=$(<$PIDFILE)
+kill -0 $PID || PID=
+
 case "$1" in
   start)
     stat_busy "Starting Deluge Daemon"
-    [[ -z $PID ]] && su -l -s /bin/sh -c "/usr/bin/deluged >/dev/null" $DELUGE_USER
+    [[ -z $PID ]] && su -l -s /bin/sh -c "/usr/bin/deluged $OPTIONS >/dev/null" deluge
     if [ $? -gt 0 ]; then
       stat_fail
     else
-      sleep 1
-      echo $(pgrep -u $DELUGE_USER deluged) > /var/run/deluged.pid
       add_daemon deluged
       stat_done
     fi
@@ -26,7 +27,6 @@
     if [ $? -gt 0 ]; then
       stat_fail
     else
-      rm /var/run/deluged.pid
       rm_daemon deluged
       stat_done
     fi
@@ -40,4 +40,3 @@
     echo "usage: $0 {start|stop|restart}"
 esac
 exit 0
-


Property changes on: deluge/trunk/deluged
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Copied: deluge/trunk/deluged.conf (from rev 152801, deluge/trunk/deluged.conf.d)
===================================================================
--- deluged.conf	                        (rev 0)
+++ deluged.conf	2012-03-09 17:50:37 UTC (rev 152816)
@@ -0,0 +1,2 @@
+OPTIONS=""
+WEB_OPTIONS=""

Deleted: deluged.conf.d
===================================================================
--- deluged.conf.d	2012-03-09 17:34:10 UTC (rev 152815)
+++ deluged.conf.d	2012-03-09 17:50:37 UTC (rev 152816)
@@ -1 +0,0 @@
-DELUGE_USER="deluge"

Added: deluged.service
===================================================================
--- deluged.service	                        (rev 0)
+++ deluged.service	2012-03-09 17:50:37 UTC (rev 152816)
@@ -0,0 +1,9 @@
+[Unit]
+Description=Deluge Daemon
+
+[Service]
+User=deluge
+EnvironmentFile=/etc/conf.d/deluged
+ExecStart=/usr/bin/deluged -P /run/deluge/deluged.pid $OPTIONS
+Type=forking
+PIDFile=/run/deluge/deluged.pid



More information about the arch-commits mailing list