diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2022-10-14 21:30:02 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2022-10-14 21:30:02 +0200 |
commit | 1fe2776b26d6fe83e7bcd662386e6448754c7ca9 (patch) | |
tree | edfa8246a5d8631bd2139deae748caf54998af13 /apks/midr | |
parent | 307af8fd5a3e74ebcb64ac5bbe57493b59ead233 (diff) | |
download | apkbuilds-1fe2776b26d6fe83e7bcd662386e6448754c7ca9.tar.gz apkbuilds-1fe2776b26d6fe83e7bcd662386e6448754c7ca9.tar.bz2 apkbuilds-1fe2776b26d6fe83e7bcd662386e6448754c7ca9.zip |
feat: fix remote pathing
Diffstat (limited to 'apks/midr')
-rw-r--r-- | apks/midr/APKBUILD | 51 | ||||
-rw-r--r-- | apks/midr/midr.confd | 2 | ||||
-rw-r--r-- | apks/midr/midr.initd | 21 | ||||
-rw-r--r-- | apks/midr/midr.pre-install | 9 |
4 files changed, 83 insertions, 0 deletions
diff --git a/apks/midr/APKBUILD b/apks/midr/APKBUILD new file mode 100644 index 0000000..b985257 --- /dev/null +++ b/apks/midr/APKBUILD @@ -0,0 +1,51 @@ +# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me> +pkgname=midr +pkgver=0.1.1 +pkgrel=3 +pkgdesc="yt-dlp simple frontend" +url="https://git.sr.ht/~gabrielgio/midr" +arch="x86_64" +license="MIT" +depends=" + yt-dlp + ffmpeg +" +makedepends=" + go +" +builddir="$srcdir/$pkgname-v$pkgver/" +install="$pkgname.pre-install" +subpackages="$pkgname-openrc" +source=" + ${pkgname}-${pkgver}.tar.gz::https://artifacts.gabrielgio.me/${pkgname}/${pkgname}-v${pkgver}.tar.gz + midr.initd + midr.confd +" + +build() { + go mod vendor + go build \ + -trimpath \ + -mod=vendor \ + -ldflags="-X 'main.Version=${pkgver}'" \ + . +} + +package() { + + 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 + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname +} + +sha512sums=" +a114bfe718d95ad5157aa55870b6bceb61dfcea7e0cb5d76b2ecd3b29a266d1c1e8c1204a4020da798a8bd24210b3eccdf1779311b524897458be511652692ba midr-0.1.1.tar.gz +b540b2a8210ef525226ca798f39866bebcd60e2c17296e4d256dc6e8e887f37f493835c4e9f25c5ef7e6cee3e903f91afdbf2abf8bcb903c1a485c89b1e85411 midr.initd +eaa355698e89b978c2158360802fa7ced7ead961187a0145af862fac09704b73d4e22e906a280c87e2280d2567dde0644382c5b226cb18d4165750a0a029d79f midr.confd +" diff --git a/apks/midr/midr.confd b/apks/midr/midr.confd new file mode 100644 index 0000000..79693ed --- /dev/null +++ b/apks/midr/midr.confd @@ -0,0 +1,2 @@ +datadir="/var/lib/midr" +opts="-p" diff --git a/apks/midr/midr.initd b/apks/midr/midr.initd new file mode 100644 index 0000000..20a069f --- /dev/null +++ b/apks/midr/midr.initd @@ -0,0 +1,21 @@ +#!/sbin/openrc-run + +# Sample init.d file for alpine linux. + +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 www-data:www-data" +pidfile="/run/$name.pid" + +depend() { + need net + after firewall +} + +start_pre() { + checkpath -d -o $command_user "$datadir" +} diff --git a/apks/midr/midr.pre-install b/apks/midr/midr.pre-install new file mode 100644 index 0000000..74f1b59 --- /dev/null +++ b/apks/midr/midr.pre-install @@ -0,0 +1,9 @@ +#!/bin/sh + +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 |