apkbuilds @ fcb5f697f924ab7c3664e5a6cd9cc62189e46c87

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