apkbuilds @ f8551c9e65a39cad3ce02beb7653f35a5dc3fbb5

  1# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
  2pkgname=firefly3
  3pkgver=5.7.13
  4pkgrel=4
  5pkgdesc="A free and open source personal finance manager"
  6url="https://firefly-iii.org"
  7arch="noarch"
  8license="AGPL-3.0-only"
  9_php=php81
 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
 45    $pkgname.nginx.conf
 46    $pkgname-env
 47"
 48options="!check" # no clue how to run test on this
 49builddir="$srcdir/firefly-iii-$pkgver/"
 50
 51package() {
 52    local wwwdir="usr/share/webapps/$pkgname"
 53    local confdir="etc/$pkgname"
 54
 55    install -d -m 770 -o www-data -g www-data "$pkgdir"/$confdir
 56
 57    mkdir -p "$pkgdir"
 58    cd "$pkgdir"
 59
 60    mkdir -p ./${wwwdir%/*}
 61    cp -a "$builddir" ./$wwwdir
 62
 63    chmod +x ./$wwwdir/artisan
 64
 65    cd ./$wwwdir
 66    composer install --prefer-dist --no-dev --no-scripts
 67    cd ..
 68
 69    install -m 755 -o www-data -g www-data -d "$wwwdir"
 70
 71    install -m 660 -o www-data -g www-data \
 72		"$srcdir"/$pkgname-env "$pkgdir"/$confdir/env
 73
 74    ln -s /$confdir/env "$pkgdir"/$wwwdir/.env
 75}
 76
 77_mysql() {
 78    depends="firefly3 php81-pdo_mysql"
 79	pkgdesc="Mysql dependencies for $pkgname"
 80    mkdir -p "$subpkgdir"
 81}
 82
 83_psql() {
 84    depends=" firefly3 php81-pdo_pgsql php81-pgsql"
 85    pkgdesc="Postgresql dependencies for $pkgname"
 86    mkdir -p "$subpkgdir"
 87}
 88
 89_sqlite() {
 90    depends="firefly3 php81-pdo_sqlite"
 91    pkgdesc="Sqlite dependencies for $pkgname"
 92    mkdir -p "$subpkgdir"
 93}
 94
 95_nginx() {
 96    depends="firefly3"
 97    pkgdesc="nginx configuration for $pkgname"
 98    install -Dm644 "$srcdir/$pkgname.nginx.conf" \
 99        "$subpkgdir"/etc/nginx/http.d/$pkgname.conf
100}
101
102sha512sums="
103a59f89305eeb6cdb301ca86a6a3dfacd90497ce887b59b7c426bef341e7a070efc0d430c6e40277273e5aa56b86271c652f80e696cc53f0788b0624dd1b66a46  firefly3-5.7.13.tar.gz
1049d32e8e8bd805b09cd429eacc42fe9e746570cdc867531ac47a0b31801378e5e0fc357ef88e8d5c14617ba1887a3789a9d2f7150111b497377380df7ccdd08a7  firefly3.nginx.conf
105b778a4113b8d4d3465a5f80a72fe04497d68d718751e2b0ee43fdbd4379b6278bdff74c68e095668f03ef3a9969de41d734cb4f7e27fb26f1a4342f0c9e0f57e  firefly3-env
106"