apkbuilds @ 7873a9933656121cc5c29661ec54f33fd614046f

 1# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
 2pkgname=genpass
 3pkgver=0.1.0
 4pkgrel=1
 5pkgdesc="Website password generator in wasm"
 6url="https://git.gabrielgio.me/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    $pkgname-$pkgver.tar.gz::https://git.gabrielgio.me/$pkgname/snapshot/$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="
65ea9780eaddb0f3ae5310df43032a342be3cd8ff6d4dfaf9a81d3aee770df34d23dbe5d0cbf1c436a3fd36daeee63637cecfc2588db3fbd3e822eacf9d9adab2e  genpass-0.1.0.tar.gz
666e6b9d80b26006efd5b6e368bd3925425b2080bf88dca38c91a9dd8a1db2b3774b2cb8ecba67ac01d2c822f0ad75106d6e103cc3371076f3f40232dd38b57fd4  genpass.nginx.conf
678fd85d8c482595021f2592aa76f096a6ef97b56f8b89a39d65f1ddf799fe091f7ebeca735c1d9dfc44c17cd0f8300799e6cc4afc649221354c2021ecacab15fe  genpass.caddyfile
68"