apkbuilds @ b13ca1652f870af62f05fbb7d455aab1898eab0a

 1# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
 2pkgname=firefly3
 3pkgver=5.7.13
 4pkgrel=2
 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="
39    $pkgname.pre-install
40    $pkgname.post-install
41"
42source="
43    ${pkgname}-${pkgver}.tar.gz::https://github.com/firefly-iii/firefly-iii/archive/refs/tags/$pkgver.tar.gz
44    firefly.nginx.conf
45"
46options="!check" # no clue how to run test on this
47builddir="$srcdir/firefly-iii-$pkgver/"
48
49package() {
50    local wwwdir="var/www/$pkgname"
51
52    mkdir -p "$pkgdir"
53    cd "$pkgdir"
54
55    mkdir -p ./${wwwdir%/*}
56    cp -a "$builddir" ./$wwwdir
57
58    chmod +x ./$wwwdir/artisan
59
60    cd ./$wwwdir
61    composer install --prefer-dist --no-dev --no-scripts
62    cd ..
63
64    install -m 755 -o www-data -g www-data -d "$wwwdir"
65}
66
67_mysql() {
68    depends="firefly3 php8-pdo_mysql"
69	pkgdesc="Mysql dependencies for $pkgname"
70    mkdir -p "$subpkgdir"
71}
72
73_psql() {
74    depends=" firefly3 php8-pdo_pgsql php8-pgsql"
75    pkgdesc="Postgresql dependencies for $pkgname"
76    mkdir -p "$subpkgdir"
77}
78
79_sqlite() {
80    depends="firefly3 php8-pdo_sqlite"
81    pkgdesc="Sqlite dependencies for $pkgname"
82    mkdir -p "$subpkgdir"
83}
84
85_nginx() {
86    depends="firefly3"
87    pkgdesc="nginx configuration for $pkgname"
88    install -Dm644 "$srcdir/firefly.nginx.conf" \
89        "$subpkgdir"/etc/nginx/http.d/firefly.conf
90}
91
92sha512sums="
93a59f89305eeb6cdb301ca86a6a3dfacd90497ce887b59b7c426bef341e7a070efc0d430c6e40277273e5aa56b86271c652f80e696cc53f0788b0624dd1b66a46  firefly3-5.7.13.tar.gz
949d32e8e8bd805b09cd429eacc42fe9e746570cdc867531ac47a0b31801378e5e0fc357ef88e8d5c14617ba1887a3789a9d2f7150111b497377380df7ccdd08a7  firefly.nginx.conf
95"