forked from merll/pgadmin4-nw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKGBUILD
147 lines (135 loc) · 5.53 KB
/
PKGBUILD
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
# Maintainer: Matthias Erll <[email protected]>
pkgname=pgadmin4-nw
pkgver=7.2
pkgrel=1
pkgdesc='Comprehensive design and management interface for PostgreSQL'
url='https://www.pgadmin.org/'
arch=('x86_64')
license=('custom')
depends=('postgresql-libs' 'hicolor-icon-theme' 'python'
'libxcrypt' 'glibc' 'gcc-libs'
'python-flask' 'python-flask-gravatar' 'python-flask-login'
'python-flask-mail' 'python-flask-migrate' 'python-flask-sqlalchemy'
'python-flask-wtf' 'python-flask-compress' 'python-flask-paranoid'
'python-flask-babel' 'python-flask-security-too' 'python-flask-socketio'
'python-wtforms' 'python-passlib' 'python-pytz' 'python-simplejson'
'python-speaklater' 'python-sqlparse' 'python-psutil' 'python-keyring'
'python-psycopg' 'python-dateutil' 'python-sqlalchemy' 'python-bcrypt'
'python-cryptography' 'python-sshtunnel' 'python-ldap3' 'python-gssapi'
'python-eventlet' 'python-httpagentparser' 'python-user-agents'
'python-authlib' 'python-requests' 'python-pyotp' 'python-qrcode'
'python-pillow' 'python-boto3' 'python-botocore' 'python-urllib3'
'python-google-api-python-client' 'python-google-auth-oauthlib'
'python-azure-mgmt-subscription' 'python-azure-identity'
'python-azure-mgmt-rdbms' 'python-azure-mgmt-resource'
'python-greenlet' 'python-sphinxcontrib-youtube' 'python-ua-parser'
'nwjs-bin')
makedepends=('python-setuptools' 'python-sphinx' 'yarn')
provides=('pgadmin4=7.1')
conflicts=('pgadmin4')
source=(https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v${pkgver}/source/pgadmin4-${pkgver}.tar.gz{,.asc}
pgAdmin4.desktop)
validpgpkeys=('E8697E2EEF76C02D3A6332778881B2A8210976F2') # Package Manager (Package Signing Key) <[email protected]>
sha512sums=('705d5fdb3031b2964da09115c26ab5a2021ea3415a1d0d422ca75cc354df9a5966b95b5e3532f9987df6cb6ba136a48048bf4e23b65669430c4f3e47c57518a3'
'SKIP'
'd061d074419b78ed96600329c622334310ca8fdef4b7c68d2594eb322ba814e21f4ce54daa8a27f3ce48a643c72feb342f7258eba52db6f915dff6a73bdba7da')
prepare() {
cd pgadmin4-${pkgver}
sed -E -i requirements.txt \
-e '/Flask>?=/d' \
-e '/Flask-Gravatar>?=/d' \
-e '/Flask-Login>?=/d' \
-e '/Flask-Mail>?=/d' \
-e '/Flask-Migrate>?=/d' \
-e '/Flask-SQLAlchemy>?=/d' \
-e '/Flask-WTF>?=/d' \
-e '/Flask-Compress>?=/d' \
-e '/Flask-Paranoid>?=/d' \
-e '/Flask-Babel>?=/d' \
-e '/Flask-Security-Too>?=/d' \
-e '/Flask-SocketIO>?=/d' \
-e '/WTForms>?=/d' \
-e '/passlib>?=/d' \
-e '/pytz>?=/d' \
-e '/simplejson>?=/d' \
-e '/speaklater3>?=/d' \
-e '/sqlparse>?=/d' \
-e '/psutil>?=/d' \
-e '/keyring>?=/d' \
-e '/psycopg\[c\]>?=/d' \
-e '/python-dateutil>?=/d' \
-e '/SQLAlchemy>?=/d' \
-e '/bcrypt>?=/d' \
-e '/cryptography>?=/d' \
-e '/sshtunnel>?=/d' \
-e '/ldap3>?=/d' \
-e '/gssapi>?=/d' \
-e '/eventlet>?=/d' \
-e '/httpagentparser>?=/d' \
-e '/user-agents>?=/d' \
-e '/pywinpty>?=/d' \
-e '/Authlib>?=/d' \
-e '/requests>?=/d' \
-e '/pyotp>?=/d' \
-e '/qrcode>?=/d' \
-e '/Pillow>?=/d' \
-e '/boto3>?=/d' \
-e '/botocore>?=/d' \
-e '/urllib3>?=/d' \
-e '/Werkzeug>?=/d' \
-e '/azure-mgmt-rdbms>?=/d' \
-e '/azure-mgmt-resource>?=/d' \
-e '/azure-mgmt-subscription>?=/d' \
-e '/azure-identity>?=/d' \
-e '/google-api-python-client>?=/d' \
-e '/google-auth-oauthlib>?=/d' \
-e '/greenlet>?=/d' \
-e '/^#.*/d' \
-e '/^$/d'
if [[ -s requirements.txt ]]; then
echo "ERROR: requirements.txt must be empty:"
cat requirements.txt
exit 1
fi
}
build() {
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export PGADMIN_PYTHON_DIR=/usr
cd pgadmin4-${pkgver}
# override doctree directory
make docs SPHINXOPTS='-d /tmp/'
export CFLAGS+=" ${CPPFLAGS}"
export CXXFLAGS+=" ${CPPFLAGS}"
make runtime
cd runtime && yarn install --production=true && cd ..
make install-node
make bundle
# Replace path references to virtual environment
sed -E "s|../venv/bin/python3|/usr/bin/python3|g" -i runtime/src/js/misc.js
# Remove cached files that contain references to src directory
find . -type d -name __pycache__ -exec rm -R '{}' +
# Remove additional dev and build files
rm -R web/node_modules
rm -R web/regression
find web/pgadmin -type d -name "tests" -exec rm -R '{}' +
rm web/pgadmin/messages.pot
find web/pgadmin/translations -type f -name "messages.po" -delete
}
package() {
cd pgadmin4-${pkgver}
install -Dm 755 -d "${pkgdir}/usr/lib/pgadmin4/runtime"
cp -a runtime/{assets,node_modules,src,package.json} "${pkgdir}/usr/lib/pgadmin4/runtime"
cp -a docs web "${pkgdir}/usr/lib/pgadmin4"
install -Dm 644 pkg/linux/pgadmin4-128x128.png "${pkgdir}/usr/share/icons/hicolor/128x128/apps/pgAdmin4.png"
install -Dm 644 pkg/linux/pgadmin4-64x64.png "${pkgdir}/usr/share/icons/hicolor/64x64/apps/pgAdmin4.png"
install -Dm 644 pkg/linux/pgadmin4-48x48.png "${pkgdir}/usr/share/icons/hicolor/48x48/apps/pgAdmin4.png"
install -Dm 644 pkg/linux/pgadmin4-32x32.png "${pkgdir}/usr/share/icons/hicolor/32x32/apps/pgAdmin4.png"
install -Dm 644 pkg/linux/pgadmin4-16x16.png "${pkgdir}/usr/share/icons/hicolor/16x16/apps/pgAdmin4.png"
install -Dm 644 "${srcdir}/pgAdmin4.desktop" -t "${pkgdir}/usr/share/applications"
install -D /dev/stdin "${pkgdir}/usr/bin/pgadmin4" <<END
#!/bin/sh
exec /usr/bin/nw /usr/lib/pgadmin4/runtime/ "\$@"
END
install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgbasename}"
}