ayaports/user/paperless-ngx/APKBUILD

189 lines
5.5 KiB
Text
Raw Normal View History

# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
2023-01-10 19:12:28 +00:00
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
2023-01-10 19:12:28 +00:00
pkgname=paperless-ngx
2023-11-27 19:36:19 +00:00
pkgver=1.17.4
pkgrel=0
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"
2023-01-10 19:12:28 +00:00
# s390x: ocrmypdf py3-joblib py3-scikit-learn py3-watchfiles
# armhf / ppc64le: py3-uvloop
2023-11-27 19:36:19 +00:00
arch="noarch !s390x !armhf !ppc64le"
2023-06-14 02:12:39 +00:00
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-install"
depends="
file
gnupg
imagemagick
mailcap
ocrmypdf
optipng
redis
sqlite
tesseract-ocr
tesseract-ocr-data-osd
ttf-liberation
uvicorn
py3-aiohttp
py3-anyio
py3-arrow
py3-asgiref
py3-async-timeout
py3-attrs
py3-autobahn
py3-automat
py3-blessed
py3-certifi
2023-06-14 02:12:39 +00:00
py3-celery
py3-chardet
py3-charset-normalizer
py3-click
py3-concurrent-log-handler
py3-constantly
py3-cryptography
py3-daphne
2023-06-14 02:12:39 +00:00
py3-dateparser
py3-deprecation
py3-django-allauth
py3-django-channels
py3-django-channels-redis
py3-django-compression-middleware
py3-django-celery-results
py3-django-cors-headers
py3-django-extensions
py3-django-filter
py3-django-guardian
py3-django-picklefield
py3-django-q
py3-django-rest-framework
2023-07-08 01:30:02 +00:00
py3-django-rest-framework-guardian
py3-filelock
py3-fuzzywuzzy
2023-06-14 02:12:39 +00:00
py3-gunicorn
py3-h11
py3-hiredis
2023-01-10 19:12:28 +00:00
py3-httptools
py3-humanfriendly
py3-hyperlink
py3-idna
py3-imap-tools
py3-incremental
py3-inotify-simple
py3-inotifyrecursive
2023-06-14 02:12:39 +00:00
py3-ipware
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-watchfiles
py3-wcwidth
py3-websockets
py3-whitenoise
py3-whoosh
py3-yaml
py3-zope-interface
2023-06-14 02:12:39 +00:00
py3-zstandard
postgresql
jbig2enc
"
builddir="$srcdir"/$pkgname
source="
$url/releases/download/v$pkgver/$pkgname-v$pkgver.tar.xz
1746_add-OpenID-Connect-SSO-support-via-django-allauth.patch
paperless-scheduler.openrc
paperless-consumer.openrc
paperless-webserver.openrc
2023-06-14 02:12:39 +00:00
paperless-task-queue.openrc
2023-04-01 16:03:40 +00:00
paperless.conf
"
2023-01-10 19:12:28 +00:00
options="!strip !check" # No testsuite
subpackages="$pkgname-openrc"
2023-01-10 19:12:28 +00:00
prepare() {
default_prepare
# use alpine linux canonical paths
2023-04-01 16:03:40 +00:00
sed -i "$srcdir"/paperless.conf \
2023-01-10 19:12:28 +00:00
-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"
}
2023-01-10 19:12:28 +00:00
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
2023-04-01 16:03:40 +00:00
install -D -m 640 "$srcdir"/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
2023-06-14 02:12:39 +00:00
install -Dm 755 "$srcdir"/paperless-task-queue.openrc "$pkgdir"/etc/init.d/paperless-task-queue
}
sha512sums="
2023-11-27 19:36:19 +00:00
eb225244d51db0ba0db9fca259825ab542448f5f9904d2bf55ad581f16a9386696457593df2ad5eda6df5eefb296f0ee0c0f27e6fc0eff8956807aedf20e0094 paperless-ngx-v1.17.4.tar.xz
71526db0d48f26168005de06a91f6099c318c6622b70d7af32a899a2e485b34876e94fe14d7434367232d80fbbf8c4d75281874283ab832fd8568dfea3b87bdf 1746_add-OpenID-Connect-SSO-support-via-django-allauth.patch
2023-06-14 02:12:39 +00:00
b782dd9479d31d2f6a82e86639bb5e2bb3675c1ffc1d6b08e027e10159dd58ed9f68b5986b9d7c8a326e95384e701bcf9834101d6a6720db7e97465e4d295d36 paperless-scheduler.openrc
b4413f48b481d53b3e10542f5ffe830928c40ae016e2dc1da533ae8b546c5b6e4ddfa1129280807f866002f61b283c4eba327be6eb04171e259fe27fec47696a paperless-consumer.openrc
e9c517f7fbae269072506316711a12a6ba5568456348305972caf023020de5ebeab45401371fe114fe8dbddfacbcc6cfd01d0fad2b2ade6ee3883f46120b904e paperless-webserver.openrc
2023-06-14 02:12:39 +00:00
fb51af7c4765121f7e97add4da31352e02c3888ffe5575b26c11d6dd043e0d9e7504e9ed35ccc81e3751a41ffb6fcf6dcddd22da9df25021d903494c7340105b paperless-task-queue.openrc
2023-04-01 16:03:40 +00:00
8dd13bf9d63ca838285978e9dc1635dc45d21ae0cbb3f1ce402097f566cc1f74bce6635f1324714aacf85c6a20bc61bab76deb04081813ac207fffd421f8ee8f paperless.conf
"