apkbuilds @ 88dc399dbb4d5359006c745d138e65183b818842

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