wok-next view phpldapadmin/receipt @ rev 21727

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