summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodoroki2022-06-19 08:36:39 +0200
committerTodoroki2022-06-19 08:36:39 +0200
commit75085b8c76b009d555010b6d8733b22ba7062fdd (patch)
treebd2e9c82983a3ab13a23b563f291a057ccadc06c
downloadaur-75085b8c76b009d555010b6d8733b22ba7062fdd.tar.gz
Initial release
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD70
-rw-r--r--audiobookshelf.conf.d7
-rw-r--r--audiobookshelf.hook11
-rwxr-xr-xaudiobookshelf.service17
-rw-r--r--audiobookshelf.sysusers2
-rw-r--r--audiobookshelf.tmpfiles2
7 files changed, 138 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7345aa7793ce
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = audiobookshelf-git
+ pkgdesc = Self-hosted audiobook server for managing and playing audiobooks
+ pkgver = v2.0.22.r0.g67f51c6
+ pkgrel = 1
+ url = https://github.com/advplyr/audiobookshelf
+ arch = any
+ license = GPL3
+ makedepends = nodejs
+ makedepends = npm
+ makedepends = git
+ depends = ffmpeg
+ provides = audiobookshelf
+ conflicts = audiobookshelf
+ options = !strip
+ backup = etc/conf.d/audiobookshelf
+ source = audiobookshelf-git::git+https://github.com/advplyr/audiobookshelf.git
+ source = audiobookshelf.conf.d
+ source = audiobookshelf.hook
+ source = audiobookshelf.service
+ source = audiobookshelf.sysusers
+ source = audiobookshelf.tmpfiles
+ md5sums = SKIP
+ md5sums = 5880b13a80fdc51b15604f0e5f30da09
+ md5sums = 749322fc2b48a839a79a638d879e77a4
+ md5sums = 52a8a90977335fdecf3ce6f8530830b1
+ md5sums = 63619dfc5bb5b2dbecfb1d6037095338
+ md5sums = 90e34ac4e5a79f71af3eaab8cebf1198
+
+pkgname = audiobookshelf-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..400f5a42c220
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,70 @@
+# Maintainer: Kevin S <aur@eldenring.mozmail.com>
+pkgname=audiobookshelf-git
+pkgver=v2.0.22.r0.g67f51c6
+pkgrel=1
+pkgdesc="Self-hosted audiobook server for managing and playing audiobooks"
+arch=('any')
+url="https://github.com/advplyr/audiobookshelf"
+license=('GPL3')
+depends=('ffmpeg')
+makedepends=('nodejs' 'npm' 'git')
+provides=("audiobookshelf")
+conflicts=("audiobookshelf")
+backup=('etc/conf.d/audiobookshelf')
+options=(!strip)
+
+source=(${pkgname}::git+"${url}".git
+ 'audiobookshelf.conf.d'
+ 'audiobookshelf.hook'
+ 'audiobookshelf.service'
+ 'audiobookshelf.sysusers'
+ 'audiobookshelf.tmpfiles')
+
+md5sums=('SKIP'
+ '5880b13a80fdc51b15604f0e5f30da09'
+ '749322fc2b48a839a79a638d879e77a4'
+ '52a8a90977335fdecf3ce6f8530830b1'
+ '63619dfc5bb5b2dbecfb1d6037095338'
+ '90e34ac4e5a79f71af3eaab8cebf1198')
+
+pkgver() {
+ cd "$pkgname"
+ git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "${srcdir}/${pkgname}"
+ # install build dependencies
+ npm install pkg
+}
+
+build() {
+ cd "${srcdir}/${pkgname}"
+ echo ">>> Building Client"
+ echo "--------------------"
+
+ cd client
+ rm -rf node_modules
+ npm ci --unsafe-perm=true --allow-root
+ npm run generate
+ cd ..
+
+ echo ">>> Building Server"
+ echo "--------------------"
+
+ rm -rf node_modules
+ npm ci --unsafe-perm=true --allow-root
+}
+
+package() {
+ cd "${srcdir}/${pkgname}"
+
+ install -d -m 755 "${pkgdir}/usr/share/audiobookshelf/"
+ pkg -t node16-linux -o "${pkgdir}/usr/share/audiobookshelf/audiobookshelf" .
+ install -D -m 644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -D -m 644 "${srcdir}/audiobookshelf.conf.d" "${pkgdir}/etc/conf.d/audiobookshelf"
+ install -D -m 644 "${srcdir}/audiobookshelf.service" "${pkgdir}/usr/lib/systemd/system/audiobookshelf.service"
+ install -D -m 644 "${srcdir}/audiobookshelf.sysusers" "${pkgdir}/usr/lib/sysusers.d/audiobookshelf.conf"
+ install -D -m 644 "${srcdir}/audiobookshelf.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/audiobookshelf.conf"
+ install -D -m 644 "${srcdir}/audiobookshelf.hook" "${pkgdir}/usr/share/doc/${pkgname}/audiobookshelf.hook"
+}
diff --git a/audiobookshelf.conf.d b/audiobookshelf.conf.d
new file mode 100644
index 000000000000..a677fc343689
--- /dev/null
+++ b/audiobookshelf.conf.d
@@ -0,0 +1,7 @@
+AUDIOBOOK_PATH=/usr/share/audiobookshelf/audiobooks
+METADATA_PATH=/usr/share/audiobookshelf/metadata
+CONFIG_PATH=/usr/share/audiobookshelf/config
+FFMPEG_PATH=/usr/bin/ffmpeg
+FFPROBE_PATH=/usr/bin/ffprobe
+PORT=7331
+HOST=0.0.0.0
diff --git a/audiobookshelf.hook b/audiobookshelf.hook
new file mode 100644
index 000000000000..f74d1e9421bf
--- /dev/null
+++ b/audiobookshelf.hook
@@ -0,0 +1,11 @@
+# Copy, move or symlink this file in /etc/pacman.d/hooks to force a restart when audiobookshelf is updated.
+
+[Trigger]
+Operation = Upgrade
+Type = Package
+Target = audiobookshelf-git
+
+[Action]
+Description = Restarting audiobookshelf...
+When = PostTransaction
+Exec = /usr/bin/systemctl try-restart audiobookshelf.service
diff --git a/audiobookshelf.service b/audiobookshelf.service
new file mode 100755
index 000000000000..0c3421cce0f8
--- /dev/null
+++ b/audiobookshelf.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Self-hosted audiobook server for managing and playing audiobooks
+Requires=network.target
+
+[Service]
+Type=simple
+EnvironmentFile=/etc/conf.d/audiobookshelf
+WorkingDirectory=/usr/share/audiobookshelf
+ExecStart=/usr/share/audiobookshelf/audiobookshelf
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=always
+User=audiobookshelf
+Group=audiobookshelf
+PermissionsStartOnly=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/audiobookshelf.sysusers b/audiobookshelf.sysusers
new file mode 100644
index 000000000000..ac9955920d28
--- /dev/null
+++ b/audiobookshelf.sysusers
@@ -0,0 +1,2 @@
+u audiobookshelf - - /usr/share/audiobookshelf
+g audiobookshelf -
diff --git a/audiobookshelf.tmpfiles b/audiobookshelf.tmpfiles
new file mode 100644
index 000000000000..f9f320459a09
--- /dev/null
+++ b/audiobookshelf.tmpfiles
@@ -0,0 +1,2 @@
+d /usr/share/audiobookshelf 0755 audiobookshelf audiobookshelf
+Z /usr/share/audiobookshelf - audiobookshelf audiobookshelf