summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD17
-rw-r--r--peerflix-server.service2
-rw-r--r--peerflix.sysusers2
-rw-r--r--peerflix.tmpfiles3
5 files changed, 25 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 65fc4fc1290..37c7361b20e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -12,8 +12,12 @@ pkgbase = peerflix-server
options = !strip
source = peerflix-server.service
source = peerflix-server.sh
- md5sums = c16f83bd40fe9905b51c3ffd073bbcd0
+ source = peerflix.sysusers
+ source = peerflix.tmpfiles
+ md5sums = db2b8fff218d2154a4086fe95a82bacc
md5sums = ea9702820f92bef0636a4f01d13dd348
+ md5sums = baf787b4e3fea8c0ee16736a998cd776
+ md5sums = 3d88f37f81f89b39e071d7cd06fcf22a
pkgname = peerflix-server
diff --git a/PKGBUILD b/PKGBUILD
index 41818dbb0bb..02dc4d148b2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,6 +11,8 @@ depends=('nodejs')
makedepends=('npm')
source=($pkgname.service
$pkgname.sh
+ peerflix.sysusers
+ peerflix.tmpfiles
)
conflicts=('peerflix-server-git')
options=('!strip')
@@ -20,10 +22,19 @@ package(){
local _npmdir="$pkgdir/usr/lib/node_modules/"
mkdir -p $_npmdir
cd $_npmdir
- npm install -g --prefix "$pkgdir/usr" --ignore-scripts --production $pkgname@$pkgver
+ npm install -g --user root --prefix "$pkgdir/usr" --production $pkgname@$pkgver
install -Dm644 "${srcdir}/$pkgname.service" "${pkgdir}/usr/lib/systemd/system/$pkgname.service"
+ install -D -m644 "${srcdir}/peerflix.sysusers" "${pkgdir}/usr/lib/sysusers.d/peerflix.conf"
+ install -D -m644 "${srcdir}/peerflix.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/peerflix.conf"
+ find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
+
install -Dm775 "${srcdir}/peerflix-server.sh" "${pkgdir}/usr/bin/peerflix-server"
+ pathtoreplace=`echo $pkgdir | sed 's:/:\\\/:g'`
+ find $pkgdir -type f -name "*.json" -exec sed -i "s/$pathtoreplace//g" {} +;
}
-md5sums=('c16f83bd40fe9905b51c3ffd073bbcd0'
- 'ea9702820f92bef0636a4f01d13dd348')
+
+md5sums=('db2b8fff218d2154a4086fe95a82bacc'
+ 'ea9702820f92bef0636a4f01d13dd348'
+ 'baf787b4e3fea8c0ee16736a998cd776'
+ '3d88f37f81f89b39e071d7cd06fcf22a')
diff --git a/peerflix-server.service b/peerflix-server.service
index b3d33e01778..79853ac80ad 100644
--- a/peerflix-server.service
+++ b/peerflix-server.service
@@ -3,7 +3,7 @@ Description=Peerflix Server
[Service]
Type=forking
-User=root
+User=peerflix
ExecStart=/usr/bin/peerflix-server
[Install]
diff --git a/peerflix.sysusers b/peerflix.sysusers
new file mode 100644
index 00000000000..fe845659c3d
--- /dev/null
+++ b/peerflix.sysusers
@@ -0,0 +1,2 @@
+u peerflix - "Peerflix Server" /var/lib/peerflix /bin/bash
+
diff --git a/peerflix.tmpfiles b/peerflix.tmpfiles
new file mode 100644
index 00000000000..39a7d5bb5da
--- /dev/null
+++ b/peerflix.tmpfiles
@@ -0,0 +1,3 @@
+Z /usr/lib/node_modules/peerflix-server 0755 peerflix peerflix
+d /var/lib/peerflix 0777 peerflix peerflix
+