# SliTaz package receipt. PACKAGE="postfixadmin" VERSION="3.2.3" CATEGORY="network" SHORT_DESC="Postfix web administration." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL" WEB_SITE="https://github.com/postfixadmin/postfixadmin" TARBALL="$PACKAGE-$VERSION.tar.gz" WGET_URL="$WEB_SITE/archive/$TARBALL" DEPENDS="mysql_or_postgresql php php-imap php-mysqli postfix" current_version() { wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \ sed '/archive.*tar/!d;s|.*/postfixadmin-\(.*\).tar.*|\1|;q' } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/share/postfixadmin mkdir -p $fs/etc/postfixadmin mkdir -p $fs/usr/share/doc/postfixadmin mkdir -p $fs/usr/lib/postfixadmin cp -a $src/* $fs/usr/share/postfixadmin/ mv $fs/usr/share/postfixadmin/config.inc.php \ $fs/etc/postfixadmin ln -s /etc/postfixadmin/config.inc.php \ $fs/usr/share/postfixadmin/config.inc.php sed -i 's/false/true/' $fs/etc/postfixadmin/config.inc.php # Remove unwanted files rm -rf $fs/usr/share/postfixadmin/debian # Move documentation mv $fs/usr/share/postfixadmin/*.TXT \ $fs/usr/share/doc/postfixadmin mv $fs/usr/share/postfixadmin/DOCUMENTS \ $fs/usr/share/doc/postfixadmin mv $fs/usr/share/postfixadmin/ADDITIONS/* \ $fs/usr/lib/postfixadmin mv $fs/usr/share/postfixadmin/VIRTUAL_VACATION/*.pl \ $fs/usr/lib/postfixadmin mv $fs/usr/share/postfixadmin/VIRTUAL_VACATION/ \ $fs/usr/share/doc/postfixadmin rm -rf $fs/usr/share/postfixadmin/ADDITIONS # Fix group chown -R root.root $fs/usr/share/postfixadmin/ } post_install() { # Configure lighttpd server if [ -f "$1/etc/lighttpd/lighttpd.conf" ] then if ! grep -q /usr/share/postfixadmin/ "$1/etc/lighttpd/lighttpd.conf" then sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/postfixadmin/" => "/usr/share/postfixadmin/",|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/postfixadmin" ] then cat > "$1/etc/apache/conf.d/postfixadmin" < Alias /postfixadmin /usr/share/postfixadmin 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 }