# SliTaz package receipt. PACKAGE="phppgadmin" VERSION="7.13.0" CATEGORY="misc" SHORT_DESC="Administration of postgresql over the Web." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" WEB_SITE="https://github.com/phppgadmin/phppgadmin/" TARBALL="$PACKAGE-$VERSION.tar.gz" WGET_URL="${WEB_SITE}archive/REL_${VERSION//./-}.tar.gz" DEPENDS="php-pgsql" CONFIG_FILES="/etc/phppgadmin/config.inc.php" HOST_ARCH="any" current_version() { wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \ sed '/archive.*tar/!d;s|.*/REL_\(.*\).tar.*|\1|;s|-|.|g;q' } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/share/phppgadmin mkdir -p $fs/etc mkdir -p $fs/usr/share/applications cp -a $src/. $fs/usr/share/phppgadmin mv $fs/usr/share/phppgadmin/conf $fs/etc/phppgadmin ln -s /etc/phppgadmin $fs/usr/share/phppgadmin/conf mv -f $fs/etc/phppgadmin/config.inc.php-dist \ $fs/etc/phppgadmin/config.inc.php sed -i -e "s/conf\['extra_login_security'\] = true/conf['extra_login_security'] = false/" \ $fs/etc/phppgadmin/config.inc.php cp stuff/phppgadmin.desktop $fs/usr/share/applications chown -R www.www $fs/usr/share/phppgadmin chown -R www.www $fs/etc/phppgadmin chmod 700 $fs/etc/phppgadmin chmod 600 $fs/etc/phppgadmin/* } post_install() { # Configure lighttpd server if [ -f "$1/etc/lighttpd/lighttpd.conf" ] then if ! grep -q /usr/share/phppgadmin/ "$1/etc/lighttpd/lighttpd.conf" then sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phppgadmin/" => "/usr/share/phppgadmin/",|g' \ -i "$1/etc/lighttpd/lighttpd.conf" if [ -z "$1" ] then # Start Web server. /etc/init.d/lighttpd stop /etc/init.d/lighttpd start fi fi fi # Configure apache server if [ -f "$1/etc/apache/httpd.conf" ] then if [ ! -f "$1/etc/apache/conf.d/phppgadmin" ] then cat > "$1/etc/apache/conf.d/phppgadmin" < Alias /phppgadmin /usr/share/phppgadmin DirectoryIndex index.php Options +FollowSymLinks AllowOverride None Order allow,deny Allow from all EOT if [ -z "$1" ] then # Start Web server. /etc/init.d/apache stop /etc/init.d/apache start fi fi fi cat << EOT ------ User 'postgres' can login on localhost without passwd after: # /etc/init.d/postgresql start ------ EOT }