apkbuilds @ 400ba1808f11f8e4814df6bdb17861d856efb107

feat: Finish firefly APKBUILD

Add dependencies and subpackages' dependencies.
  1diff --git a/apks/firefly3/APKBUILD b/apks/firefly3/APKBUILD
  2index a1b4f5e90efeaa8452f11696cbcaa5ca7513df77..37721339986d463a3e363bdafcab996079816436 100644
  3--- a/apks/firefly3/APKBUILD
  4+++ b/apks/firefly3/APKBUILD
  5@@ -7,12 +7,39 @@ url="https://firefly-iii.org"
  6 arch="noarch"
  7 license="AGPL-3.0-only"
  8 _php=php8
  9-_php_mods="-curl -zip -sodium -gd -xml -mbstring -bcmath -fileinfo -session
 10-           -tokenizer -xmlwriter -dom -shmop"
 11+_php_mods="
 12+    -curl
 13+    -zip
 14+    -sodium
 15+    -gd
 16+    -xml
 17+    -mbstring
 18+    -bcmath
 19+    -fileinfo
 20+    -session
 21+    -tokenizer
 22+    -xmlwriter
 23+    -dom
 24+    -shmop
 25+"
 26 depends="$_php ${_php_mods//-/$_php-}"
 27-_php_makemods="-intl -pdo -simplexml"
 28+_php_makemods="
 29+    -intl
 30+    -pdo
 31+    -simplexml
 32+"
 33 makedepends="$_php ${_php_makemods//-/$_php-} composer"
 34-source="${pkgname}-${pkgver}.tar.gz::https://github.com/firefly-iii/firefly-iii/archive/refs/tags/$pkgver.tar.gz"
 35+subpackages="
 36+    $pkgname-nginx:_nginx:noarch
 37+    $pkgname-mysql:_mysql
 38+    $pkgname-psql:_psql
 39+    $pkgname-sqlite:_sqlite
 40+"
 41+install="$pkgname.post-install"
 42+source="
 43+    ${pkgname}-${pkgver}.tar.gz::https://github.com/firefly-iii/firefly-iii/archive/refs/tags/$pkgver.tar.gz
 44+    firefly.nginx.conf
 45+"
 46 options="!check" # no clue how to run test on this
 47 builddir="$srcdir/firefly-iii-$pkgver/"
 48 
 49@@ -20,16 +47,42 @@ package() {
 50     local wwwdir="usr/share/webapps/$pkgname"
 51 
 52     mkdir -p "$pkgdir"
 53-	cd "$pkgdir"
 54+    cd "$pkgdir"
 55 
 56-	mkdir -p ./${wwwdir%/*}
 57-	cp -a "$builddir" ./$wwwdir
 58+    mkdir -p ./${wwwdir%/*}
 59+    cp -a "$builddir" ./$wwwdir
 60 
 61     chmod +x ./$wwwdir/artisan
 62 
 63     cd "$wwwdir" && composer install --prefer-dist --no-dev --no-scripts
 64+}
 65 
 66+_mysql() {
 67+    depends="firefly3 php8-pdo_mysql"
 68+	pkgdesc="Mysql dependencies for $pkgname"
 69+    mkdir -p "$subpkgdir"/usr
 70 }
 71+
 72+_psql() {
 73+    depends=" firefly3 php8-pdo_pgsql php8-pgsql"
 74+    pkgdesc="Postgresql dependencies for $pkgname"
 75+    mkdir -p "$subpkgdir"/usr
 76+}
 77+
 78+_sqlite() {
 79+    depends="firefly3 php8-pdo_sqlite"
 80+    pkgdesc="Sqlite dependencies for $pkgname"
 81+    mkdir -p "$subpkgdir"/usr
 82+}
 83+
 84+_nginx() {
 85+    depends="firefly3"
 86+    pkgdesc="nginx configuration for $pkgname"
 87+    install -Dm644 "$srcdir/firefly.nginx.conf" \
 88+        "$subpkgdir"/etc/nginx/http.d/firefly.conf
 89+}
 90+
 91 sha512sums="
 92 a59f89305eeb6cdb301ca86a6a3dfacd90497ce887b59b7c426bef341e7a070efc0d430c6e40277273e5aa56b86271c652f80e696cc53f0788b0624dd1b66a46  firefly3-5.7.13.tar.gz
 93+9d32e8e8bd805b09cd429eacc42fe9e746570cdc867531ac47a0b31801378e5e0fc357ef88e8d5c14617ba1887a3789a9d2f7150111b497377380df7ccdd08a7  firefly.nginx.conf
 94 "
 95diff --git a/apks/firefly3/firefly.nginx.conf b/apks/firefly3/firefly.nginx.conf
 96new file mode 100644
 97index 0000000000000000000000000000000000000000..a95ebb13dabd1340da551fc4888e36fd07ae2a25
 98--- /dev/null
 99+++ b/apks/firefly3/firefly.nginx.conf
100@@ -0,0 +1,16 @@
101+server {
102+    listen 80;
103+    server_name firefly.lan;
104+    root /var/www/firefly3/public;
105+
106+    location ~ \.php$ {
107+        try_files $uri $uri/ =404;
108+        fastcgi_split_path_info ^(.+\.php)(/.+)$;
109+        fastcgi_pass unix:/run/php-fpm8/fpm.sock;
110+        include fastcgi.conf;
111+    }
112+
113+    location / {
114+      try_files $uri /index.php$is_args$args;
115+    }
116+}
117diff --git a/apks/firefly3/firefly3.post-install b/apks/firefly3/firefly3.post-install
118new file mode 100644
119index 0000000000000000000000000000000000000000..0c5d88acf46a09e2377d26ab37a856b9815959c2
120--- /dev/null
121+++ b/apks/firefly3/firefly3.post-install
122@@ -0,0 +1,6 @@
123+#!/bin/sh
124+
125+printf "  *\n  * Add the configration to '/var/www/firefly3/.env' \n"
126+printf "  * Without it firefly3 won't run.\n  *\n"
127+
128+exit 0