blob: 5146db9085d9a0a54def6be3dae81ba01903e6c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
# Maintainer: AlphaJack <alphajack at tuta dot io>
# Maintainer: amo <https://aur.archlinux.org/account/amo>
pkgname="paperless-ngx"
pkgver=1.7.1
pkgrel=3
pkgdesc="A supercharged version of paperless: scan, index and archive all your physical documents"
url="https://github.com/paperless-ngx/paperless-ngx"
license=("GPL3")
arch=("any")
provides=("paperless" "$pkgname")
conflicts=("paperless" "paperless-ng")
depends=("file"
"gnupg"
"gunicorn"
"imagemagick"
"mailcap"
"ocrmypdf"
"optipng"
"redis"
"sqlite"
"tesseract-data-eng"
"ttf-liberation"
"uvicorn"
"python-aiohttp"
"python-aioredis1" # until components have been updated
"python-arrow"
"python-asgiref"
"python-async-timeout"
"python-attrs"
"python-autobahn"
"python-automat"
"python-blessed"
"python-certifi"
"python-django-channels"
"python-django-channels-redis"
"python-chardet"
"python-click"
"python-concurrent-log-handler"
"python-constantly"
"python-cryptography"
"python-daphne"
"python-dateparser"
"python-django"
"python-django-cors-headers"
"python-django-extensions"
"python-django-filter"
"python-django-picklefield"
"python-django-q"
"python-django-rest-framework"
"python-filelock"
"python-fuzzywuzzy"
"python-h11"
"python-hiredis"
"python-httptools"
"python-humanfriendly"
"python-hyperlink"
"python-idna"
"python-imap-tools"
"python-incremental"
"python-inotify-simple"
"python-inotifyrecursive"
"python-joblib"
"python-langdetect"
"python-lxml"
"python-msgpack"
"python-numpy"
"python-pathvalidate"
"python-pdf2image"
"python-portalocker"
"python-psycopg2"
"python-pyasn1"
"python-pyasn1-modules"
"python-pycparser"
"python-pyopenssl"
"python-dateutil"
"python-dotenv"
"python-gnupg"
"python-levenshtein"
"python-magic"
"python-pytz"
"python-yaml"
"python-redis"
"python-regex"
"python-requests"
"python-scikit-learn"
"python-scipy"
"python-service-identity"
"python-six"
"python-sortedcontainers"
"python-sqlparse"
"python-threadpoolctl"
"python-tika"
"python-twisted"
"python-txaio"
"python-tzlocal"
"python-urllib3"
"python-uvloop"
"python-watchdog"
"python-watchgod"
"python-wcwidth"
"python-websockets"
"python-whitenoise"
"python-whoosh"
"python-zope-interface"
"pyzbar")
optdepends=("jbig2enc: smaller PDF size"
"postgresql: postgres database")
source=("$url/releases/download/v$pkgver/$pkgname-v$pkgver.tar.xz"
"paperless.hook"
"paperless.sysusers"
"paperless.tmpfiles"
"paperless.target"
"paperless-consumer.service"
"paperless-scheduler.service"
"paperless-webserver.service")
sha256sums=('f2fc7886f6c8a9a0a18cfc92f10d1aaf66f3fe92f311dc6817b3f680111e1737'
'4e2ca67d7eedf14ba839af852907e1d76aa0a5ee5f4f740a3aee786c24035ace'
'a002bd55b8e5b1ef89a10b907483c56df99d52d03951d464472d8c375e9835d6'
'3971deb5721eb4e01c2cc0348546cc22a861a1e84458061fce4fbd2cf01b2a1e'
'091dc2406139bcc52ca1f9acdb4e20723f4511b8ce6849e37c5ab88784dbac12'
'95d4e665f66f63432c22d9f139769f84575cb427362865931253d9651779ec22'
'544821a278617c6493e7a27f25266c39d6cc10a877247fa5f807c7eaf1a460cd'
'47e47fcadf029d85fa6304191afa6362b7675216cb82ed1bad8cce42c0378e7e')
backup=("etc/paperless.conf")
options=("!strip")
install="paperless.install"
prepare(){
# use arch linux canonical paths
sed -i "$pkgname/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/paperless/static|" \
-e "s|#PAPERLESS_CONVERT_TMPDIR=/var/tmp/paperless|PAPERLESS_CONVERT_TMPDIR=/var/lib/paperless/tmp|"
# remove hardcoded bind address
sed -i "$pkgname/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" >> "$pkgname/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'" >> "$pkgname/paperless.conf"
}
package(){
# program files
install -d "$pkgdir/usr/share/paperless" "$pkgdir/usr/bin"
cp -R "$pkgname"/* "$pkgdir/usr/share/paperless"
# main executable
chmod 755 "$pkgdir/usr/share/paperless/src/manage.py"
ln -s "/usr/share/paperless/src/manage.py" "$pkgdir/usr/bin/paperless-manage"
# config file
install -D -m 640 "$pkgname/paperless.conf" "$pkgdir/etc/paperless.conf"
rm "$pkgdir/usr/share/paperless/paperless.conf"
ln -s "/etc/paperless.conf" "$pkgdir/usr/share/paperless/paperless.conf"
# optional pacman hook
install -D -m 644 "paperless.hook" "$pkgdir/usr/share/paperless/docs/paperless.hook"
# user and files to create, ownership and permission to set
install -D -m 644 "paperless.sysusers" "$pkgdir/usr/lib/sysusers.d/paperless.conf"
install -D -m 644 "paperless.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/paperless.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"
}
|