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