diff --git a/midr/APKBUILD b/midr/APKBUILD
index a9b1b94bb4a8b6f0784f636ac0a18e641b44800c..0377d1175772e2bc690d49b3c6945d9b55af4a1a 100644
--- a/midr/APKBUILD
+++ b/midr/APKBUILD
@@ -1,6 +1,6 @@
# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
pkgname=midr
-pkgver=0.1.0
+pkgver=0.1.1
pkgrel=0
pkgdesc="yt-dlp simple frontend"
url="https://git.sr.ht/~gabrielgio/midr"
@@ -10,7 +10,7 @@ makedepends="
go
"
builddir="$srcdir/$pkgname-v$pkgver/"
-install="$pkgname.pre-install $pkgname.post-install"
+install="$pkgname.pre-install"
subpackages="$pkgname-openrc"
source="
${pkgname}-${pkgver}.tar.gz::https://artifacts.gabrielgio.me/${pkgname}/${pkgname}-v${pkgver}.tar.gz
@@ -27,14 +27,12 @@ -ldflags="-X 'main.Version=${pkgver}'" \
.
}
-check() {
- # Replace with proper check command(s)
- :
-}
-
package() {
- install -Dm755 "$pkgname" "$pkgdir"/usr/bin/"$pkgname"
+ install -Dm755 "$pkgname" "$pkgdir"/usr/lib/"$pkgname"/"$pkgname"
+
+ mkdir -p "$pkgdir"/usr/bin
+ ln -s /usr/lib/"$pkgname"/"$pkgname" "$pkgdir"/usr/bin/"$pkgname"
install -m755 -D "$srcdir"/$pkgname.initd \
"$pkgdir"/etc/init.d/$pkgname
@@ -43,7 +41,7 @@ "$pkgdir"/etc/conf.d/$pkgname
}
sha512sums="
-4b170b6466bdc4da60cf6582ab43ffb55ea09ccef58490453377d07fe38996c0d1a4408c5c68d2f3ab75f607afce443fb86ae5d6c04f7a9be844bf870064c075 midr-0.1.0.tar.gz
-512331fd6b4c5621c14b8bf07a94b2318dc33fea245de1e66d6385e1dc4cbfde7cb0d53507b46c85a11defe65a936cca40ace80df76130c7af2ef5999899892c midr.initd
-f11f0d192cd7823307c2ce4ddc7b3fff5190f72d3f65a5524b487021a95a222aca1fd36ab1eb58ed533e7acd555bfb70f0c8a13db20338ea31527f3151fd2bd7 midr.confd
+a114bfe718d95ad5157aa55870b6bceb61dfcea7e0cb5d76b2ecd3b29a266d1c1e8c1204a4020da798a8bd24210b3eccdf1779311b524897458be511652692ba midr-0.1.1.tar.gz
+28927837fb4183509054830bf93342c09123b8589ad1d66272c9e3decef3f83e1cb2d1f30a0a8147edf5628b8834447f87aa7001f76a71e826f16836f72a3436 midr.initd
+6329a88c5d88fdc1f8c2b3f009d988dc03d6a3c2bb7e2e9eebaf0002625d74a13c824fd90ff67dcb9cba2fb15008b92e68d57d6f3a5a2c5331d13d5f5b11ff72 midr.confd
"
diff --git a/midr/midr.confd b/midr/midr.confd
index 486252b03c72da72c88db661d71c4d36f5b9e16d..50d6ea354e7ef84f2e6d4e58416309e809d4e2d2 100644
--- a/midr/midr.confd
+++ b/midr/midr.confd
@@ -1,7 +1,2 @@
-# Sample conf.d file for alpine linux
-
-#
-# Specify daemon options here.
-#
-
-sample_opts=""
+datadir="/var/lib/jellyfin"
+opts="-p"
diff --git a/midr/midr.initd b/midr/midr.initd
index 0dc706ce27dbcf80bf504fd41a03973cf6fd6eb5..7640168335240358f011c053e37c958f88d873a0 100644
--- a/midr/midr.initd
+++ b/midr/midr.initd
@@ -2,9 +2,10 @@ #!/sbin/openrc-run
# Sample init.d file for alpine linux.
-name=
-command="/usr/sbin/$name"
-command_args="$sample_opts"
+name="midr"
+command="/usr/bin/$name"
+command_user=www-data:www-data
+command_args="-d ${datadir} ${opts}"
command_background="yes"
start_stop_daemon_args="--user $sample_user:$sample_group"
@@ -14,3 +15,7 @@ depend() {
need net
after firewall
}
+
+start_pre() {
+ checkpath -d -o $command_user "$datadir"
+}
diff --git a/midr/midr.post-install b/midr/midr.post-install
deleted file mode 100644
index 512fd3e839c3d2b644aeff2a0cb61db5d55ea560..0000000000000000000000000000000000000000
--- a/midr/midr.post-install
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# add something which happens after install
-
diff --git a/midr/midr.pre-install b/midr/midr.pre-install
index 20f04f77aa4ed2596eae0fe7a09cf3c095f72e16..74f1b591e16d12b52c7f15812c77334cfe0f3151 100644
--- a/midr/midr.pre-install
+++ b/midr/midr.pre-install
@@ -1,4 +1,9 @@
#!/bin/sh
-# add something which happens before install
+user=www-data
+group=www-data
+
+addgroup -S $group 2>/dev/null
+adduser -S -D -h /var/lib/$user -s /sbin/nologin -G $group -g $user $user 2>/dev/null
+exit 0