summaryrefslogtreecommitdiff
path: root/extra/transmission
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-08-22 00:02:51 +0000
committerroot <root@rshg054.dnsready.net>2012-08-22 00:02:51 +0000
commit297a042ac9a7bbd2b18a9551f5fa4fe43faf53b2 (patch)
tree75290bf7727659568bf50c0446db690d4888d908 /extra/transmission
parenta3669c04838b48b6891b2ffc4b296fa515f8174f (diff)
Wed Aug 22 00:02:51 UTC 2012
Diffstat (limited to 'extra/transmission')
-rw-r--r--extra/transmission/PKGBUILD18
-rw-r--r--extra/transmission/transmission-cli.install9
-rw-r--r--extra/transmission/transmission.systemd14
-rw-r--r--extra/transmission/transmission.tmpfiles1
-rw-r--r--extra/transmission/transmissiond2
-rw-r--r--extra/transmission/transmissiond.conf5
6 files changed, 38 insertions, 11 deletions
diff --git a/extra/transmission/PKGBUILD b/extra/transmission/PKGBUILD
index fae2b402f..dc5bca7f2 100644
--- a/extra/transmission/PKGBUILD
+++ b/extra/transmission/PKGBUILD
@@ -1,19 +1,17 @@
-# $Id: PKGBUILD 164034 2012-07-24 18:37:58Z ibiru $
+# $Id: PKGBUILD 165472 2012-08-20 13:29:51Z tomegun $
# Maintainer : Ionut Biru <ibiru@archlinux.org>
pkgbase=transmission
pkgname=('transmission-cli' 'transmission-gtk' 'transmission-qt')
pkgver=2.61
-pkgrel=1
+pkgrel=3
arch=('i686' 'x86_64')
url="http://www.transmissionbt.com/"
license=('MIT')
makedepends=('gtk3' 'intltool' 'curl' 'qt' 'libevent')
source=(http://mirrors.m0k.org/transmission/files/$pkgbase-$pkgver.tar.xz
- transmissiond transmissiond.conf)
-md5sums=('2ed5b7815ebda65223bac6bdb09dec42'
- '08875299e3fbb68fc546c1f350ac1f06'
- 'be39806c35b7544856fa4070b00fc960')
+ transmissiond transmissiond.conf transmission.systemd
+ transmission.tmpfiles)
build() {
cd "$pkgbase-$pkgver"
@@ -39,6 +37,9 @@ package_transmission-cli() {
install -D -m755 "$srcdir/transmissiond" "$pkgdir/etc/rc.d/transmissiond"
install -D -m644 "$srcdir/transmissiond.conf" "$pkgdir/etc/conf.d/transmissiond"
+ install -D -m644 "$srcdir/transmission.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/transmission.conf"
+ install -D -m644 "$srcdir/transmission.systemd" "$pkgdir/usr/lib/systemd/system/transmission.service"
+ ln -s transmission.service "$pkgdir/usr/lib/systemd/system/transmissiond.service"
install -D -m644 COPYING "$pkgdir/usr/share/licenses/transmission-cli/COPYING"
}
@@ -70,3 +71,8 @@ package_transmission-qt() {
install -D -m644 qt/icons/transmission.png "$pkgdir/usr/share/pixmaps/transmission-qt.png"
install -D -m644 qt/transmission-qt.desktop "$pkgdir/usr/share/applications/transmission-qt.desktop"
}
+md5sums=('2ed5b7815ebda65223bac6bdb09dec42'
+ '7d6186ee2a852ae3d44980f05063e194'
+ 'db72b02fee139e8ab416324e6c044d76'
+ '5c289c8901221a94be74665368ab5c2c'
+ '23f2320361ad54373c3a4551ef634fe8')
diff --git a/extra/transmission/transmission-cli.install b/extra/transmission/transmission-cli.install
index cb6bf6050..68df89498 100644
--- a/extra/transmission/transmission-cli.install
+++ b/extra/transmission/transmission-cli.install
@@ -3,7 +3,14 @@ post_install() {
If you want to run the Transmission daemon at boot,
add transmissiond to the DAEMONS array in /etc/rc.conf.
- You have to set the user in /etc/conf.d/transmissiond.
_EOF
}
+
+post_upgrade() {
+ # create user/group that the daemon will run as by default, do not delete this on uninstall, as it will own files
+ getent group transmission >/dev/null || groupadd -g 169 transmission
+ getent passwd transmission >/dev/null || useradd -c 'Transmission BitTorrent Client' -u 169 -g transmission -b '/var/lib' -m -s /bin/false transmission
+ passwd -l transmission &>/dev/null
+ systemd-tmpfiles --create transmission.conf
+}
diff --git a/extra/transmission/transmission.systemd b/extra/transmission/transmission.systemd
new file mode 100644
index 000000000..56ab8f794
--- /dev/null
+++ b/extra/transmission/transmission.systemd
@@ -0,0 +1,14 @@
+[Unit]
+Description=Transmission Bit Torrent Daemon
+
+# This assumes that a user 'transmission' exists, with a writeable homedirectory,
+# and that /run/transmission exists and is writeable by the transmission user.
+
+[Service]
+User=transmission
+Type=forking
+PIDFile=/run/transmission/transmission.pid
+ExecStart=/usr/bin/transmission-daemon --pid-file /run/transmission/transmission.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/extra/transmission/transmission.tmpfiles b/extra/transmission/transmission.tmpfiles
new file mode 100644
index 000000000..b603066c1
--- /dev/null
+++ b/extra/transmission/transmission.tmpfiles
@@ -0,0 +1 @@
+d /run/transmission - transmission transmission -
diff --git a/extra/transmission/transmissiond b/extra/transmission/transmissiond
index 1b4b4dc0e..ea3d770f9 100644
--- a/extra/transmission/transmissiond
+++ b/extra/transmission/transmissiond
@@ -8,7 +8,7 @@ PID=`pidof -o %PPID /usr/bin/transmission-daemon`
case "$1" in
start)
stat_busy "Starting Transmission Daemon"
- [ -z "$PID" ] && su -l -s /bin/sh -c "/usr/bin/transmission-daemon $TRANS_ARGS" $TRANS_USER
+ [ -z "$PID" ] && su -l -s /bin/sh -c "/usr/bin/transmission-daemon $TRANS_ARGS" "${TRANS_USER:-transmission}"
if [ $? -gt 0 ]; then
stat_fail
else
diff --git a/extra/transmission/transmissiond.conf b/extra/transmission/transmissiond.conf
index cf6c6f26e..45a9fd51d 100644
--- a/extra/transmission/transmissiond.conf
+++ b/extra/transmission/transmissiond.conf
@@ -1,5 +1,4 @@
# example configuration file
-# TRANSMISSION_HOME=/home/foo
-# TRANS_USER="foo"
-# TRANS_ARGS="-g $TRANSMISSION_HOME/.config/transmission-daemon"
+# TRANS_USER="transmission"
+# TRANS_ARGS=""