From 145c6c43b078d524367d260e75eb5dfcadcf1425 Mon Sep 17 00:00:00 2001
From: Michael Hanson <hansonorders@verison.net>
Date: Sun, 4 Apr 2010 23:41:44 +0000
Subject: transmission-cli: rework run file and .install file

---
 .../community/transmission-cli/PKGBUILD            | 14 ++++-----
 .../community/transmission-cli/finish              | 15 ----------
 abs/extra-testing/community/transmission-cli/run   | 35 ----------------------
 .../community/transmission-cli/run.transmissiond   | 29 ++++++++++++++++++
 .../transmission-cli/transmission-cli.install      | 20 ++++++++-----
 5 files changed, 47 insertions(+), 66 deletions(-)
 delete mode 100755 abs/extra-testing/community/transmission-cli/finish
 delete mode 100755 abs/extra-testing/community/transmission-cli/run
 create mode 100755 abs/extra-testing/community/transmission-cli/run.transmissiond

diff --git a/abs/extra-testing/community/transmission-cli/PKGBUILD b/abs/extra-testing/community/transmission-cli/PKGBUILD
index 6cbe7e5..6bbb809 100644
--- a/abs/extra-testing/community/transmission-cli/PKGBUILD
+++ b/abs/extra-testing/community/transmission-cli/PKGBUILD
@@ -4,7 +4,7 @@
 
 pkgname=transmission-cli
 pkgver=1.92
-pkgrel=1
+pkgrel=2
 pkgdesc="Fast, easy, and free BitTorrent client (CLI tools, daemon and web client)"
 arch=('i686' 'x86_64')
 url="http://www.transmissionbt.com/"
@@ -15,8 +15,7 @@ replaces=('transmission')
 backup=('etc/conf.d/transmissiond')
 install=transmission-cli.install
 source=(http://mirrors.m0k.org/transmission/files/transmission-$pkgver.tar.bz2
-        run
-        finish
+        run.transmissiond
         transmission-cli.install
         transmissiond.conf)
 
@@ -29,14 +28,11 @@ build() {
 
   mkdir -p -m744 "$pkgdir/etc/sv/transmissiond" || return 1
   mkdir -p -m777 "$pkgdir/myth/transmission" || return 1
-  install -D -m755 "$srcdir/run" "$pkgdir/etc/sv/transmissiond/run" || return 1
-  install -D -m755 "$srcdir/finish" "$pkgdir/etc/sv/transmissiond/finish" || return 1
+  install -D -m755 "$srcdir/run.transmissiond" "$pkgdir/etc/sv/transmissiond/run" || return 1
   install -D -m644 "$srcdir/transmissiond.conf" "$pkgdir/etc/conf.d/transmissiond" || return 1
-
   install -D -m644 COPYING "$pkgdir/usr/share/licenses/transmission-cli/COPYING" || return 1
 }
 md5sums=('561357621331f294c87f78e22783a283'
-         'fd5ec0a496b6833074fd125b1fb70e47'
-         'f0e4e06f7307c75ceda6ccd4e74975b5'
-         'f1a15f339515f522c5895e6f40491a46'
+         'b91534aaf2e403331c611c615ab2c03d'
+         'd4d664448983db3c9e8acd08f1bdc798'
          'd05567c7a4f9df9f28602d1356d5c05c')
diff --git a/abs/extra-testing/community/transmission-cli/finish b/abs/extra-testing/community/transmission-cli/finish
deleted file mode 100755
index 7a09e4f..0000000
--- a/abs/extra-testing/community/transmission-cli/finish
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /etc/conf.d/transmissiond
-
-PID=`pidof -o %PPID /usr/bin/transmission-daemon`
-    stat_runit "Stopping Transmission Daemon"
-    [ ! -z "$PID" ] && kill $PID &> /dev/null
-    if [ $? -ne 0 ]; then
-      stat_fail
-    else
-      rm_daemon transmissiond
-      stat_done
-    fi
diff --git a/abs/extra-testing/community/transmission-cli/run b/abs/extra-testing/community/transmission-cli/run
deleted file mode 100755
index 6bcab36..0000000
--- a/abs/extra-testing/community/transmission-cli/run
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /etc/conf.d/transmissiond
-
-CONFIGDIR=/home/$TRANS_USER/.config/transmission-daemon
-PID=`pidof -o %PPID /usr/bin/transmission-daemon`
-# Update the block lists - try to keep the bad guys out.
-          cd ${CONFIGDIR}/blocklists
-          if [ $? -eq 0 ]; then
-             find . -mtime +4 -type f -name level1 -exec rm {} \;
-             if [ ! -f ${CONFIGDIR}/blocklists/level1 ]; then
-                # update blocklist
-               # echo "updating blocklist, ~4MB"
-                wget -q -O level1.gz http://download.m0k.org/transmission/files/level1.gz
-                if [ -f level1.gz ]; then
-                  gunzip level1.gz
-                  if [ $? -eq 0 ]; then
-                    chmod go+r level1
-                  else
-                    rm -f level1*
-                  fi
-                fi
-             fi
-             cd - 2>&1 >/dev/null
-          fi
-    stat_runit "Starting Transmission Daemon"
-    [ -z "$PID" ] && su -l -c "/usr/bin/nice -n 19 /usr/bin/transmission-daemon $TRANS_OPTS" $TRANS_USER 2>/dev/null
-    if [ $? -ne 0 ]; then
-      stat_fail
-    else
-      add_daemon transmissiond
-      stat_done
-    fi
diff --git a/abs/extra-testing/community/transmission-cli/run.transmissiond b/abs/extra-testing/community/transmission-cli/run.transmissiond
new file mode 100755
index 0000000..714c946
--- /dev/null
+++ b/abs/extra-testing/community/transmission-cli/run.transmissiond
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/transmissiond
+
+CONFIGDIR=/home/$TRANS_USER/.config/transmission-daemon
+PID=`pidof -o %PPID /usr/bin/transmission-daemon`
+# Update the block lists - try to keep the bad guys out.
+          cd ${CONFIGDIR}/blocklists
+          if [ $? -eq 0 ]; then
+             find . -mtime +4 -type f -name level1 -exec rm {} \;
+             if [ ! -f ${CONFIGDIR}/blocklists/level1 ]; then
+                # update blocklist
+               # echo "updating blocklist, ~4MB"
+                wget -q -O level1.gz http://download.m0k.org/transmission/files/level1.gz
+                if [ -f level1.gz ]; then
+                  gunzip level1.gz
+                  if [ $? -eq 0 ]; then
+                    chmod go+r level1
+                  else
+                    rm -f level1*
+                  fi
+                fi
+             fi
+             cd - 2>&1 >/dev/null
+          fi
+    stat_runit "Starting Transmission Daemon"
+    [ -z "$PID" ] && exec su -l -c "/usr/bin/nice -n 19 /usr/bin/transmission-daemon $TRANS_OPTS" $TRANS_USER 2>/dev/null
diff --git a/abs/extra-testing/community/transmission-cli/transmission-cli.install b/abs/extra-testing/community/transmission-cli/transmission-cli.install
index d69601d..f64fe65 100644
--- a/abs/extra-testing/community/transmission-cli/transmission-cli.install
+++ b/abs/extra-testing/community/transmission-cli/transmission-cli.install
@@ -1,19 +1,25 @@
 post_install() {
+  add_service.sh transmissiond
+
   cat << _EOF
 
-  If you want to run the Transmission daemon at boot,
-  run add_service.sh transmissiond as root.
-  
   You can edit the user and options in /etc/conf.d/transmissiond.
 
-  There is a lot of good information on setting up a web
-  interface proxy through lighttpd at:
-  http://mybookworld.wikidot.com/transmission
+  To set up a web interface proxy with lighttpd visit:
+  http://trac.transmissionbt.com/wiki/WebProxy
 
   Configuration file editing information can be found at:
   http://trac.transmissionbt.com/wiki/ConfigFiles
 
-
 _EOF
 
 }
+
+pre_upgrade() {
+  rm -f /usr/share/man/man1/transmission*
+
+}
+
+pre_remove() {
+  remove_service.sh transmissiond
+}
-- 
cgit v0.12

