wok-stable view squirrelmail-ldapuser/receipt @ rev 9036
iron-linux, squirrelmail plugins: fix genpkg_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Mar 04 00:08:04 2011 +0100 (2011-03-04) |
parents | ff4c00ab546f |
children | 91a615759636 |
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 configure and make the package.
16 compile_rules()
17 {
18 cp -a $src $DESTDIR/$SOURCE
19 }
21 # Rules to gen a SliTaz package suitable for Tazpkg.
22 genpkg_rules()
23 {
24 mkdir -p $fs/usr/share/squirrelmail/plugins $fs/etc/squirrelmail
25 cp -a $_pkg/$SOURCE $fs/usr/share/squirrelmail/plugins
26 mv $fs/usr/share/squirrelmail/plugins/$SOURCE/config_sample.php \
27 $fs/etc/squirrelmail/config-$SOURCE.php
28 ln -s /etc/squirrelmail/config-$SOURCE.php \
29 $fs/usr/share/squirrelmail/plugins/$SOURCE/config.php
30 }
32 post_install()
33 {
34 echo "\$plugins[] = '$SOURCE';" >> $1/etc/squirrelmail/config_local.php
35 mv $1/usr/share/squirrelmail/functions/file_prefs.php \
36 $1/usr/share/squirrelmail/functions/file_prefs.php.original
37 ln -s ../plugins/ldapuserdata/file_prefs.php \
38 $1/usr/share/squirrelmail/functions/file_prefs.php
39 cat >> $1/etc/openldap/slapd.conf <<EOT
40 include /usr/share/squirrelmail/plugins/$SOURCE/doc/squirrelmail.schema
41 EOT
42 }
44 pre_remove()
45 {
46 sed -i "/\$plugins.. = '$SOURCE';/d" /etc/squirrelmail/config_local.php
47 sed -i "/plugins.$SOURCE.doc/d" /etc/openldap/slapd.conf
48 rm -f /usr/share/squirrelmail/functions/file_prefs.php
49 mv /usr/share/squirrelmail/functions/file_prefs.php.original \
50 /usr/share/squirrelmail/functions/file_prefs.php
51 }