wok view phpldapadmin/receipt @ rev 15982

syslinux-tools: add meminfo.exe (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 01 19:54:32 2014 +0000 (2014-03-01)
parents 642675200022
children d51b2411e55e
line source
1 # SliTaz package receipt.
3 PACKAGE="phpldapadmin"
4 VERSION="1.2.1"
5 CATEGORY="misc"
6 SHORT_DESC="Administration of LDAP over the Web."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tgz"
10 WEB_SITE="http://phpldapadmin.sourceforge.net/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 CONFIG_FILES="/etc/phpldapadmin/config.php"
14 DEPENDS="php-ldap"
16 # Rules to gen a SliTaz package suitable for Tazpkg.
17 genpkg_rules()
18 {
19 mkdir -p $fs/usr/share/phpldapadmin $fs/etc $fs/usr/share/applications
20 cp -a $src/. $fs/usr/share/phpldapadmin
21 mv $fs/usr/share/phpldapadmin/config $fs/etc/phpldapadmin
22 ln -s /etc/phpldapadmin $fs/usr/share/phpldapadmin/config
23 mv $fs/etc/phpldapadmin/config.php.example $fs/etc/phpldapadmin/config.php
24 cp $stuff/phpldapadmin.desktop $fs/usr/share/applications
25 chown -R www.www $fs/usr/share/phpldapadmin $fs/etc/phpldapadmin
26 chmod 700 $fs/etc/phpldapadmin
27 chmod 600 $fs/etc/phpldapadmin/config.php
28 }
30 post_install()
31 {
32 if [ -s $1/etc/openldap/slapd.conf ]; then
33 rootdn=$(awk '/^rootdn/ { print $2 }' < $1/etc/openldap/slapd.conf | sed 's/"//g')
34 sed -i "s|'login','dn','');|'login','dn','');\\n\$ldapservers->SetValue(\$i,'login','dn','$rootdn');|" $1/etc/phpldapadmin/config.php
35 chown 80.80 $1/etc/phpldapadmin/config.php
36 fi
37 # Configure lighttpd server
38 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
39 if ! grep -q /usr/share/phpldapadmin/ $1/etc/lighttpd/lighttpd.conf; then
40 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpldapadmin/" => "/usr/share/phpldapadmin/",|g' -i $1/etc/lighttpd/lighttpd.conf
41 if [ -z "$1" ]; then
42 # Start Web server.
43 /etc/init.d/lighttpd stop
44 /etc/init.d/lighttpd start
45 fi
46 fi
47 fi
48 # Configure apache server
49 if [ -f $1/etc/apache/httpd.conf ]; then
50 if [ ! -f $1/etc/apache/conf.d/phpldapadmin ]; then
51 cat > $1/etc/apache/conf.d/phpldapadmin <<EOT
52 <IfModule mod_alias.c>
53 Alias /phpldapadmin /usr/share/phpldapadmin
54 </IfModule>
55 <DirectoryMatch /usr/share/phpldapadmin/>
56 DirectoryIndex index.php
57 Options +FollowSymLinks
58 AllowOverride None
59 Order allow,deny
60 Allow from all
61 </DirectoryMatch>
62 EOT
63 if [ -z "$1" ]; then
64 # Start Web server.
65 /etc/init.d/apache stop
66 /etc/init.d/apache start
67 fi
68 fi
69 fi
70 cat <<EOT
71 ------
72 Login DN and password are found in /etc/openldap/slapd.conf with rootdn and rootpw keywords:
73 $(grep ^rootdn $1/etc/openldap/slapd.conf)
74 $(grep ^rootpw $1/etc/openldap/slapd.conf)
75 ------
76 EOT
77 }