### this file is sourced not run
PKGVER=3.4
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=pgadmin4-$PKGVER.tar.gz
MD5SUM=b26c85cce6b589fa42162f1c63bb170c
SRC_URL=https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v$PKGVER/source/$TARBALL
BUNDLE=

SLACKREQ='postgresql python'
SLACKDESC="pgadmin4: pgadmin4 $PKGVER (Postgresql DB Administrator)
pgadmin4: 
pgadmin4: pgAdmin4 is the latest version of pgAdmin built using python and 
pgadmin4: jquery. It runs in your web browser.
pgadmin4: 
pgadmin4: https://www.pgadmin.org/
pgadmin4: 
pgadmin4: 
pgadmin4: 
pgadmin4: 
pgadmin4: 
"

PKG_NOSTRIP=yes # if you strip it, it will break. Way to go, python!

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default
}

### default pkg_package
### build
pkg_build() {
	echo nameserver 8.8.8.8 > /etc/resolv.conf

	cd /tmp/pgadmin* &&

	# copy the "web" component and the docs too
	mkdir -p /opt &&
	rm -rf /opt/pgadmin4* &&
	mv web /opt/pgadmin4-$PKGVER &&
	ln -sfv pgadmin4-$PKGVER /opt/pgadmin4 &&
	mv docs /opt/pgadmin4 &&

	# install all the python dependencies
	pip install -r requirements.txt &&

	# install helper script
	install -m755 /tmp/pkg/pgadmin4 /usr/bin &&

	# done
	pkg_build_slackdesc &&
	rm -f /etc/resolv.conf	
}
 
 
