apkbuilds @ 400ba1808f11f8e4814df6bdb17861d856efb107

 1# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
 2pkgname=firefly3
 3pkgver=5.7.13
 4pkgrel=0
 5pkgdesc="A free and open source personal finance manager"
 6url="https://firefly-iii.org"
 7arch="noarch"
 8license="AGPL-3.0-only"
 9_php=php8
10_php_mods="
11    -curl
12    -zip
13    -sodium
14    -gd
15    -xml
16    -mbstring
17    -bcmath
18    -fileinfo
19    -session
20    -tokenizer
21    -xmlwriter
22    -dom
23    -shmop
24"
25depends="$_php ${_php_mods//-/$_php-}"
26_php_makemods="
27    -intl
28    -pdo
29    -simplexml
30"
31makedepends="$_php ${_php_makemods//-/$_php-} composer"
32subpackages="
33    $pkgname-nginx:_nginx:noarch
34    $pkgname-mysql:_mysql
35    $pkgname-psql:_psql
36    $pkgname-sqlite:_sqlite
37"
38install="$pkgname.post-install"
39source="
40    ${pkgname}-${pkgver}.tar.gz::https://github.com/firefly-iii/firefly-iii/archive/refs/tags/$pkgver.tar.gz
41    firefly.nginx.conf
42"
43options="!check" # no clue how to run test on this
44builddir="$srcdir/firefly-iii-$pkgver/"
45
46package() {
47    local wwwdir="usr/share/webapps/$pkgname"
48
49    mkdir -p "$pkgdir"
50    cd "$pkgdir"
51
52    mkdir -p ./${wwwdir%/*}
53    cp -a "$builddir" ./$wwwdir
54
55    chmod +x ./$wwwdir/artisan
56
57    cd "$wwwdir" && composer install --prefer-dist --no-dev --no-scripts
58}
59
60_mysql() {
61    depends="firefly3 php8-pdo_mysql"
62	pkgdesc="Mysql dependencies for $pkgname"
63    mkdir -p "$subpkgdir"/usr
64}
65
66_psql() {
67    depends=" firefly3 php8-pdo_pgsql php8-pgsql"
68    pkgdesc="Postgresql dependencies for $pkgname"
69    mkdir -p "$subpkgdir"/usr
70}
71
72_sqlite() {
73    depends="firefly3 php8-pdo_sqlite"
74    pkgdesc="Sqlite dependencies for $pkgname"
75    mkdir -p "$subpkgdir"/usr
76}
77
78_nginx() {
79    depends="firefly3"
80    pkgdesc="nginx configuration for $pkgname"
81    install -Dm644 "$srcdir/firefly.nginx.conf" \
82        "$subpkgdir"/etc/nginx/http.d/firefly.conf
83}
84
85sha512sums="
86a59f89305eeb6cdb301ca86a6a3dfacd90497ce887b59b7c426bef341e7a070efc0d430c6e40277273e5aa56b86271c652f80e696cc53f0788b0624dd1b66a46  firefly3-5.7.13.tar.gz
879d32e8e8bd805b09cd429eacc42fe9e746570cdc867531ac47a0b31801378e5e0fc357ef88e8d5c14617ba1887a3789a9d2f7150111b497377380df7ccdd08a7  firefly.nginx.conf
88"