ayaports/user/paperless-ng/APKBUILD
build@apk-groulx f77e3588dc user/insaned: new aport
user/lua-aports: upgrade
user/paperless-ng: upgrade + openrc
user/paperless-ngx: new aport
user/py3-anyio: new aport
user/py3-dateparser: upgrade
user/py3-pdf2image: new aport
user/py3-pyaml: new aport
user/py3-pytz: new aport
user/py3-pyyaml: new aport
user/py3-tzdata: new aport
user/py3-tzlocal: new aport
user/rmfakecloud: upgrade
user/scanbd: new aport
user/scantopl: new aport
user/xinetd: new aport
2022-08-15 15:51:38 +00:00

166 lines
4.4 KiB
Text

# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
#
# Based on ArchLinux AUR by:
# Co-Maintainer: AlphaJack <alphajack at tuta dot io>
# Co-Maintainer: amo <https://aur.archlinux.org/account/amo>
pkgname="paperless-ng"
pkgver=1.5.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="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
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(){
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="
3fed4eb647520ddc55fb7b570c59379dba26a3ba288b86dda096c143873debf82882e78324aada7c723c7932404b2068442be48a535bb962c4563d8a187e95d7 paperless-ng-1.5.0.tar.xz
8ec29db4fd45c9796076647b6e1f3eee03d378054048f1edc494ac52843b44d61ef0ea6d4cf271df0029eda78d06bef950a706c52db0f234443b336684219d75 paperless-scheduler.openrc
471113b44904a4e6bdd0724a10d3a35e28431ca9e7a60a3c70bf5a30e6de8e70533c55c47616727d9e32910bc5d0a2291582e83531ce555b77c53e0e67b6f3d4 paperless-consumer.openrc
c4813811cf9dbe05af5ddfe2e0ee15022bb89c3dadb66cfb8c0557d55fa8eca68b52071757805b02f8ee28059e544dec6113231ba5b310887443d44321f10106 paperless-webserver.openrc
"