summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Ruijl2016-05-05 11:41:02 +0200
committerBen Ruijl2016-05-05 11:41:02 +0200
commit3f2e4c483a84333e5eb56941e774410a26febfe3 (patch)
treeb74d82960348e8ab0b1a5eb9be3b5c9f4dfec8e1
parentf7c0ddce362e1ffbddedb3be9376e2b813872f78 (diff)
downloadaur-3f2e4c483a84333e5eb56941e774410a26febfe3.tar.gz
Several fixes
- env python is replaced by env python2 - No more forking for systemd process - Added provides and conflicts
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD9
-rw-r--r--couchpotato.install4
-rw-r--r--couchpotato.service6
4 files changed, 16 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9ee3aec50373..69089b56b467 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = couchpotato-git
pkgdesc = Automatic Movie Downloading via NZBs & Torrent
- pkgver = 2054.fc8db13
+ pkgver = 4869.c4fad95
pkgrel = 1
url = http://couchpota.to/
install = couchpotato.install
@@ -8,10 +8,12 @@ pkgbase = couchpotato-git
license = GPL3
makedepends = git
depends = python2
+ provides = couchpotato
+ conflicts = couchpotato
source = git://github.com/RuudBurger/CouchPotatoServer.git
source = couchpotato.service
md5sums = SKIP
- md5sums = 82813cd00a17dd78f10756d71c7eb848
+ md5sums = af02374e700522e56cb9bc606bf31731
pkgname = couchpotato-git
diff --git a/PKGBUILD b/PKGBUILD
index 15ed5e03ea95..dc9979c85043 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=couchpotato-git
_gitname=CouchPotatoServer
-pkgver=2054.fc8db13
+pkgver=4869.c4fad95
pkgrel=1
pkgdesc="Automatic Movie Downloading via NZBs & Torrent"
arch=('any')
@@ -10,9 +10,11 @@ url="http://couchpota.to/"
license=('GPL3')
depends=('python2')
makedepends=('git')
+provides=('couchpotato')
+conflicts=('couchpotato')
install='couchpotato.install'
source=('git://github.com/RuudBurger/CouchPotatoServer.git' 'couchpotato.service')
-md5sums=('SKIP' '82813cd00a17dd78f10756d71c7eb848')
+md5sums=('SKIP' 'af02374e700522e56cb9bc606bf31731')
pkgver() {
cd $_gitname
@@ -23,5 +25,8 @@ package() {
mkdir -p "${pkgdir}/opt/"
cp -r "$srcdir/$_gitname" "${pkgdir}/opt/couchpotato"
+ # Fix for issues with Python 3
+ find "${pkgdir}/opt/couchpotato" -type f -exec sed -i 's/env python/env python2/g' {} \;
+
install -Dm644 "${srcdir}/couchpotato.service" "${pkgdir}/usr/lib/systemd/system/couchpotato.service"
}
diff --git a/couchpotato.install b/couchpotato.install
index 34c1b3c5b073..0f41eab118aa 100644
--- a/couchpotato.install
+++ b/couchpotato.install
@@ -4,8 +4,8 @@ CP_DIR="/opt/couchpotato"
## arg 1: the new package version
post_install() {
- groupadd ${CP_GROUP} &> /dev/null
- useradd -g ${CP_GROUP} -d ${CP_DIR} -s /bin/false ${CP_USER} &> /dev/null
+ getent group ${CP_GROUP} &> /dev/null || groupadd -r ${CP_GROUP} &> /dev/null
+ getent passwd ${CP_USER} &> /dev/null || useradd -r -g ${CP_GROUP} -d ${CP_DIR} -s /usr/bin/nologin ${CP_USER} &> /dev/null
chown -R ${CP_USER}:${CP_GROUP} ${CP_DIR}
echo " >> If you want a custom user or path for CouchPotato, remember to edit the service file as well."
}
diff --git a/couchpotato.service b/couchpotato.service
index 322d16299f46..18eb14f758ca 100644
--- a/couchpotato.service
+++ b/couchpotato.service
@@ -1,10 +1,10 @@
[Unit]
Description=An automatic NZB and torrent movie downloader
+After=network.target
[Service]
-ExecStart=/usr/bin/python2 /opt/couchpotato/CouchPotato.py --config_file /opt/couchpotato/config.ini --data_dir /opt/couchpotato/data --daemon --quiet
-GuessMainPID=no
-Type=forking
+ExecStart=/usr/bin/python2 /opt/couchpotato/CouchPotato.py --config_file /opt/couchpotato/config.ini --data_dir /opt/couchpotato/data --quiet
+Type=simple
User=couchpotato
Group=couchpotato