wok annotate postfixadmin/receipt @ rev 7824

Add postfixadmin
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 26 12:02:09 2010 +0100 (2010-12-26)
parents
children 9480baa0a8b0
rev   line source
pascal@7824 1 # SliTaz package receipt.
pascal@7824 2
pascal@7824 3 PACKAGE="postfixadmin"
pascal@7824 4 VERSION="2.3.2"
pascal@7824 5 CATEGORY="network"
pascal@7824 6 SHORT_DESC="Postfix web administration."
pascal@7824 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@7824 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@7824 9 WEB_SITE="http://postfixadmin.sourceforge.net/"
pascal@7824 10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
pascal@7824 11 DEPENDS="php postfix mysql_or_postgresql"
pascal@7824 12
pascal@7824 13 # Rules to configure and make the package.
pascal@7824 14 compile_rules()
pascal@7824 15 {
pascal@7824 16 cd $src
pascal@7824 17 }
pascal@7824 18
pascal@7824 19 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@7824 20 genpkg_rules()
pascal@7824 21 {
pascal@7824 22 mkdir -p $fs/usr/share/postfixadmin $fs/etc/postfix
pascal@7824 23 cp -a $src/* $fs/usr/share/postfixadmin/
pascal@7824 24 mv $fs/usr/share/postfixadmin/config.inc.php $fs/etc/postfix/postfixadmin.php
pascal@7824 25 ln -s /etc/postfix/postfixadmin.php $fs/usr/share/postfixadmin/config.inc.php
pascal@7824 26 sed -i 's/false/true/' $fs/etc/postfix/postfixadmin.php
pascal@7824 27 }
pascal@7824 28
pascal@7824 29 post_install()
pascal@7824 30 {
pascal@7824 31 # Configure lighttpd server
pascal@7824 32 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@7824 33 if ! grep -q /usr/share/postfixadmin/ $1/etc/lighttpd/lighttpd.conf; then
pascal@7824 34 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/postfixadmin/" => "/usr/share/postfixadmin/",|g' -i $1/etc/lighttpd/lighttpd.conf
pascal@7824 35 if [ -z "$1" ]; then
pascal@7824 36 # Start Web server.
pascal@7824 37 /etc/init.d/lighttpd stop
pascal@7824 38 /etc/init.d/lighttpd start
pascal@7824 39 fi
pascal@7824 40 fi
pascal@7824 41 fi
pascal@7824 42 # Configure apache server
pascal@7824 43 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@7824 44 if [ ! -f $1/etc/apache/conf.d/postfixadmin ]; then
pascal@7824 45 cat > $1/etc/apache/conf.d/postfixadmin <<EOT
pascal@7824 46 <IfModule mod_alias.c>
pascal@7824 47 Alias /postfixadmin /usr/share/postfixadmin
pascal@7824 48 </IfModule>
pascal@7824 49 <DirectoryMatch /usr/share/postfixadmin/>
pascal@7824 50 DirectoryIndex index.php
pascal@7824 51 Options +FollowSymLinks
pascal@7824 52 AllowOverride None
pascal@7824 53 Order allow,deny
pascal@7824 54 Allow from all
pascal@7824 55 </DirectoryMatch>
pascal@7824 56 EOT
pascal@7824 57 if [ -z "$1" ]; then
pascal@7824 58 # Start Web server.
pascal@7824 59 /etc/init.d/apache stop
pascal@7824 60 /etc/init.d/apache start
pascal@7824 61 fi
pascal@7824 62 fi
pascal@7824 63 fi
pascal@7824 64 }