ayaports/user/scanservjs/APKBUILD

70 lines
2 KiB
Text
Raw Normal View History

# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=scanservjs
2023-11-29 00:56:59 +00:00
pkgver=3.0.3
2023-01-10 19:16:09 +00:00
pkgrel=0
pkgdesc="SANE scanner nodejs web ui"
2023-08-11 19:49:05 +00:00
arch="noarch"
url="https://github.com/sbs20/scanservjs"
license="GPL-2.0-only"
depends="
sane
imagemagick
curl
nodejs
tesseract-ocr
"
makedepends="npm"
subpackages="$pkgname-doc $pkgname-openrc"
2023-01-10 19:16:09 +00:00
options="!check" # No testsuite
source="
$pkgname-$pkgver.tar.gz::https://github.com/sbs20/scanservjs/archive/refs/tags/v$pkgver.tar.gz
scanservjs.initd
scanservjs.conf
"
build() {
2023-01-10 19:16:09 +00:00
# Uses version of webpack which is partially broken on nodejs >16
export NODE_OPTIONS=--openssl-legacy-provider
2023-11-29 00:56:59 +00:00
npm install --omit=dev --only=prod --loglevel=error
2023-01-10 19:16:09 +00:00
npm run build
}
package() {
2023-11-29 00:56:59 +00:00
_webappdir="$pkgdir"/usr/share/webapps/scanservjs
2023-01-10 19:16:09 +00:00
# install documentation
install -Dm644 ./docs/* -t "$pkgdir/usr/share/doc/scanservjs/"
2023-11-29 00:56:59 +00:00
install -d \
"$pkgdir/usr/share/webapps" \
"$pkgdir/etc" \
"$pkgdir/var/lib"
2023-01-10 19:16:09 +00:00
# install main files
2023-11-29 00:56:59 +00:00
cp -r dist "$_webappdir"
2023-11-29 00:56:59 +00:00
# Get rid of map files
find "$pkgdir" -name "*.map" -type f -delete
2023-11-29 00:56:59 +00:00
# Move and tidy up files
mv -v "$_webappdir"/data "$pkgdir"/var/lib/scanservjs
mv -v "$_webappdir"/config "$pkgdir"/etc/scanservjs
2023-11-29 00:56:59 +00:00
# Create symlinks
ln -sv /var/lib/scanservjs "$_webappdir"/data
ln -sv /etc/scanservjs "$_webappdir"/config
# and the rest ...
chmod +x "$pkgdir"/usr/share/webapps/scanservjs/server/server.js
2023-01-10 19:16:09 +00:00
install -Dm 755 "$srcdir"/scanservjs.initd "$pkgdir"/etc/init.d/scanservjs
install -Dm 644 "$srcdir"/scanservjs.conf "$pkgdir"/etc/conf.d/scanservjs
}
sha512sums="
2023-11-29 00:56:59 +00:00
e3746cfab118b08b75fe5a862e1b06d35bce3fafe7b5cf482ddfd28aad8ac9879981eef5bdadc35a783607aac49eef95b966ff1d2ddf431eaf6e2d7e335623fb scanservjs-3.0.3.tar.gz
f58dd5e1c4936d7e25065a295f5d01e64189cdefe92ba54fc875348a59a30b2055c93464d510a52820e66b42a69d0626d3513c93ab60b0768e1e8d5b3538bb13 scanservjs.initd
9d4fdab3803a598c729bf703369d8594b383163b05045f31e516f184a87d8deef8c8b40942d324e04bdf751ac9d63f7de25b13364f9f30888eba2af873369b36 scanservjs.conf
"