user/scanservjs: upgrade to 3.0.3

This commit is contained in:
Antoine Martin 2023-11-28 19:56:59 -05:00
parent 150a546396
commit fa933b283d
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -2,7 +2,7 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net> # Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=scanservjs pkgname=scanservjs
pkgver=2.21.0 pkgver=3.0.3
pkgrel=0 pkgrel=0
pkgdesc="SANE scanner nodejs web ui" pkgdesc="SANE scanner nodejs web ui"
arch="noarch" arch="noarch"
@ -28,38 +28,42 @@ source="
build() { build() {
# Uses version of webpack which is partially broken on nodejs >16 # Uses version of webpack which is partially broken on nodejs >16
export NODE_OPTIONS=--openssl-legacy-provider export NODE_OPTIONS=--openssl-legacy-provider
npm run install npm install --omit=dev --only=prod --loglevel=error
npm run build npm run build
cd dist
npm install --production
} }
package() { package() {
_webappdir="$pkgdir"/usr/share/webapps/scanservjs
# install documentation # install documentation
install -Dm644 ./docs/* -t "$pkgdir/usr/share/doc/scanservjs/" install -Dm644 ./docs/* -t "$pkgdir/usr/share/doc/scanservjs/"
install -d "$pkgdir/usr/share/webapps/scanservjs" "$pkgdir/etc/webapps/scanservjs" "$pkgdir/var/lib/webapps/scanservjs" install -d \
"$pkgdir/usr/share/webapps" \
"$pkgdir/etc" \
"$pkgdir/var/lib"
# install main files # install main files
cp -r dist/* "$pkgdir/usr/share/webapps/scanservjs/" cp -r dist "$_webappdir"
rm -r "$pkgdir"/usr/share/webapps/scanservjs/scanservjs.service
rm -r "$pkgdir"/usr/share/webapps/scanservjs/installer.sh
# Get rid of map files
find "$pkgdir" -name "*.map" -type f -delete
# Move and tidy up files
mv -v "$_webappdir"/data "$pkgdir"/var/lib/scanservjs
mv -v "$_webappdir"/config "$pkgdir"/etc/scanservjs
# 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 chmod +x "$pkgdir"/usr/share/webapps/scanservjs/server/server.js
mv "$pkgdir"/usr/share/webapps/scanservjs/config/* "$pkgdir/etc/webapps/scanservjs/"
mv "$pkgdir"/usr/share/webapps/scanservjs/data/* "$pkgdir/var/lib/webapps/scanservjs/"
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"
install -Dm 755 "$srcdir"/scanservjs.initd "$pkgdir"/etc/init.d/scanservjs install -Dm 755 "$srcdir"/scanservjs.initd "$pkgdir"/etc/init.d/scanservjs
install -Dm 644 "$srcdir"/scanservjs.conf "$pkgdir"/etc/conf.d/scanservjs install -Dm 644 "$srcdir"/scanservjs.conf "$pkgdir"/etc/conf.d/scanservjs
} }
sha512sums=" sha512sums="
1ee256bc6c38ccf1fcf196926f7fdbff6ff8d7e800a414ee5d45ad3b430c3f9055856d96181520b2f24e2d067f5ffc49fb7fd543fff8d0352517d1b7ccd12fd2 scanservjs-2.21.0.tar.gz e3746cfab118b08b75fe5a862e1b06d35bce3fafe7b5cf482ddfd28aad8ac9879981eef5bdadc35a783607aac49eef95b966ff1d2ddf431eaf6e2d7e335623fb scanservjs-3.0.3.tar.gz
f58dd5e1c4936d7e25065a295f5d01e64189cdefe92ba54fc875348a59a30b2055c93464d510a52820e66b42a69d0626d3513c93ab60b0768e1e8d5b3538bb13 scanservjs.initd f58dd5e1c4936d7e25065a295f5d01e64189cdefe92ba54fc875348a59a30b2055c93464d510a52820e66b42a69d0626d3513c93ab60b0768e1e8d5b3538bb13 scanservjs.initd
9d4fdab3803a598c729bf703369d8594b383163b05045f31e516f184a87d8deef8c8b40942d324e04bdf751ac9d63f7de25b13364f9f30888eba2af873369b36 scanservjs.conf 9d4fdab3803a598c729bf703369d8594b383163b05045f31e516f184a87d8deef8c8b40942d324e04bdf751ac9d63f7de25b13364f9f30888eba2af873369b36 scanservjs.conf
" "