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