wok view postfixadmin/receipt @ rev 25601
Update some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jul 16 18:06:38 2023 +0000 (16 months ago) |
parents | 5ea0ce1cecc0 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="postfixadmin"
4 VERSION="3.2.3"
5 CATEGORY="network"
6 SHORT_DESC="Postfix web administration."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL"
9 WEB_SITE="https://github.com/postfixadmin/postfixadmin"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$WEB_SITE/archive/$TARBALL"
14 DEPENDS="mysql_or_postgresql php php-imap php-mysqli postfix"
16 # What is the latest version available today?
17 current_version()
18 {
19 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
20 sed '/tag\//!d;s|.*tag/[a-z-]*||;s|".*||;q'
21 }
23 # Rules to gen a SliTaz package suitable for Tazpkg.
24 genpkg_rules()
25 {
26 mkdir -p $fs/usr/share/postfixadmin
27 mkdir -p $fs/etc/postfixadmin
28 mkdir -p $fs/usr/share/doc/postfixadmin
29 mkdir -p $fs/usr/lib/postfixadmin
31 cp -a $src/* $fs/usr/share/postfixadmin/
32 mv $fs/usr/share/postfixadmin/config.inc.php \
33 $fs/etc/postfixadmin
34 ln -s /etc/postfixadmin/config.inc.php \
35 $fs/usr/share/postfixadmin/config.inc.php
36 sed -i 's/false/true/' $fs/etc/postfixadmin/config.inc.php
38 # Remove unwanted files
39 rm -rf $fs/usr/share/postfixadmin/debian
41 # Move documentation
42 mv $fs/usr/share/postfixadmin/*.TXT \
43 $fs/usr/share/doc/postfixadmin
44 mv $fs/usr/share/postfixadmin/DOCUMENTS \
45 $fs/usr/share/doc/postfixadmin
46 mv $fs/usr/share/postfixadmin/ADDITIONS/* \
47 $fs/usr/lib/postfixadmin
48 mv $fs/usr/share/postfixadmin/VIRTUAL_VACATION/*.pl \
49 $fs/usr/lib/postfixadmin
50 mv $fs/usr/share/postfixadmin/VIRTUAL_VACATION/ \
51 $fs/usr/share/doc/postfixadmin
53 rm -rf $fs/usr/share/postfixadmin/ADDITIONS
55 # Fix group
56 chown -R root.root $fs/usr/share/postfixadmin/
57 }
59 post_install()
60 {
61 # Configure lighttpd server
62 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
63 then
64 if ! grep -q /usr/share/postfixadmin/ "$1/etc/lighttpd/lighttpd.conf"
65 then
66 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/postfixadmin/" => "/usr/share/postfixadmin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
67 if [ -z "$1" ]
68 then
69 # Start Web server.
70 /etc/init.d/lighttpd stop
71 /etc/init.d/lighttpd start
72 fi
73 fi
74 fi
76 # Configure apache server
77 if [ -f "$1/etc/apache/httpd.conf" ]
78 then
79 if [ ! -f "$1/etc/apache/conf.d/postfixadmin" ]
80 then
81 cat > "$1/etc/apache/conf.d/postfixadmin" <<EOT
82 <IfModule mod_alias.c>
83 Alias /postfixadmin /usr/share/postfixadmin
84 </IfModule>
85 <DirectoryMatch /usr/share/postfixadmin/>
86 DirectoryIndex index.php
87 Options +FollowSymLinks
88 AllowOverride None
89 Order allow,deny
90 Allow from all
91 </DirectoryMatch>
92 EOT
93 if [ -z "$1" ]
94 then
95 # Start Web server.
96 /etc/init.d/apache stop
97 /etc/init.d/apache start
98 fi
99 fi
100 fi
101 }