2022-08-15 15:51:38 +00:00
|
|
|
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
|
|
|
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
|
|
|
|
|
|
|
pkgname=scanservjs
|
|
|
|
pkgver=2.21.0
|
2023-01-10 19:16:09 +00:00
|
|
|
pkgrel=0
|
2022-08-15 15:51:38 +00:00
|
|
|
pkgdesc="SANE scanner nodejs web ui"
|
|
|
|
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
|
2022-08-15 15:51:38 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
npm run install
|
|
|
|
npm run build
|
2022-08-15 15:51:38 +00:00
|
|
|
|
2023-01-10 19:16:09 +00:00
|
|
|
cd dist
|
|
|
|
npm install --production
|
2022-08-15 15:51:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2023-01-10 19:16:09 +00:00
|
|
|
# install documentation
|
|
|
|
install -Dm644 ./docs/* -t "$pkgdir/usr/share/doc/scanservjs/"
|
2022-08-15 15:51:38 +00:00
|
|
|
|
2023-01-10 19:16:09 +00:00
|
|
|
install -d "$pkgdir/usr/share/webapps/scanservjs" "$pkgdir/etc/webapps/scanservjs" "$pkgdir/var/lib/webapps/scanservjs"
|
2022-08-15 15:51:38 +00:00
|
|
|
|
2023-01-10 19:16:09 +00:00
|
|
|
# install main files
|
|
|
|
cp -r dist/* "$pkgdir/usr/share/webapps/scanservjs/"
|
|
|
|
rm -r "$pkgdir"/usr/share/webapps/scanservjs/scanservjs.service
|
|
|
|
rm -r "$pkgdir"/usr/share/webapps/scanservjs/installer.sh
|
2022-08-15 15:51:38 +00:00
|
|
|
|
2023-01-10 19:16:09 +00:00
|
|
|
chmod +x "$pkgdir"/usr/share/webapps/scanservjs/server/server.js
|
2022-08-15 15:51:38 +00:00
|
|
|
|
2023-01-10 19:16:09 +00:00
|
|
|
mv "$pkgdir"/usr/share/webapps/scanservjs/config/* "$pkgdir/etc/webapps/scanservjs/"
|
|
|
|
mv "$pkgdir"/usr/share/webapps/scanservjs/data/* "$pkgdir/var/lib/webapps/scanservjs/"
|
2022-08-15 15:51:38 +00:00
|
|
|
|
2023-01-10 19:16:09 +00:00
|
|
|
rmdir "$pkgdir"/usr/share/webapps/scanservjs/config "$pkgdir/usr/share/webapps/scanservjs/data"
|
|
|
|
ln -s /etc/webapps/scanservjs "$pkgdir/usr/share/webapps/scanservjs/config"
|
|
|
|
ln -s /var/lib/webapps/scanservjs "$pkgdir/usr/share/webapps/scanservjs/data"
|
2022-08-15 15:51:38 +00:00
|
|
|
|
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
|
2022-08-15 15:51:38 +00:00
|
|
|
}
|
|
|
|
sha512sums="
|
|
|
|
1ee256bc6c38ccf1fcf196926f7fdbff6ff8d7e800a414ee5d45ad3b430c3f9055856d96181520b2f24e2d067f5ffc49fb7fd543fff8d0352517d1b7ccd12fd2 scanservjs-2.21.0.tar.gz
|
|
|
|
f58dd5e1c4936d7e25065a295f5d01e64189cdefe92ba54fc875348a59a30b2055c93464d510a52820e66b42a69d0626d3513c93ab60b0768e1e8d5b3538bb13 scanservjs.initd
|
|
|
|
9d4fdab3803a598c729bf703369d8594b383163b05045f31e516f184a87d8deef8c8b40942d324e04bdf751ac9d63f7de25b13364f9f30888eba2af873369b36 scanservjs.conf
|
|
|
|
"
|