apkbuilds @ e89c3ae528d667a63b9716653f9f926bf416f2ee

 1# Maintainer: Gabriel Giovanini <mail@gabrielgio.me>
 2pkgname=photoview
 3pkgver=2.3.13
 4pkgrel=2
 5pkgdesc="Photo gallery for self-hosted personal servers"
 6url="https://github.com/photoview/photoview"
 7arch="x86_64"
 8license="AGPL-3.0"
 9install="$pkgname.pre-install"
10makedepends="go 
11    npm
12    dlib-dev
13    yaml-dev
14    libheif-dev
15    jpeg-dev
16    blas-dev
17    lapack-dev
18    exiftool
19    ffmpeg-dev"
20subpackages="$pkgname-openrc"
21source="$pkgname-$pkgver.tar.gz::https://github.com/photoview/photoview/archive/v$pkgver.tar.gz
22    $pkgname.pre-install
23    $pkgname.initd
24    $pkgname.confd"
25builddir="$srcdir/$pkgname-$pkgver"
26
27build() {
28    cd "$srcdir/$pkgname-$pkgver/api"
29    go build -o "$pkgname" server.go
30
31    cd "$srcdir/$pkgname-$pkgver/ui"
32    npm ci --yes --omit=dev --ignore-scripts
33    npm run build
34}
35
36check() {
37    cd "$srcdir/$pkgname-$pkgver/api"
38    go test ./...
39
40    cd "$srcdir/$pkgname-$pkgver/ui"
41    npm install
42    CI=true npm run test
43}
44
45package() {
46    install -Dm755 api/"$pkgname" "$pkgdir/usr/bin/$pkgname"
47    install -d "${pkgdir}/var/cache/${pkgname}/media_cache"
48
49    cd "$srcdir/$pkgname-$pkgver/ui/dist"
50    find * -type f -exec install -Dm0644 "{}" "${pkgdir}/usr/share/webapps/${pkgname}/{}" \;
51
52    install -d "${pkgdir}/var/lib/${pkgname}"
53
54	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
55	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
56}
57
58sha512sums="
5963feaaa33257a5f529fe87f354b1937f7eac60faf1ec0d01c1ca91bf6929b08b680359c044879e9ab96329690baa543e19d4cf0237b20fda152c39631496cd59  photoview-2.3.13.tar.gz
6025ab91023866397d7e7557c546606212c1c59f97d7a4f1dc091b717c5daaadcb35ab82552bc7ee723baf9b5dd8a76114e027ab453e4db9469931378655c82a29  photoview.pre-install
61e93390bbd9cf50f4838fdbe217656722781d07dcedebbbef27060df69107ebd5f04b8dec54f1802318e6da8f3a3c9c74a301c208e92713d3c785c7e35f14f55b  photoview.initd
6241e8ac7cca9051b7420de9c4fb67bad0168ac1ecc4ff63761defb1e025b0cbc8264443e2488af18b21ecd189d63cf2037103d3a6d6ba83eaf362c578f765da31  photoview.confd
63"