pkgname=pgadmin4 pkgver=1.4 pkgrel=1 _name=pgAdmin4 pkgdesc="Comprehensive design and management interface for PostgreSQL" arch=('x86_64') url="https://www.pgadmin.org/" license=('custom') depends=('qt5-webengine' 'python3' 'postgresql-libs' 'hicolor-icon-theme') makedepends=('python3-setuptools' 'python3-sphinx' 'python3-pip' 'imagemagick') source=("https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v$pkgver/source/$pkgname-$pkgver.tar.gz" "pgadmin4.desktop") sha256sums=('069d1e40a86d192ec518738ed320587aed068900c584c7f11456c190ae63b00e' '763ed68d27b335292c62521268e9b5791584bc32892316453fa5409cb19f1286') prepare() { cd $pkgname-$pkgver convert runtime/pgAdmin4.{ico,png} } build() { msg2 "building runtime" cd $pkgname-$pkgver/runtime export PYTHON_CONFIG=/usr/bin/python3-config qmake-qt5 CONFIG+=release make msg2 "building python deps" cd $srcdir/$pkgname-$pkgver mkdir -p python pip3 install --target="$srcdir/$pkgname-$pkgver/python" -r requirements.txt msg2 "building docs" # using python3 sed -i s!"python"!"python3"! docs/en_US/Makefile.sphinx PYTHONPATH="$srcdir/$pkgname-$pkgver/python:$PYTHONPATH" make docs } package() { msg2 "installing python deps" cd $srcdir/$pkgname-$pkgver install -d ${pkgdir}/usr/lib/$pkgname/modules/site-packages cp -dr python/* ${pkgdir}/usr/lib/$pkgname/modules/site-packages msg2 "installing runtime" cd $srcdir/$pkgname-$pkgver install -D runtime/pgAdmin4 ${pkgdir}/usr/lib/$pkgname/runtime/$pkgname install -d ${pkgdir}/usr/bin msg2 "installing other stuff" cp -a docs web ${pkgdir}/usr/lib/$pkgname msg2 "installing configuration stuff" # tell pgadmin we want use desktop mode cat >>"${pkgdir}/usr/lib/$pkgname/web/config_local.py" <>"${pkgdir}/usr/lib/pgadmin4/web/config_distro.py" < "${srcdir}/$pkgname-$pkgver/$pkgname.sh" chmod 755 "${srcdir}/$pkgname-$pkgver/$pkgname.sh" # install the wrapper on /usr/bin install -D "${srcdir}/$pkgname-$pkgver/$pkgname.sh" ${pkgdir}/usr/bin/${pkgname} # .desktop install -D "$srcdir/pgadmin4.desktop" "$pkgdir/usr/share/applications/pgadmin4.desktop" # icons install -Dm644 runtime/pgAdmin4-0.png "$pkgdir/usr/share/icons/hicolor/256x256/apps/pgAdmin4.png" install -Dm644 runtime/pgAdmin4-1.png "$pkgdir/usr/share/icons/hicolor/48x48/apps/pgAdmin4.png" install -Dm644 runtime/pgAdmin4-2.png "$pkgdir/usr/share/icons/hicolor/32x32/apps/pgAdmin4.png" install -Dm644 runtime/pgAdmin4-3.png "$pkgdir/usr/share/icons/hicolor/16x16/apps/pgAdmin4.png" # License install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" }