wok-next annotate squirrelmail/receipt @ rev 1201

squirrelmail: enable default plugins
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 08 16:12:50 2008 +0000 (2008-08-08)
parents e1c40827b929
children 534023d6e005
rev   line source
pascal@1198 1 # SliTaz package receipt.
pascal@1198 2
pascal@1198 3 PACKAGE="squirrelmail"
pascal@1198 4 VERSION="1.4.15"
pascal@1198 5 CATEGORY="network"
pascal@1198 6 SHORT_DESC="Web mail."
pascal@1198 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@1198 8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
pascal@1198 9 WEB_SITE="http://www.squirrelmail.org/"
pascal@1198 10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
pascal@1198 11
pascal@1198 12 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1198 13 genpkg_rules()
pascal@1198 14 {
pascal@1198 15 mkdir -p $fs/usr/share/squirrelmail $fs/var/lib/squirrelmail/data \
pascal@1198 16 $fs/var/lib/squirrelmail/attach $fs/etc
pascal@1198 17 cp -a $src/. $fs/usr/share/squirrelmail
pascal@1198 18 mv $fs/usr/share/squirrelmail/config $fs/etc/squirrelmail
pascal@1198 19 ln -s /etc/squirrelmail $fs/usr/share/squirrelmail/config
pascal@1198 20 mv $fs/etc/squirrelmail/config_default.* $fs/etc/squirrelmail/config.php
pascal@1201 21 for i in demo test fortune; do
pascal@1201 22 rm -rf $fs/usr/share/squirrelmail/plugins/$i
pascal@1201 23 done
pascal@1201 24 for i in $( cd $fs/usr/share/squirrelmail/plugins/ ; ls -d */ ); do
pascal@1201 25 echo "\$plugins[] = '${i%/}';"
pascal@1201 26 done >> $fs/etc/squirrelmail/config_local.php
pascal@1198 27 sed -i -e "s|\$domain = 'example.com'|\$domain = 'localhost'|" \
pascal@1198 28 -e 's|/var/local|/var/lib|g' $fs/etc/squirrelmail/config.php
pascal@1198 29 chown -R www.www $fs/usr/share/squirrelmail $fs/etc/squirrelmail \
pascal@1198 30 $fs/var/lib/squirrelmail
pascal@1198 31 chmod 700 $fs/etc/squirrelmail
pascal@1199 32 # Package all squirrelmail pkgs
pascal@1198 33 for i in $(cd $WOK; ls -d squirrelmail-*)
pascal@1198 34 do
pascal@1198 35 grep -q '^WANTED=' $i/receipt || tazwok cook $i
pascal@1198 36 done
pascal@1198 37 for i in $(cd $WOK; grep -l '^WANTED="squirrelmail"$' \
pascal@1198 38 squirrelmail-*/receipt)
pascal@1198 39 do
pascal@1198 40 tazwok genpkg ${i%/receipt}
pascal@1198 41 done
pascal@1198 42 }
pascal@1198 43
pascal@1198 44 post_install()
pascal@1198 45 {
pascal@1198 46 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
pascal@1198 47 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
pascal@1198 48 etc/squirrelmail/config.php
pascal@1198 49 etc/squirrelmail/config_local.php
pascal@1198 50 EOT
pascal@1198 51 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@1198 52 if ! grep -q /usr/share/squirrelmail/ $1/etc/lighttpd/lighttpd.conf; then
pascal@1198 53 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 54 if [ -z "$1" ]; then
pascal@1198 55 # Start Web server.
pascal@1198 56 /etc/init.d/lighttpd stop
pascal@1198 57 /etc/init.d/lighttpd start
pascal@1198 58 fi
pascal@1198 59 fi
pascal@1198 60 fi
pascal@1198 61 }
pascal@1198 62
pascal@1198 63 repack_cleanup()
pascal@1198 64 {
pascal@1198 65 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
pascal@1198 66 }