apkbuilds @ c1ed6480b53726b00654310af12ee61c59766af0

 1# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
 2pkgname=genpass
 3pkgver=0.1.0
 4pkgrel=0
 5pkgdesc="Website password generator in wasm"
 6url="https://git.sr.ht/~gabrielgio/genpass"
 7arch="all"
 8license="MIT"
 9depends=""
10makedepends="
11    curl
12    build-base
13    firefox
14    make
15    npm
16    cargo
17    openssl-dev
18    bzip2-dev
19"
20builddir="$srcdir/$pkgname-$pkgver/"
21subpackages="
22    $pkgname-nginx:_nginx
23    $pkgname-caddy:_caddy
24"
25
26source="
27    https://artifacts.gabrielgio.me/archive/$pkgname/$pkgname-$pkgver.tar.gz
28    $pkgname.nginx.conf
29    $pkgname.caddyfile
30"
31
32build() {
33    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal --quiet -y
34    source $HOME/.cargo/env
35    curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
36    make
37}
38
39check() {
40    make test
41}
42
43_nginx() {
44	depends="nginx"
45	pkgdesc="nginx configuration for $pkgname"
46	install -Dm644 "$srcdir"/"$package"/"$pkgname".nginx.conf \
47		"$subpkgdir"/etc/nginx/http.d/"$pkgname".nginx.conf
48}
49
50
51_caddy() {
52	depends="caddy genpass"
53	pkgdesc="caddy configuration for $pkgname"
54    mkdir -p "$subpkgdir"/etc/caddy/sites/
55	install -Dm644 "$srcdir"/"$package"/"$pkgname".caddyfile \
56		"$subpkgdir"/etc/caddy/sites/"$pkgname".caddyfile
57}
58
59package() {
60    mkdir -p "$pkgdir"/var/www
61    cp -dr public "$pkgdir"/var/www/"$pkgname"
62}
63
64sha512sums="
65b07c2eb4987d1e6bd369b8d329b15a770471e0ae18fe8bcbec45bcfc80f9658068dc47a3ab70028d6d47bb2d19729ca5e63bef2b8c9077f29fd8591ecbeaa3d0  genpass-0.1.0.tar.gz
666e6b9d80b26006efd5b6e368bd3925425b2080bf88dca38c91a9dd8a1db2b3774b2cb8ecba67ac01d2c822f0ad75106d6e103cc3371076f3f40232dd38b57fd4  genpass.nginx.conf
678fd85d8c482595021f2592aa76f096a6ef97b56f8b89a39d65f1ddf799fe091f7ebeca735c1d9dfc44c17cd0f8300799e6cc4afc649221354c2021ecacab15fe  genpass.caddyfile
68"