wok-6.x view phpldapadmin/receipt @ rev 24045
memtest,plop: tune lzma compression
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu May 06 12:50:46 2021 +0000 (2021-05-06) |
parents | 9e01bc6321ea |
children | 5ea0ce1cecc0 |
line source
1 # SliTaz package receipt.
3 PACKAGE="phpldapadmin"
4 VERSION="1.2.5"
5 CATEGORY="misc"
6 SHORT_DESC="Administration of LDAP over the Web."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://github.com/leenooks/phpLDAPadmin/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="${WEB_SITE}archive/$VERSION.tar.gz"
14 DEPENDS="php-ldap"
16 CONFIG_FILES="/etc/phpldapadmin/config.php"
18 HOST_ARCH="any"
20 # Rules to gen a SliTaz package suitable for Tazpkg.
21 genpkg_rules()
22 {
23 mkdir -p $fs/usr/share/phpldapadmin
24 mkdir -p $fs/etc
25 mkdir -p $fs/usr/share/applications
27 cp -a $src/. $fs/usr/share/phpldapadmin
28 mv $fs/usr/share/phpldapadmin/config $fs/etc/phpldapadmin
29 ln -s /etc/phpldapadmin $fs/usr/share/phpldapadmin/config
30 mv $fs/etc/phpldapadmin/config.php.example $fs/etc/phpldapadmin/config.php
31 cp $stuff/phpldapadmin.desktop $fs/usr/share/applications
32 chown -R www.www $fs/usr/share/phpldapadmin $fs/etc/phpldapadmin
33 chmod 700 $fs/etc/phpldapadmin
34 chmod 600 $fs/etc/phpldapadmin/config.php
35 }
37 post_install()
38 {
39 if [ -s "$1/etc/openldap/slapd.conf" ]
40 then
41 rootdn=$(awk '/^rootdn/ { print $2 }' < "$1/etc/openldap/slapd.conf" | sed 's/"//g')
42 sed -i "s|'login','dn','');|'login','dn','');\\n\$ldapservers->SetValue(\$i,'login','dn','$rootdn');|" \
43 "$1/etc/phpldapadmin/config.php"
44 chown 80.80 "$1/etc/phpldapadmin/config.php"
45 fi
47 # Configure lighttpd server
48 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
49 then
50 if ! grep -q /usr/share/phpldapadmin/ "$1/etc/lighttpd/lighttpd.conf"
51 then
52 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpldapadmin/" => "/usr/share/phpldapadmin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
53 if [ -z "$1" ]
54 then
55 # Start Web server.
56 /etc/init.d/lighttpd stop
57 /etc/init.d/lighttpd start
58 fi
59 fi
60 fi
62 # Configure apache server
63 if [ -f "$1/etc/apache/httpd.conf" ]
64 then
65 if [ ! -f "$1/etc/apache/conf.d/phpldapadmin" ]
66 then
67 cat > "$1/etc/apache/conf.d/phpldapadmin" <<EOT
68 <IfModule mod_alias.c>
69 Alias /phpldapadmin /usr/share/phpldapadmin
70 </IfModule>
71 <DirectoryMatch /usr/share/phpldapadmin/>
72 DirectoryIndex index.php
73 Options +FollowSymLinks
74 AllowOverride None
75 Order allow,deny
76 Allow from all
77 </DirectoryMatch>
78 EOT
79 if [ -z "$1" ]
80 then
81 # Start Web server.
82 /etc/init.d/apache stop
83 /etc/init.d/apache start
84 fi
85 fi
86 fi
87 cat <<EOT
88 ------
89 Login DN and password are found in /etc/openldap/slapd.conf with rootdn and rootpw keywords:
90 $(grep ^rootdn "$1/etc/openldap/slapd.conf")
91 $(grep ^rootpw "$1/etc/openldap/slapd.conf")
92 ------
93 EOT
94 }