aboutsummaryrefslogtreecommitdiff
path: root/apks/firefly3/APKBUILD
blob: 81371c0eb3cafa11e85c6a4792eae252cb08700b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
pkgname=firefly3
pkgver=5.7.18
pkgrel=1
pkgdesc="A free and open source personal finance manager"
url="https://firefly-iii.org"
arch="noarch"
license="AGPL-3.0-only"
_php=php81
_php_mods="
    -curl
    -zip
    -sodium
    -gd
    -xml
    -mbstring
    -bcmath
    -fileinfo
    -session
    -tokenizer
    -xmlwriter
    -dom
    -shmop
"
depends="$_php ${_php_mods//-/$_php-}"
_php_makemods="
    -intl
    -pdo
    -simplexml
"
makedepends="$_php ${_php_makemods//-/$_php-} composer"
subpackages="
    $pkgname-mysql:_mysql
    $pkgname-psql:_psql
    $pkgname-sqlite:_sqlite
"
install="
    $pkgname.pre-install
    $pkgname.post-install
"
source="
    ${pkgname}-${pkgver}.tar.gz::https://github.com/firefly-iii/firefly-iii/archive/refs/tags/$pkgver.tar.gz
    $pkgname-env
"
options="!check" # no clue how to run test on this
builddir="$srcdir/firefly-iii-$pkgver/"

package() {
    local wwwdir="usr/share/webapps/$pkgname"
    local confdir="etc/$pkgname"
    local lib="var/lib/$pkgname"
    local log="var/log/$pkgname"

    mkdir -p "$pkgdir"
    mkdir -p "$pkgdir/$confdir"
    mkdir -p "$pkgdir/$lib"
    mkdir -p "$pkgdir/$log"

    cd "$pkgdir"

    mkdir -p ./${wwwdir%/*}
    mkdir -p ./"$lib"/upload
    mkdir -p ./"$lib"/database

    cp -a "$builddir" ./$wwwdir

    chmod +x ./$wwwdir/artisan

    cd ./$wwwdir
    composer install --prefer-dist --no-dev --no-scripts
    cd ..

    install -m 660  \
		"$srcdir"/$pkgname-env "$pkgdir"/$confdir/env

    ln -s /$confdir/env "$pkgdir"/$wwwdir/.env

    rm -r "$pkgdir"/$wwwdir/storage/database
    ln -s /"$lib"/database "$pkgdir"/$wwwdir/storage/

    rm -r "$pkgdir"/$wwwdir/storage/upload
    ln -s /"$lib"/upload "$pkgdir"/$wwwdir/storage/

    ln -s /"$lib"/oauth-private.key "$pkgdir"/$wwwdir/storage/oauth-private.key
    ln -s /"$lib"/oauth-public.key "$pkgdir"/$wwwdir/storage/oauth-public.key

    rm -r "$pkgdir"/$wwwdir/storage/logs
    ln -T -s /"$log"/ "$pkgdir"/$wwwdir/storage/logs
}

_mysql() {
    depends="firefly3 php81-pdo_mysql"
	pkgdesc="Mysql dependencies for $pkgname"
    mkdir -p "$subpkgdir"
}

_psql() {
    depends=" firefly3 php81-pdo_pgsql php81-pgsql"
    pkgdesc="Postgresql dependencies for $pkgname"
    mkdir -p "$subpkgdir"
}

_sqlite() {
    depends="firefly3 php81-pdo_sqlite"
    pkgdesc="Sqlite dependencies for $pkgname"
    mkdir -p "$subpkgdir"
}


sha512sums="
4febc482056d1c635fb674b001442dcaa6d331ce3906aeeac80497b42b38fa1e2393e6b2a0d76da884db15d000c4364d299a11e4d28b2b6ebdeba8fae638a413  firefly3-5.7.18.tar.gz
b778a4113b8d4d3465a5f80a72fe04497d68d718751e2b0ee43fdbd4379b6278bdff74c68e095668f03ef3a9969de41d734cb4f7e27fb26f1a4342f0c9e0f57e  firefly3-env
"