From 297a042ac9a7bbd2b18a9551f5fa4fe43faf53b2 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 22 Aug 2012 00:02:51 +0000 Subject: Wed Aug 22 00:02:51 UTC 2012 --- extra/transmission/PKGBUILD | 18 ++++++++++++------ extra/transmission/transmission-cli.install | 9 ++++++++- extra/transmission/transmission.systemd | 14 ++++++++++++++ extra/transmission/transmission.tmpfiles | 1 + extra/transmission/transmissiond | 2 +- extra/transmission/transmissiond.conf | 5 ++--- 6 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 extra/transmission/transmission.systemd create mode 100644 extra/transmission/transmission.tmpfiles (limited to 'extra/transmission') 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 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="" -- cgit v1.2.3-54-g00ecf