summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlphaJack2021-10-14 00:52:04 +0200
committerAlphaJack2021-10-14 00:52:16 +0200
commit55563d611ff0616db8612ce609d6cee8f6343f9c (patch)
treec37da4e856a36781a92ef437bfd94a8d4c934e7f
parent75f683a12e830f5ae7df6a6650fbea991f21d82d (diff)
downloadaur-55563d611ff0616db8612ce609d6cee8f6343f9c.tar.gz
Adopted package and updated mStream to 5.7.2
-rw-r--r--.SRCINFO28
-rw-r--r--PKGBUILD81
-rw-r--r--config.json13
-rw-r--r--mstream.install20
-rw-r--r--mstream.json1
-rw-r--r--mstream.service5
-rw-r--r--mstream.sysusers1
-rw-r--r--mstream.tmpfiles4
8 files changed, 80 insertions, 73 deletions
diff --git a/.SRCINFO b/.SRCINFO
index adc2313188bd..584e8a12d8a5 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,27 @@
pkgbase = mstream
pkgdesc = Music player server with a web-based interface
- pkgver = 4.6.1
+ pkgver = 5.7.2
pkgrel = 1
- url = http://mstream.io
- install = mstream.install
+ url = https://mstream.io
arch = any
license = GPL3
makedepends = npm
depends = nodejs
- noextract = mstream-4.6.1.tgz
- backup = var/lib/mstream/config.json
- source = https://registry.npmjs.org/mstream/-/mstream-4.6.1.tgz
+ provides = mstream
+ conflicts = nodejs-mstream
+ conflicts = mstream-git
+ replaces = mstream-git
+ options = !strip
+ backup = etc/mstream.json
+ source = https://github.com/IrosTheBeggar/mStream/archive/refs/tags/v5.7.2.tar.gz
+ source = mstream.json
source = mstream.service
- source = config.json
- md5sums = f8d978ade28d77a280e1c8112aa034f8
- md5sums = 6640e102dd29a6da5c4c075e4c4042d7
- md5sums = a38cbd06e4077f83926e1c06f380ae83
+ source = mstream.sysusers
+ source = mstream.tmpfiles
+ sha256sums = 960d1cafaf5b3f89380f414728f95252bf38b067fbe7e8ce841eeaebd44014ce
+ sha256sums = 1d6faa9e1a76d13f3ab8558a3640158b1f0a54f624a4e37ddc3ef41ed4191058
+ sha256sums = 833f86daaffb12857612ef5b1264e944b0a48a077d5a8bb8d217ec6565ed90c3
+ sha256sums = 5f2e6aced1707f64ca4ae3ae647fb6a8420f5c2a747ba06fa9174920fd821437
+ sha256sums = 3664207c5b2782d55acc77a6ff1ced5c80447047c4c036837983dc03e19896de
pkgname = mstream
-
diff --git a/PKGBUILD b/PKGBUILD
index 58b330fbf92d..92e38590ce62 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,30 +1,59 @@
-# Maintainer: Espen Fossen <espfos@junta.no>
+# Maintainer: AlphaJack <alphajack at tuta dot io>
-pkgname=mstream
-pkgver=4.6.1
+pkgname="mstream"
+pkgver=5.7.2
pkgrel=1
-pkgdesc='Music player server with a web-based interface'
-arch=('any')
-url="http://mstream.io"
-license=('GPL3')
-depends=('nodejs')
-makedepends=('npm')
-install=mstream.install
-backup=('var/lib/mstream/config.json')
-source=(https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz
- mstream.service
- config.json)
-noextract=($pkgname-$pkgver.tgz)
+pkgdesc="Music player server with a web-based interface"
+url="https://mstream.io"
+license=("GPL3")
+arch=("any")
+provides=("mstream")
+conflicts=("nodejs-mstream" "mstream-git")
+replaces=("mstream-git")
+depends=("nodejs")
+makedepends=("npm")
+source=("https://github.com/IrosTheBeggar/mStream/archive/refs/tags/v$pkgver.tar.gz"
+ "mstream.json"
+ "mstream.service"
+ "mstream.sysusers"
+ "mstream.tmpfiles")
+sha256sums=('960d1cafaf5b3f89380f414728f95252bf38b067fbe7e8ce841eeaebd44014ce'
+ '1d6faa9e1a76d13f3ab8558a3640158b1f0a54f624a4e37ddc3ef41ed4191058'
+ '833f86daaffb12857612ef5b1264e944b0a48a077d5a8bb8d217ec6565ed90c3'
+ '5f2e6aced1707f64ca4ae3ae647fb6a8420f5c2a747ba06fa9174920fd821437'
+ '3664207c5b2782d55acc77a6ff1ced5c80447047c4c036837983dc03e19896de')
+backup=("etc/mstream.json")
+options=("!strip")
-package() {
- npm install -g --user root --prefix "$pkgdir"/usr $pkgname-$pkgver.tgz
- install -d -g 49 -o 49 "${pkgdir}/var/log/${pkgname}"
- install -d -g 49 -o 49 "${pkgdir}/var/lib/${pkgname}"
- install -d -g 49 -o 49 "${pkgdir}/var/lib/${pkgname}/media"
- install -d -g 49 -o 49 "${pkgdir}/var/lib/${pkgname}/album-art"
- install -Dm644 mstream.service "$pkgdir"/usr/lib/systemd/system/mstream.service
- install -Dm644 -g 49 -o 49 config.json "${pkgdir}/var/lib/${pkgname}/config.json"
+package(){
+ # archiving the folder because `npm install` doesn't move the files to $pkgdir
+ tar czf "mStream.tar.gz" -C "mStream-$pkgver" .
+ npm install -g --user root --prefix "$pkgdir/usr" "mStream.tar.gz"
+
+ install -d -m 750 "$pkgdir/var/cache/mstream"
+ install -d -m 750 "$pkgdir/var/lib/mstream"
+ install -d "$pkgdir/var/lib/mstream/album-art"
+ install -d "$pkgdir/var/lib/mstream/db"
+ install -d "$pkgdir/var/lib/mstream/media"
+ install -d "$pkgdir/var/lib/mstream/sync"
+ install -d "$pkgdir/var/log/mstream"
+
+ install -D -m 600 "$srcdir/mstream.json" "$pkgdir/etc/mstream.json"
+ install -D -m 644 "$srcdir/mstream.service" "$pkgdir/usr/lib/systemd/system/mstream.service"
+ install -D -m 644 "$srcdir/mstream.sysusers" "$pkgdir/usr/lib/sysusers.d/mstream.conf"
+ install -D -m 644 "$srcdir/mstream.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/mstream.conf"
+
+ rm -r "$pkgdir/usr/lib/node_modules/mstream/.github" \
+ "$pkgdir/usr/lib/node_modules/mstream/.npmignore" \
+ "$pkgdir/usr/lib/node_modules/mstream/bin" \
+ "$pkgdir/usr/lib/node_modules/mstream/image-cache/" \
+ "$pkgdir/usr/lib/node_modules/mstream/save/db" \
+ "$pkgdir/usr/lib/node_modules/mstream/save/sync" \
+ "$pkgdir/usr/lib/node_modules/mstream/save/logs"
+
+ chown -R root: "$pkgdir/usr"
+ ln -s "/var/cache/mstream" "$pkgdir/usr/lib/node_modules/mstream/image-cache"
+ ln -s "/var/lib/mstream/db" "$pkgdir/usr/lib/node_modules/mstream/save/db"
+ ln -s "/var/lib/mstream/sync" "$pkgdir/usr/lib/node_modules/mstream/save/sync"
+ ln -s "/var/log/mstream" "$pkgdir/usr/lib/node_modules/mstream/save/logs"
}
-md5sums=('f8d978ade28d77a280e1c8112aa034f8'
- '6640e102dd29a6da5c4c075e4c4042d7'
- 'a38cbd06e4077f83926e1c06f380ae83')
diff --git a/config.json b/config.json
deleted file mode 100644
index 35853ce00499..000000000000
--- a/config.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "port": 3030,
- "noUpload": "true",
- "writeLogs": "true",
- "storage": {
- "albumArtDirectory":"/var/lib/mstream/album-art",
- "dbDirectory":"/var/lib/mstream/",
- "logsDirectory": "/var/log/mstream/"
- },
- "folders": {
- "media": { "root": "/var/lib/mstream/media"}
- }
-}
diff --git a/mstream.install b/mstream.install
deleted file mode 100644
index b0358df0af3b..000000000000
--- a/mstream.install
+++ /dev/null
@@ -1,20 +0,0 @@
-post_install() {
- getent group mstream &>/dev/null || groupadd -r -g 49 mstream >/dev/null
- getent passwd mstream &>/dev/null || useradd -r -u 49 -g mstream -d /var/lib/mstream -s /bin/false -G audio mstream >/dev/null
- usr/bin/systemd-tmpfiles --create mstream.conf || true
- # fixup permissions
- chmod 755 /usr/lib/node_modules \
- /usr/lib/node_modules/mstream/node_modules \
- /usr/lib/node_modules/mstream/node_modules/.bin
-}
-
-post_remove() {
- getent passwd mstream &>/dev/null && userdel mstream >/dev/null
- getent group mstream &>/dev/null && groupdel mstream >/dev/null
- true
-}
-
-post_upgrade() {
- post_install
-}
-
diff --git a/mstream.json b/mstream.json
new file mode 100644
index 000000000000..ffcd4415b08f
--- /dev/null
+++ b/mstream.json
@@ -0,0 +1 @@
+{ }
diff --git a/mstream.service b/mstream.service
index 732f04ef955d..de44ad2d597e 100644
--- a/mstream.service
+++ b/mstream.service
@@ -1,13 +1,12 @@
[Unit]
-Description=mstream
+Description=mStream
After=network.target
[Service]
User=mstream
Type=simple
WorkingDirectory=/var/lib/mstream
-ExecStart=/usr/bin/mstream -j /var/lib/mstream/config.json
+ExecStart=/usr/bin/mstream -j /etc/mstream.json
[Install]
WantedBy=multi-user.target
-
diff --git a/mstream.sysusers b/mstream.sysusers
new file mode 100644
index 000000000000..89a733947881
--- /dev/null
+++ b/mstream.sysusers
@@ -0,0 +1 @@
+u mstream - "mStream daemon user" /var/lib/mstream
diff --git a/mstream.tmpfiles b/mstream.tmpfiles
new file mode 100644
index 000000000000..bf878ce32e42
--- /dev/null
+++ b/mstream.tmpfiles
@@ -0,0 +1,4 @@
+f /etc/mstream.json 0600 mstream mstream
+d /var/cache/mstream 0750 mstream mstream
+d /var/lib/mstream 0750 mstream mstream
+d /var/log/mstream 0750 mstream mstream