wok-current view squirrelmail/receipt @ rev 16211

Up mesa-wayland-dev (9.1.3)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 31 11:30:38 2014 +0000 (2014-03-31)
parents f04a7db11ba8
children d51b2411e55e
line source
1 # SliTaz package receipt.
3 PACKAGE="squirrelmail"
4 VERSION="1.4.22"
5 CATEGORY="network"
6 SHORT_DESC="Web mail."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-webmail-$VERSION.tar.bz2"
10 WEB_SITE="http://www.squirrelmail.org/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 CONFIG_FILES="/etc/squirrelmail/config.php /etc/squirrelmail/config_local.php"
14 DEPENDS="php"
16 # Rules to gen a SliTaz package suitable for Tazpkg.
17 genpkg_rules()
18 {
19 mkdir -p $fs/usr/share/squirrelmail $fs/var/lib/squirrelmail/data \
20 $fs/var/lib/squirrelmail/attach $fs/etc
21 cp -a $src/. $fs/usr/share/squirrelmail
22 sed -i "s/'custom_css', 'none'/'custom_css', 'serif-12.css'/" \
23 $fs/usr/share/squirrelmail/include/load_prefs.php
24 mv $fs/usr/share/squirrelmail/config $fs/etc/squirrelmail
25 ln -s /etc/squirrelmail $fs/usr/share/squirrelmail/config
26 mv $fs/etc/squirrelmail/config_default.* $fs/etc/squirrelmail/config.php
27 for i in demo test fortune; do
28 rm -rf $fs/usr/share/squirrelmail/plugins/$i
29 done
30 for i in $( cd $fs/usr/share/squirrelmail/plugins/ ; ls -d */ ); do
31 echo "\$plugins[] = '${i%/}';"
32 done >> $fs/etc/squirrelmail/config_local.php
33 sed -i -e "s|\$domain = 'example.com'|\$domain = 'localhost'|" \
34 -e 's|/var/local|/var/lib|g' $fs/etc/squirrelmail/config.php
35 chown -R www.www $fs/usr/share/squirrelmail $fs/etc/squirrelmail \
36 $fs/var/lib/squirrelmail
37 chmod 700 $fs/etc/squirrelmail
39 # Package all squirrelmail pkgs
40 if [ -x /usr/bin/cook ]; then
41 cook squirrelmail-locales
42 for i in $(cd $WOK; ls -d squirrelmail-*)
43 do
44 cook $i
45 done
46 fi
47 }
49 post_install()
50 {
51 #echo "Update /short_open_tag in /etc/php.ini"
52 #sed -i 's/^short_open_tag.*/short_open_tag = On/' /etc/php.ini
53 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
54 if ! grep -q /usr/share/squirrelmail/ $1/etc/lighttpd/lighttpd.conf; then
55 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/squirrelmail/" => "/usr/share/squirrelmail/",|g' -i $1/etc/lighttpd/lighttpd.conf
56 if [ -z "$1" ]; then
57 # Start Web server.
58 /etc/init.d/lighttpd stop
59 /etc/init.d/lighttpd start
60 fi
61 fi
62 fi
63 # Configure apache server
64 if [ -f $1/etc/apache/httpd.conf ]; then
65 if [ ! -f $1/etc/apache/conf.d/squirrelmail ]; then
66 cat > $1/etc/apache/conf.d/squirrelmail <<EOT
67 <IfModule mod_alias.c>
68 Alias /squirrelmail /usr/share/squirrelmail
69 </IfModule>
70 <DirectoryMatch /usr/share/squirrelmail/>
71 DirectoryIndex index.php
72 Options +FollowSymLinks
73 AllowOverride None
74 Order allow,deny
75 Allow from all
76 </DirectoryMatch>
77 EOT
78 if [ -z "$1" ]; then
79 # Start Web server.
80 /etc/init.d/apache restart
81 fi
82 fi
83 fi
84 }