wok view squirrelmail-ldapuser/receipt @ rev 2260

squirrelmail plugins: post_remove -> pre_remove
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 16 08:04:20 2009 +0000 (2009-02-16)
parents fb1f0177e4ef
children f81e47267992
line source
1 # SliTaz package receipt.
3 PACKAGE="squirrelmail-ldapuser"
4 VERSION="0.4"
5 CATEGORY="network"
6 SHORT_DESC="LDAP backend for Web mail users' profile/preferences."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 SOURCE="ldapuserdata"
9 TARBALL="$SOURCE-$VERSION.tar.gz"
10 WEB_SITE="http://www.squirrelmail.org/"
11 DEPENDS="squirrelmail openldap"
12 WGET_URL="${WEB_SITE}plugins/$TARBALL"
13 CONFIG_FILES="/etc/squirrelmail/config-$SOURCE.php"
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 mkdir -p $fs/usr/share/squirrelmail/plugins $fs/etc/squirrelmail
19 cp -a $SOURCE $fs/usr/share/squirrelmail/plugins
20 mv $fs/usr/share/squirrelmail/plugins/$SOURCE/config_sample.php \
21 $fs/etc/squirrelmail/config-$SOURCE.php
22 ln -s /etc/squirrelmail/config-$SOURCE.php \
23 $fs/usr/share/squirrelmail/plugins/$SOURCE/config.php
24 }
26 post_install()
27 {
28 echo "\$plugins[] = '$SOURCE';" >> $1/etc/squirrelmail/config_local.php
29 mv $1/usr/share/squirrelmail/functions/file_prefs.php \
30 $1/usr/share/squirrelmail/functions/file_prefs.php.original
31 ln -s ../plugins/ldapuserdata/file_prefs.php \
32 $1/usr/share/squirrelmail/functions/file_prefs.php
33 cat >> $1/etc/openldap/slapd.conf <<EOT
34 include /usr/share/squirrelmail/plugins/$SOURCE/doc/squirrelmail.schema
35 EOT
36 }
38 pre_remove()
39 {
40 sed -i "/\$plugins.. = '$SOURCE';/d" /etc/squirrelmail/config_local.php
41 sed -i "/plugins.$SOURCE.doc/d" /etc/openldap/slapd.conf
42 rm -f /usr/share/squirrelmail/functions/file_prefs.php
43 mv /usr/share/squirrelmail/functions/file_prefs.php.original \
44 /usr/share/squirrelmail/functions/file_prefs.php
45 }