wok annotate phpldapadmin/receipt @ rev 5028

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