apkbuilds @ bb43ffe016b1d6df34f5b77bb04c27a89b537ef4

 1# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
 2pkgname=midr
 3pkgver=0.1.1
 4pkgrel=3
 5pkgdesc="yt-dlp simple frontend"
 6url="https://git.sr.ht/~gabrielgio/midr"
 7arch="x86_64"
 8license="MIT"
 9depends="
10    yt-dlp
11    ffmpeg
12"
13makedepends="
14    go
15"
16builddir="$srcdir/$pkgname-v$pkgver/"
17install="$pkgname.pre-install"
18subpackages="$pkgname-openrc"
19source="
20    ${pkgname}-${pkgver}.tar.gz::https://artifacts.gabrielgio.me/archive/${pkgname}/${pkgname}-v${pkgver}.tar.gz
21	midr.initd
22	midr.confd
23"
24
25build() {
26    go mod vendor
27    go build \
28        -trimpath \
29        -mod=vendor \
30        -ldflags="-X 'main.Version=${pkgver}'" \
31        .
32}
33
34package() {
35	install -Dm755 "$pkgname" "$pkgdir"/usr/lib/"$pkgname"/"$pkgname"
36
37    mkdir -p "$pkgdir"/usr/bin
38    ln -s /usr/lib/"$pkgname"/"$pkgname" "$pkgdir"/usr/bin/"$pkgname"
39
40    install -m755 -D "$srcdir"/$pkgname.initd \
41        "$pkgdir"/etc/init.d/$pkgname
42    install -m644 -D "$srcdir"/$pkgname.confd \
43         "$pkgdir"/etc/conf.d/$pkgname
44}
45
46sha512sums="
4787ac5501af123b9250c0ca8a7cea60a7c0e62a3dc2e38863118649562a106e6d849872f8a7f2c03014458f99981bc6325f54cb6761d9ec23f9d78451c7c6dc62  midr-0.1.1.tar.gz
48b540b2a8210ef525226ca798f39866bebcd60e2c17296e4d256dc6e8e887f37f493835c4e9f25c5ef7e6cee3e903f91afdbf2abf8bcb903c1a485c89b1e85411  midr.initd
49eaa355698e89b978c2158360802fa7ced7ead961187a0145af862fac09704b73d4e22e906a280c87e2280d2567dde0644382c5b226cb18d4165750a0a029d79f  midr.confd
50"