desktop/pgadmin4/PKGBUILD

67 lines
2.3 KiB
Bash
Raw Normal View History

2017-03-03 06:24:41 +08:00
pkgname=pgadmin4
pkgver=1.2
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/pgadmin3/pgadmin4/v$pkgver/source/$pkgname-$pkgver.tar.gz"
"pgAdmin4.desktop")
sha256sums=('07af259fc4a00882f2110bd670fd3c4043ab1af2efb72855391ef8ca22d39107'
'c316e3dfbf433967ef023fe078c52c68ee182a49a0886253e8bbbce7526bb566')
prepare() {
cd $pkgname-$pkgver
convert runtime/pgAdmin4.{ico,png}
}
build() {
cd $pkgname-$pkgver/runtime
export PYTHON_CONFIG=/usr/bin/python3-config
qmake-qt5 CONFIG+=release
make
}
package() {
# installing python deps
cd $pkgname-$pkgver
pip3 install --target="${pkgdir}/usr/lib/$_name/modules/site-packages" -r requirements_py3.txt
cd $srcdir/$pkgname-$pkgver
install -D runtime/pgAdmin4 ${pkgdir}/usr/lib/$_name/runtime/pgAdmin4
install -d ${pkgdir}/usr/bin
cp -a docs web ${pkgdir}/$_rootdir/usr/lib/pgAdmin4
cat >>"${pkgdir}/$_rootdir/usr/lib/pgAdmin4/web/config_local.py" <<END
SERVER_MODE = False
HELP_PATH = "/usr/lib/pgAdmin4/docs/en_US/_build/html/"
END
cat >>"${pkgdir}/$_rootdir/usr/lib/pgAdmin4/web/config_distro.py" <<END
END
# put wrapper on /usr/bin
echo "#!/bin/sh
export PYTHONPATH=${PYTHONPATH}:/usr/lib/$_name/modules/site-packages
/usr/lib/$_name/runtime/pgAdmin4" '"${@}"' > "${srcdir}/$pkgname-$pkgver/$_name.sh"
chmod 755 "${srcdir}/$pkgname-$pkgver/$_name.sh"
# put the wrapper on /usr/bin
install -D "${srcdir}/$pkgname-$pkgver/$_name.sh" ${pkgdir}/usr/bin/${_name}
# .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"
}