diff --git a/user/insaned/APKBUILD b/user/insaned/APKBUILD new file mode 100644 index 0000000..0d9fd0a --- /dev/null +++ b/user/insaned/APKBUILD @@ -0,0 +1,36 @@ +# Maintainer: Antoine Martin (ayakael) +# Contributor: Antoine Martin (ayakael) + +pkgname=insaned +pkgver=0.0.4 +pkgrel=2 +pkgdesc="Insaned is a simple linux daemon for polling button presses on SANE-managed scanners." +arch="x86_64" +url="https://gitlab.com/xeijin-dev/insaned" +license="GNU-2.0-only" +makedepends="sane-dev" +builddir="$srcdir"/$pkgname-v$pkgver +subpackages="$pkgname-openrc" +source=" + https://gitlab.com/xeijin-dev/insaned/-/archive/v$pkgver/insaned-v$pkgver.tar.gz + insaned.openrc + insaned.conf + " + +build() { + make +} + +package() { + install -Dm 755 "$builddir"/insaned "$pkgdir"/usr/bin/insaned + install -Dm 755 "$srcdir"/insaned.openrc "$pkgdir"/etc/init.d/insaned + install -Dm 644 "$srcdir"/insaned.conf "$pkgdir"/etc/conf.d/insaned + + install -dm 755 "$pkgdir"/etc/insaned + cp -r "$builddir"/events "$pkgdir"/etc/insaned/events +} +sha512sums=" +60ab37e8506b4b4ee4dc063e43c06af51ababdbbf3200332c1ef7abcdd3ee23764caf0c4f4d3ea413a83b9d3fc1b85d2e69f87c5ac6f7990186b716b9e3cce09 insaned-v0.0.4.tar.gz +d74e99022f0a5db981571efa9b14675d9b1f908fefd75b5bf96b36449ebb79a89424ac43d17a7872b35f76fb6b7eb4d5e0db15490ab83ffdd038022e10aac2b2 insaned.openrc +ad224b62faa5349cff57351f4c72bec5bfad2b6d84e5a1aef4bbde36cd3a265db7d0160964ae679f7a8c0a8d18c1c15469606648849e50e333f4b3158c0406bf insaned.conf +" diff --git a/user/insaned/insaned.conf b/user/insaned/insaned.conf new file mode 100644 index 0000000..01758de --- /dev/null +++ b/user/insaned/insaned.conf @@ -0,0 +1,13 @@ +# /etc/conf.d/insaned: config file for /etc/init.d/insaned + +# Adjust scheduling priority on insaned (default: 0) +#INSANED_NICELEVEL="0" + +# Pass extra options to insaned +INSANED_EXTRAOPTS="--sleep-ms=1000 --suspend-after-event" +#INSANED_EXTRAOPTS="-vv --sleep-ms=1000 --suspend-after-event" + +# it is HIGHLY recommended to use less privileged user +# event handler scripts are executed with privileges of this user +INSANED_USER=root +INSANED_GROUP=root diff --git a/user/insaned/insaned.openrc b/user/insaned/insaned.openrc new file mode 100644 index 0000000..ab25d63 --- /dev/null +++ b/user/insaned/insaned.openrc @@ -0,0 +1,21 @@ +#!/sbin/openrc-run + +name=$RC_SVCNAME +cfgfile="/etc/conf.d/$RC_SVCNAME.conf" +pidfile="/var/run/$RC_SVCNAME.pid" +command="/usr/bin/insaned" +command_user="$INSANED_USER" +command_group="$INSANED_GROUP" +command_args="-f $INSANED_LOG -p $pidfile ${INSANED_EXTRAOPTS}" +start_stop_daemon_args="" +command_background="no" + +depend() { + after saned +} + +start_pre() { + checkpath --directory --owner $command_user:$command_group --mode 0775 \ + /var/run/$RC_SVCNAME \ + /var/log/$RC_SVCNAME +} diff --git a/user/lua-aports/APKBUILD b/user/lua-aports/APKBUILD index 2fffaf5..0e5c202 100644 --- a/user/lua-aports/APKBUILD +++ b/user/lua-aports/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa pkgname=lua-aports pkgver=1.1.1 -_gittag=154db056ab3dfa1e1575ba031fc61986ab2a5907 +_gittag=678831e1eb81e35622b58530ec8d5b383a0eee81 pkgrel=0 pkgdesc="Lua modules for parsing aports tree" url="https://dev.alpinelinux.org/archive/lua-aports/" @@ -9,7 +9,7 @@ arch="noarch" license="MIT" depends="lua5.2-cjson lua5.2-filesystem lua5.2-optarg lua5.2" replaces="abuild" -source="https://gitlab.alpinelinux.org/alpine/lua-aports/-/archive/$_gittag/lua-aports-$_gittag.tar.gz" +source="https://gitlab.alpinelinux.org/ayakael/lua-aports/-/archive/$_gittag/lua-aports-$_gittag.tar.gz" builddir="$srcdir/$pkgname-$_gittag" package() { @@ -18,5 +18,5 @@ package() { } sha512sums=" -a2aa54738d3572a11e218db8ae3d11230c20b521101077a55c581f3d75ca289b4b0a36a01305f3d7628bbc4d7e9479fec807169a41c7b25810d72221fc970213 lua-aports-154db056ab3dfa1e1575ba031fc61986ab2a5907.tar.gz +cc69d9095294a20b1897b8928424b7a6328663ea2e7fd1d9c2e898df4ace37fa4c5dba0ee50a71a1cc146fe2465f05237d54337b12107bda879da43c15bc5201 lua-aports-678831e1eb81e35622b58530ec8d5b383a0eee81.tar.gz " diff --git a/user/paperless-ng/APKBUILD b/user/paperless-ng/APKBUILD index 7f48db3..3ea03fc 100644 --- a/user/paperless-ng/APKBUILD +++ b/user/paperless-ng/APKBUILD @@ -6,158 +6,161 @@ pkgname="paperless-ng" pkgver=1.5.0 -pkgrel=0 +pkgrel=1 pkgdesc="A supercharged version of paperless: scan, index and archive all your physical documents" url="https://github.com/jonaswinkler/paperless-ng" -license="GPL3" +license="GPL-3.0-only" arch="noarch" depends=" - file - gnupg - py3-gunicorn - imagemagick - mailcap - ocrmypdf - optipng - redis - sqlite - tesseract-ocr - tesseract-ocr-data-fra - ttf-liberation - py3-uvicorn - py3-aiohttp - py3-arrow - py3-asgiref - py3-async-timeout - py3-attrs - py3-autobahn - py3-automat - py3-blessed - py3-certifi - py3-django-channels - py3-django-channels-redis - py3-chardet - py3-click - py3-concurrent-log-handler - py3-constantly - py3-cryptography - py3-daphne - py3-dateparser - py3-django - py3-django-cors-headers - py3-django-extensions - py3-django-filter - py3-django-picklefield - py3-django-q - py3-django-rest-framework - py3-filelock - py3-fuzzywuzzy - py3-h11 - py3-hiredis - py3-httptools - py3-humanfriendly - py3-hyperlink - py3-idna - py3-imap-tools - py3-incremental - py3-inotify-simple - py3-inotifyrecursive - py3-joblib - py3-langdetect - py3-lxml - py3-msgpack - py3-numpy - py3-pathvalidate - py3-portalocker - py3-psycopg2 - py3-asn1 - py3-asn1-modules - py3-cparser - py3-openssl - py3-dateutil - py3-dotenv - py3-gnupg - py3-levenshtein - py3-magic - py3-tz - py3-yaml - py3-redis - py3-regex - py3-requests - py3-scikit-learn - py3-scipy - py3-service_identity - py3-six - py3-sortedcontainers - py3-sqlparse - py3-threadpoolctl - py3-tika - py3-twisted - py3-txaio - py3-urllib3 - py3-uvloop - py3-watchdog - py3-watchgod - py3-wcwidth - py3-websockets - py3-whitenoise - py3-whoosh - py3-zope-interface - postgresql - jbig2enc" -builddir="${srcdir}"/${pkgname} + file + gnupg + py3-gunicorn + imagemagick + mailcap + ocrmypdf + optipng + redis + sqlite + tesseract-ocr + tesseract-ocr-data-fra + ttf-liberation + py3-uvicorn + py3-aiohttp + py3-arrow + py3-asgiref + py3-async-timeout + py3-attrs + py3-autobahn + py3-automat + py3-blessed + py3-certifi + py3-django-channels + py3-django-channels-redis + py3-chardet + py3-click + py3-concurrent-log-handler + py3-constantly + py3-cryptography + py3-daphne + py3-dateparser + py3-django + py3-django-cors-headers + py3-django-extensions + py3-django-filter + py3-django-picklefield + py3-django-q + py3-django-rest-framework + py3-filelock + py3-fuzzywuzzy + py3-h11 + py3-hiredis + py3-httptools + py3-humanfriendly + py3-hyperlink + py3-idna + py3-imap-tools + py3-incremental + py3-inotify-simple + py3-inotifyrecursive + py3-joblib + py3-langdetect + py3-lxml + py3-msgpack + py3-numpy + py3-pathvalidate + py3-portalocker + py3-psycopg2 + py3-asn1 + py3-asn1-modules + py3-cparser + py3-openssl + py3-dateutil + py3-dotenv + py3-gnupg + py3-levenshtein + py3-magic + py3-tz + py3-yaml + py3-redis + py3-regex + py3-requests + py3-scikit-learn + py3-scipy + py3-service_identity + py3-six + py3-sortedcontainers + py3-sqlparse + py3-threadpoolctl + py3-tika + py3-twisted + py3-txaio + py3-urllib3 + py3-uvloop + py3-watchdog + py3-watchgod + py3-wcwidth + py3-websockets + py3-whitenoise + py3-whoosh + py3-zope-interface + postgresql + jbig2enc + " +builddir="$srcdir"/$pkgname -source="$url/releases/download/ng-$pkgver/$pkgname-$pkgver.tar.xz" +source=" + $url/releases/download/ng-$pkgver/$pkgname-$pkgver.tar.xz + paperless-scheduler.openrc + paperless-consumer.openrc + paperless-webserver.openrc + " options="!strip !check" +subpackages="$pkgname-openrc" prepare(){ - cd "${builddir}" + default_prepare - # use alpine linux canonical paths - sed -i "paperless.conf" \ - -e "s|#PAPERLESS_CONSUMPTION_DIR=../consume|PAPERLESS_CONSUMPTION_DIR=/var/lib/paperless/consume|" \ - -e "s|#PAPERLESS_DATA_DIR=../data|PAPERLESS_DATA_DIR=/var/lib/paperless/data|" \ - -e "s|#PAPERLESS_MEDIA_ROOT=../media|PAPERLESS_MEDIA_ROOT=/var/lib/paperless/media|" \ - -e "s|#PAPERLESS_STATICDIR=../static|PAPERLESS_STATICDIR=/usr/share/webapps/paperless/static|" \ - -e "s|#PAPERLESS_CONVERT_TMPDIR=/var/tmp/paperless|PAPERLESS_CONVERT_TMPDIR=/var/lib/paperless/tmp|" + # use alpine linux canonical paths + sed -i "paperless.conf" \ + -e "s|#PAPERLESS_CONSUMPTION_DIR=../consume|PAPERLESS_CONSUMPTION_DIR=/var/lib/paperless/consume|" \ + -e "s|#PAPERLESS_DATA_DIR=../data|PAPERLESS_DATA_DIR=/var/lib/paperless/data|" \ + -e "s|#PAPERLESS_MEDIA_ROOT=../media|PAPERLESS_MEDIA_ROOT=/var/lib/paperless/media|" \ + -e "s|#PAPERLESS_STATICDIR=../static|PAPERLESS_STATICDIR=/usr/share/webapps/paperless/static|" \ + -e "s|#PAPERLESS_CONVERT_TMPDIR=/var/tmp/paperless|PAPERLESS_CONVERT_TMPDIR=/var/lib/paperless/tmp|" - # remove hardcoded bind address - sed -i "gunicorn.conf.py" \ - -e "s|bind = '0.0.0.0:8000'||" + # remove hardcoded bind address + sed -i "gunicorn.conf.py" \ + -e "s|bind = '0.0.0.0:8000'||" - # add custom dir for uploaded files - printf "\n# Uploads\n\nPAPERLESS_SCRATCH_DIR=/var/lib/paperless/uploads" >> "paperless.conf" + # add custom dir for uploaded files + printf "\n# Uploads\n\nPAPERLESS_SCRATCH_DIR=/var/lib/paperless/uploads" >> "paperless.conf" - # add customizable bind address, will be used by paperless-webserver.service - printf "\n\n# Webserver\n\nGUNICORN_CMD_ARGS='--bind=127.0.0.1:8000'" >> "paperless.conf" + # add customizable bind address, will be used by paperless-webserver.service + printf "\n\n# Webserver\n\nGUNICORN_CMD_ARGS='--bind=127.0.0.1:8000'" >> "paperless.conf" } package(){ - cd "${builddir}" + # program files + install -d "$pkgdir/usr/bin" "$pkgdir/usr/share/webapps" + cp -R "$builddir" "$pkgdir/usr/share/webapps/paperless" - # program files - install -d "$pkgdir/usr/bin" "$pkgdir/usr/share/webapps" - cp -R "$builddir" "$pkgdir/usr/share/webapps/paperless" + # main executable + chmod 755 "$pkgdir/usr/share/webapps/paperless/src/manage.py" + ln -s "/usr/share/webapps/paperless/src/manage.py" "$pkgdir/usr/bin/paperless-manage" - # main executable - chmod 755 "$pkgdir/usr/share/webapps/paperless/src/manage.py" - ln -s "/usr/share/webapps/paperless/src/manage.py" "$pkgdir/usr/bin/paperless-manage" + # config file + install -D -m 640 "paperless.conf" "$pkgdir/etc/paperless.conf" + rm "$pkgdir/usr/share/webapps/paperless/paperless.conf" + ln -s "/etc/paperless.conf" "$pkgdir/usr/share/webapps/paperless/paperless.conf" - # config file - install -D -m 640 "paperless.conf" "$pkgdir/etc/paperless.conf" - rm "$pkgdir/usr/share/webapps/paperless/paperless.conf" - ln -s "/etc/paperless.conf" "$pkgdir/usr/share/webapps/paperless/paperless.conf" - - # user and files to create, ownership and permission to set - #install -D -m 644 "$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" - #install -D -m 644 "$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" - - # service files - #install -D -m 644 "paperless.target" "$pkgdir/usr/lib/systemd/system/paperless.target" - #install -D -m 644 "paperless-consumer.service" "$pkgdir/usr/lib/systemd/system/paperless-consumer.service" - #install -D -m 644 "paperless-scheduler.service" "$pkgdir/usr/lib/systemd/system/paperless-scheduler.service" - #install -D -m 644 "paperless-webserver.service" "$pkgdir/usr/lib/systemd/system/paperless-webserver.service" + # openrc file + install -Dm 755 "$srcdir"/paperless-scheduler.openrc "$pkgdir"/etc/init.d/paperless-scheduler + install -Dm 755 "$srcdir"/paperless-consumer.openrc "$pkgdir"/etc/init.d/paperless-consumer + install -Dm 755 "$srcdir"/paperless-webserver.openrc "$pkgdir"/etc/init.d/paperless-webserver } sha512sums=" 3fed4eb647520ddc55fb7b570c59379dba26a3ba288b86dda096c143873debf82882e78324aada7c723c7932404b2068442be48a535bb962c4563d8a187e95d7 paperless-ng-1.5.0.tar.xz +8ec29db4fd45c9796076647b6e1f3eee03d378054048f1edc494ac52843b44d61ef0ea6d4cf271df0029eda78d06bef950a706c52db0f234443b336684219d75 paperless-scheduler.openrc +471113b44904a4e6bdd0724a10d3a35e28431ca9e7a60a3c70bf5a30e6de8e70533c55c47616727d9e32910bc5d0a2291582e83531ce555b77c53e0e67b6f3d4 paperless-consumer.openrc +c4813811cf9dbe05af5ddfe2e0ee15022bb89c3dadb66cfb8c0557d55fa8eca68b52071757805b02f8ee28059e544dec6113231ba5b310887443d44321f10106 paperless-webserver.openrc " diff --git a/user/paperless-ng/paperless-consumer.openrc b/user/paperless-ng/paperless-consumer.openrc new file mode 100644 index 0000000..f1f05fc --- /dev/null +++ b/user/paperless-ng/paperless-consumer.openrc @@ -0,0 +1,22 @@ +#!/sbin/openrc-run + +name=$RC_SVCNAME +cfgfile="/etc/qubes/$RC_SVCNAME.conf" +pidfile="/var/run/$RC_SVCNAME.pid" +command="/usr/share/webapps/paperless/src/manage.py" +command_args="document_consumer" +command_user="paperless" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/paperless/$RC_SVCNAME.log" +error_log="/var/log/paperless/$RC_SVCNAME.err" + +depend() { + need redis +} + +start_pre() { + checkpath --directory --owner $command_user:paperless --mode 0775 \ + /var/log/paperless \ + /var/lib/paperless +} diff --git a/user/paperless-ng/paperless-scheduler.openrc b/user/paperless-ng/paperless-scheduler.openrc new file mode 100644 index 0000000..49020cb --- /dev/null +++ b/user/paperless-ng/paperless-scheduler.openrc @@ -0,0 +1,22 @@ +#!/sbin/openrc-run + +name=$RC_SVCNAME +cfgfile="/etc/qubes/$RC_SVCNAME.conf" +pidfile="/var/run/$RC_SVCNAME.pid" +command="/usr/share/webapps/paperless/src/manage.py" +command_args="qcluster" +command_user="paperless" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/paperless/$RC_SVCNAME.log" +error_log="/var/log/paperless/$RC_SVCNAME.err" + +depend() { + need redis +} + +start_pre() { + checkpath --directory --owner $command_user:paperless --mode 0775 \ + /var/log/paperless \ + /var/lib/paperless +} diff --git a/user/paperless-ng/paperless-webserver.openrc b/user/paperless-ng/paperless-webserver.openrc new file mode 100644 index 0000000..2939bf2 --- /dev/null +++ b/user/paperless-ng/paperless-webserver.openrc @@ -0,0 +1,22 @@ +#!/sbin/openrc-run + +name=$RC_SVCNAME +cfgfile="/etc/qubes/$RC_SVCNAME.conf" +pidfile="/var/run/$RC_SVCNAME.pid" +command="/usr/bin/gunicorn" +command_args="-c /usr/share/webapps/paperless/gunicorn.conf.py paperless.asgi:application --chdir /usr/share/webapps/paperless/src" +command_user="paperless" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/paperless/$RC_SVCNAME.log" +error_log="/var/log/paperless/$RC_SVCNAME.err" + +depend() { + need redis +} + +start_pre() { + checkpath --directory --owner $command_user:paperless --mode 0775 \ + /var/log/paperless \ + /var/lib/paperless +} diff --git a/user/paperless-ngx/APKBUILD b/user/paperless-ngx/APKBUILD new file mode 100644 index 0000000..b6f8f4f --- /dev/null +++ b/user/paperless-ngx/APKBUILD @@ -0,0 +1,174 @@ +# Maintainer: Antoine Martin (ayakael) +# +# Based on ArchLinux AUR by: +# Co-Maintainer: AlphaJack +# Co-Maintainer: amo + +pkgname="paperless-ngx" +pkgver=1.8.0 +pkgrel=2 +pkgdesc="A community-supported supercharged version of paperless: scan, index and archive all your physical documents" +url="https://github.com/paperless-ngx/paperless-ngx" +license="GPL-3.0-only" +arch="noarch" +replaces="paperless-ng" +depends=" + file + gnupg + py3-gunicorn + imagemagick + mailcap + ocrmypdf + optipng + redis + sqlite + tesseract-ocr + tesseract-ocr-data-fra + ttf-liberation + py3-uvicorn + py3-aiohttp + py3-anyio + py3-arrow + py3-asgiref + py3-async-timeout + py3-attrs + py3-autobahn + py3-automat + py3-blessed + py3-certifi + py3-django-channels + py3-django-channels-redis + py3-chardet + py3-charset-normalizer + py3-click + py3-concurrent-log-handler + py3-constantly + py3-cryptography + py3-daphne + py3-dateparser py3-django + py3-deprecation + py3-django-cors-headers + py3-django-extensions + py3-django-filter + py3-django-picklefield + py3-django-q + py3-django-rest-framework + py3-filelock + py3-fuzzywuzzy + py3-h11 + py3-hiredis + py3-httptools + py3-humanfriendly + py3-hyperlink + py3-idna + py3-imap-tools + py3-incremental + py3-inotify-simple + py3-inotifyrecursive + py3-joblib + py3-langdetect + py3-lxml + py3-msgpack + py3-numpy + py3-pathvalidate + py3-portalocker + py3-psycopg2 + py3-asn1 + py3-asn1-modules + py3-cparser + py3-openssl + py3-dateutil + py3-dotenv + py3-gnupg + py3-levenshtein + py3-magic + py3-pdf2image + py3-pyzbar + py3-pillow + py3-tz + py3-redis + py3-regex + py3-requests + py3-scikit-learn + py3-scipy + py3-service_identity + py3-six + py3-sniffio + py3-sortedcontainers + py3-sqlparse + py3-threadpoolctl + py3-tika + py3-twisted + py3-txaio + py3-urllib3 + py3-uvloop + py3-watchdog + py3-watchgod + py3-watchfiles + py3-wcwidth + py3-websockets + py3-whitenoise + py3-whoosh + py3-yaml + py3-zope-interface + postgresql + jbig2enc + " +builddir="$srcdir"/$pkgname + +source=" + $url/releases/download/v$pkgver/$pkgname-v$pkgver.tar.xz + paperless-scheduler.openrc + paperless-consumer.openrc + paperless-webserver.openrc + " +options="!strip !check" +subpackages="$pkgname-openrc" + +prepare(){ + default_prepare + + # use alpine linux canonical paths + sed -i "paperless.conf" \ + -e "s|#PAPERLESS_CONSUMPTION_DIR=../consume|PAPERLESS_CONSUMPTION_DIR=/var/lib/paperless/consume|" \ + -e "s|#PAPERLESS_DATA_DIR=../data|PAPERLESS_DATA_DIR=/var/lib/paperless/data|" \ + -e "s|#PAPERLESS_MEDIA_ROOT=../media|PAPERLESS_MEDIA_ROOT=/var/lib/paperless/media|" \ + -e "s|#PAPERLESS_STATICDIR=../static|PAPERLESS_STATICDIR=/usr/share/webapps/paperless/static|" \ + -e "s|#PAPERLESS_CONVERT_TMPDIR=/var/tmp/paperless|PAPERLESS_CONVERT_TMPDIR=/var/lib/paperless/tmp|" + + # remove hardcoded bind address + sed -i "gunicorn.conf.py" \ + -e "s|bind = '0.0.0.0:8000'||" + + # add custom dir for uploaded files + printf "\n# Uploads\n\nPAPERLESS_SCRATCH_DIR=/var/lib/paperless/uploads" >> "paperless.conf" + + # add customizable bind address, will be used by paperless-webserver.service + printf "\n\n# Webserver\n\nGUNICORN_CMD_ARGS='--bind=127.0.0.1:8000'" >> "paperless.conf" +} + +package(){ + # program files + install -d "$pkgdir/usr/bin" "$pkgdir/usr/share/webapps" + cp -R "$builddir" "$pkgdir/usr/share/webapps/paperless" + + # main executable + chmod 755 "$pkgdir/usr/share/webapps/paperless/src/manage.py" + ln -s "/usr/share/webapps/paperless/src/manage.py" "$pkgdir/usr/bin/paperless-manage" + + # config file + install -D -m 640 "paperless.conf" "$pkgdir/etc/paperless.conf" + rm "$pkgdir/usr/share/webapps/paperless/paperless.conf" + ln -s "/etc/paperless.conf" "$pkgdir/usr/share/webapps/paperless/paperless.conf" + + # openrc file + install -Dm 755 "$srcdir"/paperless-scheduler.openrc "$pkgdir"/etc/init.d/paperless-scheduler + install -Dm 755 "$srcdir"/paperless-consumer.openrc "$pkgdir"/etc/init.d/paperless-consumer + install -Dm 755 "$srcdir"/paperless-webserver.openrc "$pkgdir"/etc/init.d/paperless-webserver +} +sha512sums=" +f927cb5183633d22d0e856fd5d6a4afd9d7f9d02b48763f6626a91ef8b7fc765d410d5a2c433d65e8f87119a8aa2b85a47b8e9b98bdf5e3104c6861db63f8438 paperless-ngx-v1.8.0.tar.xz +a62a499c1d8fede5685e98f639c1155fdc7387eaf7908b04317a9af6594427d11416730f4dd127cf2e249ac97242634acf900fe32541edfe95ac9298eeea0cd6 paperless-scheduler.openrc +b4413f48b481d53b3e10542f5ffe830928c40ae016e2dc1da533ae8b546c5b6e4ddfa1129280807f866002f61b283c4eba327be6eb04171e259fe27fec47696a paperless-consumer.openrc +e9c517f7fbae269072506316711a12a6ba5568456348305972caf023020de5ebeab45401371fe114fe8dbddfacbcc6cfd01d0fad2b2ade6ee3883f46120b904e paperless-webserver.openrc +" diff --git a/user/paperless-ngx/paperless-consumer.openrc b/user/paperless-ngx/paperless-consumer.openrc new file mode 100644 index 0000000..981e4c0 --- /dev/null +++ b/user/paperless-ngx/paperless-consumer.openrc @@ -0,0 +1,23 @@ +#!/sbin/openrc-run + +name="$RC_SVCNAME" +cfgfile="/etc/conf.d/$RC_SVCNAME.conf" +pidfile="/var/run/$RC_SVCNAME.pid" +command="/usr/share/webapps/paperless/src/manage.py" +command_args="document_consumer" +command_user="paperless" +command_group="paperless" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/paperless/$RC_SVCNAME.log" +error_log="/var/log/paperless/$RC_SVCNAME.err" + +depend() { + need redis +} + +start_pre() { + checkpath --directory --owner $command_user:$command_group --mode 0775 \ + /var/log/paperless \ + /var/lib/paperless +} diff --git a/user/paperless-ngx/paperless-scheduler.openrc b/user/paperless-ngx/paperless-scheduler.openrc new file mode 100644 index 0000000..085c0fc --- /dev/null +++ b/user/paperless-ngx/paperless-scheduler.openrc @@ -0,0 +1,23 @@ +#!/sbin/openrc-run + +name="$RC_SVCNAME" +cfgfile="/etc/conf.d/$RC_SVCNAME.conf" +pidfile="/var/run/$RC_SVCNAME.pid" +command="/usr/share/webapps/paperless/src/manage.py" +command_args="qcluster" +command_user="paperless" +command_group="paperless" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/paperless/$RC_SVCNAME.log" +error_log="/var/log/paperless/$RC_SVCNAME.err" + +depend() { + need redis +} + +start_pre() { + checkpath --directory --owner $command_user:$command_group --mode 0775 \ + /var/log/paperless \ + /var/lib/paperless +} diff --git a/user/paperless-ngx/paperless-webserver.openrc b/user/paperless-ngx/paperless-webserver.openrc new file mode 100644 index 0000000..4c03419 --- /dev/null +++ b/user/paperless-ngx/paperless-webserver.openrc @@ -0,0 +1,24 @@ +#!/sbin/openrc-run + +name="$RC_SVCNAME" +cfgfile="/etc/conf.d/$RC_SVCNAME.conf" +pidfile="/var/run/$RC_SVCNAME.pid" +command="/usr/bin/gunicorn" +command_args="-c /usr/share/webapps/paperless/gunicorn.conf.py paperless.asgi:application --chdir /usr/share/webapps/paperless/src" +command_user="paperless" +command_group="paperless" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/paperless/$RC_SVCNAME.log" +error_log="/var/log/paperless/$RC_SVCNAME.err" + +depend() { + need redis + need postgresql +} + +start_pre() { + checkpath --directory --owner $command_user:$command_group --mode 0775 \ + /var/log/paperless \ + /var/lib/paperless +} diff --git a/user/py3-anyio/APKBUILD b/user/py3-anyio/APKBUILD new file mode 100644 index 0000000..068e302 --- /dev/null +++ b/user/py3-anyio/APKBUILD @@ -0,0 +1,41 @@ +# Maintainer: Antoine Martin + +pkgname="py3-anyio" +_pkgname="anyio" +pkgver=3.6.1 +_pkgver=$pkgver +pkgrel=0 +arch='noarch' +pkgdesc="High level compatibility layer for multiple asynchronous event loop implementations" +url="https://github.com/agronholm/anyio" +license="MIT" +depends="python3 py3-idna py3-sniffio" +makedepends="py3-setuptools py3-setuptools_scm" +checkdepends="py3-pytest py3-trustme py3-hypothesis py3-uvloop py3-trio py3-pytest-mock" +source="${pkgname}-${pkgver}.tar.gz::https://pypi.io/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" +builddir="$srcdir"/$_pkgname-$pkgver +options="!check" # Failing tests + +build() { + python3 setup.py build +} + +check() { + # Install to a temporary root as the test suite requires the entry point for + # its pytest plugin + pyver=$(python3 -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))") + python3 setup.py install --root="$PWD/tmp_install" --skip-build + PYTHONPATH="$PWD/tmp_install/usr/lib/python$pyver/site-packages" pytest +} + +package() { + python3 setup.py install \ + --skip-build \ + --optimize=1 \ + --prefix=/usr \ + --root="$pkgdir" +} + +sha512sums=" +99ae55eada2df971405a1592afd980ac964c80a4502465a2016423182409691d0c943280a3a7448efc78036e481614451585238b62ebea924709f0ba888f7604 py3-anyio-3.6.1.tar.gz +" diff --git a/user/py3-dateparser/0001-fix-for-parsing-error-due-to-regex-version.patch b/user/py3-dateparser/0001-fix-for-parsing-error-due-to-regex-version.patch new file mode 100644 index 0000000..e4d9bcd --- /dev/null +++ b/user/py3-dateparser/0001-fix-for-parsing-error-due-to-regex-version.patch @@ -0,0 +1,25 @@ +From 12a5ef9e641ac65bf2f5f2a8427d2f85466b35ca Mon Sep 17 00:00:00 2001 +From: "build@apk-groulx" +Date: Sun, 31 Jul 2022 16:32:21 +0000 +Subject: [PATCH 1/1] fix for parsing error due to regex version + +--- + dateparser/languages/locale.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dateparser/languages/locale.py b/dateparser/languages/locale.py +index 0cb5785..a1b3c8f 100644 +--- a/dateparser/languages/locale.py ++++ b/dateparser/languages/locale.py +@@ -169,7 +169,7 @@ class Locale: + if normalize: + value = list(map(normalize_unicode, value)) + pattern = '|'.join(sorted(value, key=len, reverse=True)) +- pattern = DIGIT_GROUP_PATTERN.sub(r'?P\d+', pattern) ++ pattern = pattern.replace(r'\d+', r'?P\d+') + pattern = re.compile(r'^(?:{})$'.format(pattern), re.UNICODE | re.IGNORECASE) + relative_dictionary[pattern] = key + return relative_dictionary +-- +2.36.2 + diff --git a/user/py3-dateparser/APKBUILD b/user/py3-dateparser/APKBUILD index 6ae5dd8..01bf6e4 100644 --- a/user/py3-dateparser/APKBUILD +++ b/user/py3-dateparser/APKBUILD @@ -2,8 +2,8 @@ _pyname='dateparser' pkgname="py3-$_pyname" -pkgver=1.0.0 -pkgrel=0 +pkgver=1.1.1 +pkgrel=1 arch='noarch' pkgdesc='Python parser for human readable dates' url="https://pypi.python.org/project/${_pyname}" @@ -11,7 +11,10 @@ license="BSD" depends='python3 py3-dateutil py3-regex py3-tz py3-ruamel-yaml' makedepends='py3-setuptools' options="!check" -source="${pkgname}-${pkgver}.tar.gz::https://pypi.io/packages/source/${_pyname:0:1}/$_pyname/$_pyname-${pkgver}.tar.gz" +source=" + ${pkgname}-${pkgver}.tar.gz::https://pypi.io/packages/source/${_pyname:0:1}/$_pyname/$_pyname-${pkgver}.tar.gz + 0001-fix-for-parsing-error-due-to-regex-version.patch + " builddir="$srcdir"/$_pyname-$pkgver build() { @@ -28,5 +31,6 @@ package() { install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE } sha512sums=" -8e796adc70157242fca365786628f01fbbc5ee63c72085740710c65af33c8a8bbdd4725bd80886e6e630409caf526bccbe9e88ec3f4c6682b54b30edf096361e py3-dateparser-1.0.0.tar.gz +2ef25877616ce6e0aaa4ede53b4c27e848a63e5237b6e4095071b1a4eb5e0162e25f0be6a96697a11628753b798c9dfeff5d098889bf409678f51a3f4446d944 py3-dateparser-1.1.1.tar.gz +9f6234c729c6464ee4020288b0695d13dbc2c78d531711d3b36901164c104183f2a293649c4f1312122c7fa29e653720c533b3dabb55a517153f399b00cee8f5 0001-fix-for-parsing-error-due-to-regex-version.patch " diff --git a/user/py3-pdf2image/APKBUILD b/user/py3-pdf2image/APKBUILD new file mode 100644 index 0000000..cb01417 --- /dev/null +++ b/user/py3-pdf2image/APKBUILD @@ -0,0 +1,31 @@ +# Maintainer: Antoine Martin + +pkgname="py3-pdf2image" +_pkgname="pdf2image" +pkgver=1.16.0 +pkgrel=0 +arch='noarch' +pkgdesc="ython wrapper around the pdftoppm and pdftocairo command line tools to convert PDF to a PIL Image list" +url="https://github.com/Belval/pdf2image" +license="MIT" +depends="python3 py3-pillow poppler" +makedepends="py3-setuptools" +source="${pkgname}-${pkgver}.tar.gz::https://pypi.io/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" +options="!check" +builddir="$srcdir"/$_pkgname-$pkgver + +build() { + python3 setup.py build +} + +package() { + python3 setup.py install \ + --skip-build \ + --optimize=1 \ + --prefix=/usr \ + --root="$pkgdir" +} + +sha512sums=" +fc6512d8f5ec21b5199348b9d0070dd7b3c063ada33f7024b8d9296bf3776025c85bb50a23d8d2a4b7a544bcadcc810c413ab60ad2744b96a3a0cd4d72d478e5 py3-pdf2image-1.16.0.tar.gz +" diff --git a/user/py3-pyaml/APKBUILD b/user/py3-pyaml/APKBUILD new file mode 100644 index 0000000..de4af21 --- /dev/null +++ b/user/py3-pyaml/APKBUILD @@ -0,0 +1,36 @@ +# Maintainer: Antoine Martin + +pkgname="py3-pyaml" +_pkgname="pyaml" +pkgver=21.10.1 +pkgrel=0 +arch='noarch' +pkgdesc="PyYAML-based module to produce pretty and readable YAML-serialized data" +url="https://pypi.python.org/pypi/pyaml" +license="BSD" +depends="py3-yaml" +makedepends="py3-setuptools" +checkdepends="py3-unidecone" +source="${pkgname}-${pkgver}.tar.gz::https://pypi.io/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" +options="!check" +builddir="$srcdir"/$_pkgname-$pkgver + +build() { + python3 setup.py build +} + +check() { + python3 setup.py test +} + +package() { + python3 setup.py install \ + --skip-build \ + --optimize=1 \ + --prefix=/usr \ + --root="$pkgdir" +} + +sha512sums=" +3a98a021856446584f079bfb7427c63feaf6fdd1bd0d809d46aa0c646b2cb9533c393ed0167240be587aad7b94209b6e5bfe2c09918b45ec9a86ad9781bdf9f2 py3-pyaml-21.10.1.tar.gz +" diff --git a/user/py3-pytz-deprecation-shim/APKBUILD b/user/py3-pytz-deprecation-shim/APKBUILD new file mode 100644 index 0000000..dbd271b --- /dev/null +++ b/user/py3-pytz-deprecation-shim/APKBUILD @@ -0,0 +1,28 @@ +# Maintainer: Antoine Martin + +pkgname='py3-pytz-deprecation-shim' +_pkgname=pytz_deprecation_shim +pkgver=0.1.0 +_pkgver=$pkgver.post0 +pkgrel=0 +arch='noarch' +pkgdesc="Tzinfo object for the local timezone" +url="https://pypi.python.org/pypi/pytz" +license="MIT" +depends="python3" +makedepends="py3-wheel py3-installer py3-build" +source="${pkgname}-${pkgver}.tar.gz::https://pypi.io/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$_pkgver.tar.gz" +builddir="$srcdir"/$_pkgname-$_pkgver +options="!check" + +build() { + python3 -m build --wheel --no-isolation +} + +package() { + python3 -m installer --destdir="$pkgdir" dist/*.whl +} + +sha512sums=" +201eea777f4da9def1b060911da5eaa89652f6716d5608278fdc94a2f67af5ea23a8b667cb181e03d5edd7f0a07f4954047621668f4c2e7bb325dd07f454d0b6 py3-pytz-deprecation-shim-0.1.0.tar.gz +" diff --git a/user/py3-pyyaml/APKBUILD b/user/py3-pyyaml/APKBUILD new file mode 100644 index 0000000..3834c3d --- /dev/null +++ b/user/py3-pyyaml/APKBUILD @@ -0,0 +1,34 @@ +# Maintainer: Antoine Martin + +pkgname="py3-pyyaml" +_pkgname="pyyaml" +pkgver=6.0 +pkgrel=0 +arch="x86_64" +pkgdesc="PyYAML-based module to produce pretty and readable YAML-serialized data" +url="https://pypi.python.org/pypi/pyyaml" +license="BSD" +depends="python3" +makedepends="py3-setuptools libyaml cython python3-dev" +source="${pkgname}-${pkgver}.tar.gz::https://github.com/yaml/$_pkgname/archive/refs/tags/$pkgver.tar.gz" +builddir="$srcdir"/$_pkgname-$pkgver + +build() { + python3 setup.py --with-libyaml build +} + +check() { + python3 setup.py test +} + +package() { + python3 setup.py install \ + --skip-build \ + --optimize=1 \ + --prefix=/usr \ + --root="$pkgdir" +} + +sha512sums=" +cbcacc3560a035e2082867e93a9733f8660ea4c7f60573d07642f33a5453dcdc88d67299c3bcb97c27b843202a45d40de7444eb5e815bd4955129c9fc8ae04ad py3-pyyaml-6.0.tar.gz +" diff --git a/user/py3-tzdata/APKBUILD b/user/py3-tzdata/APKBUILD new file mode 100644 index 0000000..60ef183 --- /dev/null +++ b/user/py3-tzdata/APKBUILD @@ -0,0 +1,34 @@ +# Maintainer: Antoine Martin + +pkgname='py3-tzdata' +_pkgname="tzdata" +pkgver=2022.1 +_pkgver="$pkgver" +pkgrel=0 +arch='noarch' +pkgdesc="Provider of IANA time zone data" +url="https://github.com/python/tzdata" +license="Apache" +depends="python3" +makedepends="py3-build py3-installer py3-setuptools py3-wheel" +checkdepends="py3-pytest py3-pytest-subtests" +source="${pkgname}-${pkgver}.tar.gz::https://pypi.io/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$_pkgver.tar.gz" +builddir="$srcdir"/$_pkgname-$_pkgver + +build() { + python3 -m build --wheel --skip-dependency-check --no-isolation +} + +check(){ + python3 -m venv --system-site-packages test-env + test-env/bin/python -m installer dist/*.whl + test-env/bin/python -m pytest +} + +package() { + python3 -m installer --destdir="$pkgdir" dist/*.whl +} + +sha512sums=" +431c1bbc8cb7093e2bd36492d9c63496d52001422d385710c45aa95a3923fc06757a3a65ca4c7c9c44d47fd652f02cef47657747e1dc9297b4855fb825376840 py3-tzdata-2022.1.tar.gz +" diff --git a/user/py3-tzdata/APKBUILDfg b/user/py3-tzdata/APKBUILDfg new file mode 100644 index 0000000..e69de29 diff --git a/user/py3-tzlocal/APKBUILD b/user/py3-tzlocal/APKBUILD new file mode 100644 index 0000000..4955409 --- /dev/null +++ b/user/py3-tzlocal/APKBUILD @@ -0,0 +1,40 @@ +# Maintainer: Antoine Martin + +pkgname='py3-tzlocal' +pkgver=4.2 +pkgrel=0 +arch='noarch' +pkgdesc="Tzinfo object for the local timezone" +url="https://pypi.python.org/pypi/pytz" +license="MIT" +depends="python3 py3-tz py3-tzdata py3-pytz-deprecation-shim" +makedepends="py3-setuptools py3-mock" +checkdepends="py3-pytest py3-pytest-mock" +source="${pkgname}-${pkgver}.tar.gz::https://pypi.io/packages/source/t/tzlocal/tzlocal-${pkgver}.tar.gz" +options="!check" +builddir="$srcdir"/tzlocal-$pkgver + +prepare() { + ln -sfv ../usr/share/zoneinfo/Africa/Harare "$builddir"/tests/test_data/symlink_localtime/etc/localtime +} + +build() { + python3 setup.py build +} + +check(){ + export PYTHONPATH="build:${PYTHONPATH}" + pytest -v tests/test_tzlocal.py +} + +package() { + python3 setup.py install \ + --skip-build \ + --optimize=1 \ + --prefix=/usr \ + --root="$pkgdir" +} + +sha512sums=" +5d1000bd8756ca2678655dbeedcfd6ef8d709503293303c98a48af234aca0d1525913585d679759c6fd7d4c5ef046c98384ee6e7a9eba769f81d05173ff0d77f py3-tzlocal-4.2.tar.gz +" diff --git a/user/rmfakecloud/APKBUILD b/user/rmfakecloud/APKBUILD index bc88492..0a5d2a8 100644 --- a/user/rmfakecloud/APKBUILD +++ b/user/rmfakecloud/APKBUILD @@ -1,6 +1,7 @@ # Maintainer: Antoine Martin pkgname=rmfakecloud pkgver=20211128 +_gittag=5d31dc08e6e804f899b8d9fd63ca86dd4c59e880 pkgrel=0 pkgdesc="rmfakecloud is fake of the cloud sync the remarkable tablet is using" url="https://github.com/ddvk/rmfakecloud" @@ -9,12 +10,11 @@ license="AGPL3" depends="nginx" makedepends="go yarn" source=" - $pkgname-$pkgver.tar.gz::https://github.com/ddvk/rmfakecloud/archive/refs/tags/v${pkgver}.tar.gz + $pkgname-$pkgver.tar.gz::https://github.com/ddvk/rmfakecloud/archive/$_gittag.tar.gz rmfakecloud.conf rmfakecloud.nginx rmfakecloud.initd" _giturl="https://github.com/ddvk/rmfakecloud" -_gittag=5d31dc08e6e804f899b8d9fd63ca86dd4c59e880 builddir="$srcdir/$pkgname" subpackages="$pkgname-openrc" options="!check chmod-clean" @@ -54,7 +54,7 @@ package() { install -Dm700 -d "$pkgdir"/var/log/rmfakecloud } sha512sums=" -459880d53f93c5e9b07c5e021f578816d5a05d5a82d24c87682d1960f22c461c899e5d7bdc6eb9d82041f0700a3342edb28b88edd09a0945f51fe5a3cbd9a1aa rmfakecloud-20211128.tar.gz +7f2f86e5baf6c43c036f87ae874ebd465f749c7df0bf393017966d9be3513c677987fa2325eb7a68c4d2f169fa74bc74ac473f4e33a3ad597afd16b035316f1c rmfakecloud-20211128.tar.gz b9f47b7a0a640b4ec565850f77df7356daa7760ea94499f13350cabc42c2bcb5c8d64188908e46b58b0f4a929776c6f0f42b67de014267a8674fc772c6efa10d rmfakecloud.conf 463f0a922c206dabd0dc4c6e43a3b0269245aeca6b4176c894e45e476aee6466965bd50863e60f619c6829dbf765ba66e3827f5eff06046e0a911fde50ef9e97 rmfakecloud.nginx 32ee768a73a8e16b3d8097f4f5136a5ac0258f6a33ea8bff2e94ae11e658f4ee013f3149bd695d11ad2caeb54c8f82251e568f37683fcd84d5e41c51a34018e9 rmfakecloud.initd diff --git a/user/scanbd/APKBUILD b/user/scanbd/APKBUILD new file mode 100644 index 0000000..2fee49d --- /dev/null +++ b/user/scanbd/APKBUILD @@ -0,0 +1,50 @@ +# Maintainer: Antoine Martin (ayakael) +# Contributor: Antoine Martin (ayakael) + +pkgname=scanbd +pkgver=1.5.1 +pkgrel=0 +pkgdesc="Scanner button daemon looking for scanner button pressed" +arch="x86_64" +url="http://scanbd.sourceforge.net/" +license="GPL-2.0-only" +makedepends=" + sane-dev + dbus-dev + confuse-dev + " +source=" + https://downloads.sourceforge.net/scanbd/scanbd-$pkgver.tgz + string-bounds.patch + " +builddir="$srcdir/$pkgver" +subpackages="$pkgname-doc" + +prepare() { + default_prepare + sed -i 's/"saned">.*/"daemon">/' integration/scanbd_dbus.conf + sed -i 's@\(user = \)saned$@\1daemon@' conf/scanbd.conf + sed -i 's@\(group = \)lp$@\1scanner@' conf/scanbd.conf + sed -i 's@/var\(/run/scanbd.pid\)@\1@' conf/scanbd.conf + sed -i 's@\(debug-level =\)7$@\1 2@' conf/scanbd.conf + sed -i 's@\(SANE_CONFIG_DIR=\)\(/etc/scanbd\)@\1\2/sane.d@' conf/scanbd.conf +} + +build() { + ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/sbin + make +} + +package() { + make DESTDIR="$pkgdir" install + + install -Dm644 integration/scanbd_dbus.conf -t "$pkgdir/etc/dbus-1/system.d/" + install -Dm644 doc/README.txt -t "$pkgdir/usr/share/doc/$pkgname/" + install -Dm644 AUTHORS -t "$pkgdir/usr/share/doc/$pkgname/" + install -dm755 "$pkgdir/etc/scanbd/sane.d" +} + +sha512sums=" +1a20c96520184b7d7cabe997005dd48e7481d70c1ca4d9b691aa21a32cc1bed942d0ca7bd40b140e26a8dc40afe54c1bf6fcd1fa55bc3cc788af1b6ac82ad445 scanbd-1.5.1.tgz +708994fbfb953d5ad67fd6460a805a88168929f01881898be6da13d415c91a7be65211e0b84bd2c4fd2cf371ad6fb430d8d3294475cfb7442725faef21c06c4f string-bounds.patch +" diff --git a/user/scanbd/string-bounds.patch b/user/scanbd/string-bounds.patch new file mode 100644 index 0000000..cc2e72a --- /dev/null +++ b/user/scanbd/string-bounds.patch @@ -0,0 +1,140 @@ +diff --git a/src/scanbd/config.c b/src/scanbd/config.c +index 7fa9c2d..9399333 100644 +--- a/src/scanbd/config.c ++++ b/src/scanbd/config.c +@@ -102,8 +102,8 @@ void cfg_do_parse(const char *config_file_name) { + cfg = NULL; + } + +- char wd[PATH_MAX] = {}; +- char config_file[PATH_MAX] = {}; ++ char wd[PATH_MAX+1] = {}; ++ char config_file[PATH_MAX+1] = {}; + char* scanbd_conf_dir = NULL; + + // get current directory +@@ -148,7 +148,7 @@ void cfg_do_parse(const char *config_file_name) { + + char *make_script_path_abs(const char *script) { + +- char* script_abs = malloc(PATH_MAX); ++ char* script_abs = malloc(PATH_MAX+1); + assert(script_abs); + strncpy(script_abs, SCANBD_NULL_STRING, PATH_MAX); + +diff --git a/src/scanbd/dbus.c b/src/scanbd/dbus.c +index 428980c..33de735 100644 +--- a/src/scanbd/dbus.c ++++ b/src/scanbd/dbus.c +@@ -196,8 +196,8 @@ static void hook_device_ex(const char *param, const char *action_name, const cha + e += 1; + } + else { +- char buf[PATH_MAX]; +- char* ptr = getcwd(buf, PATH_MAX - 1); ++ char buf[PATH_MAX+1]; ++ char* ptr = getcwd(buf, PATH_MAX); + if (!ptr) { + slog(SLOG_ERROR, "can't get pwd"); + } +@@ -751,7 +751,7 @@ bool dbus_init(void) { + return false; + } + #else +- char match[PATH_MAX] = {}; ++ char match[PATH_MAX+1] = {}; + snprintf(match, PATH_MAX, "type='signal',interface='%s'", DBUS_HAL_INTERFACE); + slog(SLOG_ERROR, "dbus match %s", match); + dbus_bus_add_match(conn, match, &dbus_error); +diff --git a/src/scanbd/sane.c b/src/scanbd/sane.c +index b031904..48691c6 100644 +--- a/src/scanbd/sane.c ++++ b/src/scanbd/sane.c +@@ -957,8 +957,8 @@ static void* sane_poll(void* arg) { + e += 1; + } + else { +- char buf[PATH_MAX]; +- char* ptr = getcwd(buf, PATH_MAX - 1); ++ char buf[PATH_MAX+1]; ++ char* ptr = getcwd(buf, PATH_MAX); + if (!ptr) { + slog(SLOG_ERROR, "can't get pwd"); + } +diff --git a/src/scanbd/scanbd.c b/src/scanbd/scanbd.c +index feb73ae..3c8902c 100644 +--- a/src/scanbd/scanbd.c ++++ b/src/scanbd/scanbd.c +@@ -350,7 +350,7 @@ int main(int argc, char** argv) { + } + + // We do this here as debugging is only completely initialized here +- char prog_path[PATH_MAX] = ""; ++ char prog_path[PATH_MAX+1] = ""; + strncpy(prog_path, argv[0], PATH_MAX); + char *my_name = basename(prog_path); + if ( strncmp(my_name, NAME_MANAGER_MODE, PATH_MAX) == 0 ) { +diff --git a/src/scanbd/scanbuttond_loader.c b/src/scanbd/scanbuttond_loader.c +index 857834a..06b13f6 100644 +--- a/src/scanbd/scanbuttond_loader.c ++++ b/src/scanbd/scanbuttond_loader.c +@@ -29,11 +29,11 @@ + // this file is basicly the same as loader.c from the scanbuttond-project, + // but modified to meet the needs of scanbd + +-static char lib_dir[PATH_MAX] = SCANBD_NULL_STRING; ++static char lib_dir[PATH_MAX+1] = SCANBD_NULL_STRING; + + int scanbtnd_init() { + char *backends_dir = NULL; +- char backends_dir_abs[PATH_MAX] = SCANBD_NULL_STRING; ++ char backends_dir_abs[PATH_MAX+1] = SCANBD_NULL_STRING; + + backends_dir = cfg_getstr(cfg_getsec(cfg, C_GLOBAL), C_SCANBUTTONS_BACKENDS_DIR); + if ( backends_dir && (backends_dir[0] != '/')) { +@@ -83,7 +83,7 @@ backend_t* scanbtnd_load_backend(const char* filename){ + const char* error; + void* dll_handle; + +- char dll_path[PATH_MAX]; ++ char dll_path[PATH_MAX+1]; + strncpy(dll_path, lib_dir, PATH_MAX); + strncat(dll_path, "/", PATH_MAX - strlen(dll_path)); + strncat(dll_path, filename, PATH_MAX - strlen(dll_path)); +diff --git a/src/scanbd/scanbuttond_wrapper.c b/src/scanbd/scanbuttond_wrapper.c +index 02b7162..6bbb289 100644 +--- a/src/scanbd/scanbuttond_wrapper.c ++++ b/src/scanbd/scanbuttond_wrapper.c +@@ -605,8 +605,8 @@ void* scbtn_poll(void* arg) { + e += 1; + } + else { +- char buf[PATH_MAX]; +- char* ptr = getcwd(buf, PATH_MAX - 1); ++ char buf[PATH_MAX+1]; ++ char* ptr = getcwd(buf, PATH_MAX); + if (!ptr) { + slog(SLOG_ERROR, "can't get pwd"); + } +diff --git a/src/scanbd/slog.c b/src/scanbd/slog.c +index 09fe1de..17b04a3 100644 +--- a/src/scanbd/slog.c ++++ b/src/scanbd/slog.c +@@ -26,7 +26,7 @@ + bool debug = false; + unsigned int debug_level = 0; + +-static char lpre[LINE_MAX] = ""; ++static char lpre[LINE_MAX+1] = ""; + static int isInitialized = 0; + + void slog_init(const char *string) { +@@ -37,7 +37,7 @@ void slog_init(const char *string) { + void + slog(unsigned int level, const char *format, ...) { + va_list ap; +- char buffer[LINE_MAX] = ""; ++ char buffer[LINE_MAX+1] = ""; + + if (isInitialized == 0) { + slog_init(""); diff --git a/user/scanservjs/APKBUILD b/user/scanservjs/APKBUILD new file mode 100644 index 0000000..65e4e13 --- /dev/null +++ b/user/scanservjs/APKBUILD @@ -0,0 +1,64 @@ +# Maintainer: Antoine Martin (ayakael) +# Contributor: Antoine Martin (ayakael) + +pkgname=scanservjs +pkgver=2.21.0 +pkgrel=1 +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" +options="!check" + +source=" + $pkgname-$pkgver.tar.gz::https://github.com/sbs20/scanservjs/archive/refs/tags/v$pkgver.tar.gz + scanservjs.initd + scanservjs.conf +" + +build() { + npm run install + npm run build + + cd dist + npm install --production +} + +package() { + # install documentation + 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 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 + + 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 644 "$srcdir"/scanservjs.conf "$pkgdir"/etc/conf.d/scanservjs +} +sha512sums=" +1ee256bc6c38ccf1fcf196926f7fdbff6ff8d7e800a414ee5d45ad3b430c3f9055856d96181520b2f24e2d067f5ffc49fb7fd543fff8d0352517d1b7ccd12fd2 scanservjs-2.21.0.tar.gz +f58dd5e1c4936d7e25065a295f5d01e64189cdefe92ba54fc875348a59a30b2055c93464d510a52820e66b42a69d0626d3513c93ab60b0768e1e8d5b3538bb13 scanservjs.initd +9d4fdab3803a598c729bf703369d8594b383163b05045f31e516f184a87d8deef8c8b40942d324e04bdf751ac9d63f7de25b13364f9f30888eba2af873369b36 scanservjs.conf +" diff --git a/user/scanservjs/scanservjs.conf b/user/scanservjs/scanservjs.conf new file mode 100644 index 0000000..5fc8b03 --- /dev/null +++ b/user/scanservjs/scanservjs.conf @@ -0,0 +1,2 @@ +SCANSERVJS_USER=scanservjs +SCANSERVJS_GROUP=scanservjs diff --git a/user/scanservjs/scanservjs.initd b/user/scanservjs/scanservjs.initd new file mode 100644 index 0000000..99cbf97 --- /dev/null +++ b/user/scanservjs/scanservjs.initd @@ -0,0 +1,21 @@ +#!/sbin/openrc-run +name="$RC_SVCNAME" +cfgfile="/etc/conf.d/$RC_SVCNAME" +pidfile="/var/run/$RC_SVCNAME.pid" +command="/usr/share/webapps/scanservjs/server/server.js" +command_args="" +command_user="$SCANSERVJS_USER" +command_group="$SCANSERVJS_GROUP" +supervisor="supervise-daemon" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.log" +error_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.err" +working_directory="/usr/share/webapps/scanservjs" + +start_pre() { + checkpath --directory --owner $command_user:$command_user --mode 0775 \ + /var/log/$RC_SVCNAME + export NODE_ENV=production + cd "$working_directory" +} diff --git a/user/scantopl/0001-change-prefix-to-scan.patch b/user/scantopl/0001-change-prefix-to-scan.patch new file mode 100644 index 0000000..fd80c3e --- /dev/null +++ b/user/scantopl/0001-change-prefix-to-scan.patch @@ -0,0 +1,34 @@ +From e2e14ba3ee95315ec1fa8ffeea693349ae120deb Mon Sep 17 00:00:00 2001 +From: "build@apk-groulx" +Date: Sun, 31 Jul 2022 16:43:19 +0000 +Subject: [PATCH 1/1] change-prefix-to-scan + +--- + scantopl.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scantopl.go b/scantopl.go +index e19ac9f..20bc6c7 100644 +--- a/scantopl.go ++++ b/scantopl.go +@@ -20,7 +20,7 @@ func FilenameWithoutExtension(fn string) string { + } + + func TitleFromFileName(fn string) string { +- return strings.TrimPrefix(FilenameWithoutExtension(fn), "pl_") ++ return strings.TrimPrefix(FilenameWithoutExtension(fn), "scan_") + } + + func createForm(form map[string]string) (string, io.Reader, error) { +@@ -101,7 +101,7 @@ func main() { + return + } + //log.Println("event:", event) +- if event.Op&fsnotify.Create == fsnotify.Create && strings.HasPrefix(path.Base(event.Name), "pl_") { ++ if event.Op&fsnotify.Create == fsnotify.Create && strings.HasPrefix(path.Base(event.Name), "scan_") { + //little pause to ensure the write operation is finished + time.Sleep(1 * time.Second) + log.Info("New file to upload:", event.Name) +-- +2.36.2 + diff --git a/user/scantopl/APKBUILD b/user/scantopl/APKBUILD new file mode 100644 index 0000000..4160552 --- /dev/null +++ b/user/scantopl/APKBUILD @@ -0,0 +1,39 @@ +# Maintainer: Antoine Martin (ayakael) +# Contributor: Antoine Martin (ayakael) + +pkgname=scantopl +pkgver=0.0.1 +_gittag="5c5d71a9e1cf8985d374453c866c1711692334e2" +pkgrel=1 +pkgdesc="Automatically send scanservjs scanned document to paperless-ng" +url="https://github.com/Celedhrim/scantopl" +arch="x86_64" +license="none" +makedepends="go yarn" +subpackages="$pkgname-openrc" +source=" + $pkgname-$pkgver.tar.gz::https://github.com/Celedhrim/scantopl/archive/$_gittag.tar.gz + 0001-change-prefix-to-scan.patch + scantopl.initd + scantopl.conf + " +builddir="$srcdir/$pkgname-$_gittag" +options="!check" + +build() { + export GOPATH="$srcdir/go" + go build scantopl.go + go clean -modcache +} + +package() { + install -Dm755 "$builddir"/scantopl "$pkgdir"/usr/bin/scantopl + install -Dm755 "$srcdir"/scantopl.initd "$pkgdir"/etc/init.d/scantopl + install -Dm644 "$srcdir"/scantopl.conf "$pkgdir"/etc/conf.d/scantopl +} +sha512sums=" +f47823ffdea68de71ce9f3a347f31eee3556aae2087f68d2cf4078b9694894d06fc8de94e806ad34358e0ec636ace6dc5d97273c3102192584cb540ede3bd288 scantopl-0.0.1.tar.gz +5047906abc17e93eca5ed62d2fa341be097693aa7b4426650ad00d9d0a67afbc3b0bdf38610d58eef26e7e2644a3c784b433245ef425e2a5ca81b8def45a3445 0001-change-prefix-to-scan.patch +8238411fe8881be6690a583a6bfc71e52f3131320f5d92bb36f8af61802980265a8cf5250eb699d9214f7c6c168d14c39867a09587fb07841a8504a6a28db74b scantopl.initd +ee2e631901b1d88c0dede6587318e44884255a7c82e090371f017dbb91563c16f0567c0d45b3183d0a8abb3ee4b71a33f3d79258ad2b2f6d8930a5bc7625070a scantopl.conf +" diff --git a/user/scantopl/scantopl b/user/scantopl/scantopl new file mode 160000 index 0000000..e2e14ba --- /dev/null +++ b/user/scantopl/scantopl @@ -0,0 +1 @@ +Subproject commit e2e14ba3ee95315ec1fa8ffeea693349ae120deb diff --git a/user/scantopl/scantopl.conf b/user/scantopl/scantopl.conf new file mode 100644 index 0000000..a35c152 --- /dev/null +++ b/user/scantopl/scantopl.conf @@ -0,0 +1,7 @@ +# /etc/conf.d/scantopl: config file for /etc/init.d/scantopl + +SCANTOPL_PLTOKEN="" +SCANTOPL_PLURL="" +SCANTOPL_SCANDIR="" +SCANTOPL_USER="" +SCANTOPL_GROUP="" diff --git a/user/scantopl/scantopl.initd b/user/scantopl/scantopl.initd new file mode 100644 index 0000000..2b5e3cf --- /dev/null +++ b/user/scantopl/scantopl.initd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run + +name=$RC_SVCNAME +cfgfile="/etc/conf.d/$RC_SVCNAME.conf" +pidfile="/var/run/$RC_SVCNAME.pid" +supervisor="supervise-daemon" +command="/usr/bin/scantopl" +command_args="-pltoken $SCANTOPL_PLTOKEN -plurl $SCANTOPL_PLURL -scandir $SCANTOPL_SCANDIR ${SCANTOPL_EXTRAOPTS}" +command_user="$SCANTOPL_USER" +command_group="$SCANTOPL_GROUP" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.log" +error_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.err" + +depend() { + after saned +} + +start_pre() { + checkpath --directory --owner $command_user:$command_group --mode 0775 \ + /var/run/$RC_SVCNAME \ + /var/log/$RC_SVCNAME +} diff --git a/user/xinetd/APKBUILD b/user/xinetd/APKBUILD new file mode 100644 index 0000000..953c443 --- /dev/null +++ b/user/xinetd/APKBUILD @@ -0,0 +1,40 @@ +# Maintainer: Tobias Powalowski +# Contributor: Judd + +pkgname=xinetd +pkgver=2.3.15.4 +pkgrel=0 +pkgdesc="A secure replacement for inetd" +arch="x86_64" +url="https://github.com/openSUSE/xinetd" +license="custom" +makedepends="libtirpc-dev" +subpackages="$pkgname-doc" +source=" + https://github.com/openSUSE/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.xz + xinetd.conf + servers + services + " + +build() { + ./configure --prefix=/usr --sbindir=/usr/bin --sysconfdir=/etc --without-libwrap + CFLAGS="$CFLAGS -I/usr/include/tirpc" LDFLAGS="$LDFLAGS -ltirpc" make +} + +package() { + make prefix="$pkgdir/usr" sbindir="$pkgdir/usr/bin" sysconfdir="$pkgdir/etc" install + + install -Dm644 "$srcdir"/xinetd.conf "$pkgdir"/etc/xinetd.conf + install -Dm644 "$srcdir"/servers "$pkgdir"/etc/xinetd.d/servers + install -Dm644 "$srcdir"/services "$pkgdir"/etc/xinetd.d/services + + # install license + install -Dm644 COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/COPYRIGHT +} +sha512sums=" +1d9bbf5f60b299746adf3e57a669bf1a554b50066563b65cdb7584f00dcab2d3d331df705eefb56b51c52a16b5ed6b109cd832c27df87c7f262bb304e17ddc0e xinetd-2.3.15.4.tar.xz +c54e870db56570a7373a0e815148656198f9bd3f14bb4ab40af3bd3c7539dfacb6ff7f917a3df5788eba9b4a96a07fb4d7a6f4e4ea89945686e761a19bbc2008 xinetd.conf +d5e321e084f74e27f619c911ded29ec4faab5aa754d289af42db31bfac1fe347655e59ccb2812d42e36bccbb306d7d3e974ea3dfd90363505458bc9357298404 servers +da41af51bf8958814044b0961fec2c24959a4f2583a804a4e8f26aaef466248f5b554e0ea62bf4e7a8a0b7ae214cdd7767c99529464956f5c5cd0fbe82183daa services +" diff --git a/user/xinetd/servers b/user/xinetd/servers new file mode 100644 index 0000000..f064c8d --- /dev/null +++ b/user/xinetd/servers @@ -0,0 +1,10 @@ +service servers +{ + type = INTERNAL UNLISTED + port = 9099 + socket_type = stream + protocol = tcp + wait = no + disable = yes + only_from = 127.0.0.1 +} diff --git a/user/xinetd/services b/user/xinetd/services new file mode 100644 index 0000000..4ea304c --- /dev/null +++ b/user/xinetd/services @@ -0,0 +1,10 @@ +service services +{ + type = INTERNAL UNLISTED + port = 9098 + socket_type = stream + protocol = tcp + wait = no + disable = yes + only_from = 127.0.0.1 +} diff --git a/user/xinetd/xinetd.conf b/user/xinetd/xinetd.conf new file mode 100644 index 0000000..b15d9f6 --- /dev/null +++ b/user/xinetd/xinetd.conf @@ -0,0 +1,14 @@ +# +# /etc/xinetd.conf +# + +defaults +{ + instances = 60 + log_type = SYSLOG authpriv + log_on_success = HOST PID + log_on_failure = HOST + cps = 25 30 +} + +includedir /etc/xinetd.d