wok view phpldapadmin/receipt @ rev 25632
Up gtklife (5.3)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Dec 23 14:06:29 2023 +0000 (8 months ago) |
parents | e0747fd04e6a |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="phpldapadmin"
4 VERSION="1.2.6.3"
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 # What is the latest version available today?
21 current_version()
22 {
23 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
24 sed '/tag\//!d;s|.*tag/v*||;s|".*||;q'
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 mkdir -p $fs/usr/share/phpldapadmin
31 mkdir -p $fs/etc
32 mkdir -p $fs/usr/share/applications
34 cp -a $src/. $fs/usr/share/phpldapadmin
35 mv $fs/usr/share/phpldapadmin/config $fs/etc/phpldapadmin
36 ln -s /etc/phpldapadmin $fs/usr/share/phpldapadmin/config
37 mv $fs/etc/phpldapadmin/config.php.example $fs/etc/phpldapadmin/config.php
38 cp $stuff/phpldapadmin.desktop $fs/usr/share/applications
39 chown -R www.www $fs/usr/share/phpldapadmin
40 chown -R www.www $fs/etc/phpldapadmin
41 chmod 700 $fs/etc/phpldapadmin
42 chmod 600 $fs/etc/phpldapadmin/config.php
43 }
45 post_install()
46 {
47 if [ -s "$1/etc/openldap/slapd.conf" ]
48 then
49 rootdn=$(awk '/^rootdn/ { print $2 }' < "$1/etc/openldap/slapd.conf" | sed 's/"//g')
50 sed -i "s|'login','dn','');|'login','dn','');\\n\$ldapservers->SetValue(\$i,'login','dn','$rootdn');|" \
51 "$1/etc/phpldapadmin/config.php"
52 chown 80.80 "$1/etc/phpldapadmin/config.php"
53 fi
55 # Configure lighttpd server
56 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
57 then
58 if ! grep -q /usr/share/phpldapadmin/ "$1/etc/lighttpd/lighttpd.conf"
59 then
60 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpldapadmin/" => "/usr/share/phpldapadmin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
61 if [ -z "$1" ]
62 then
63 # Start Web server.
64 /etc/init.d/lighttpd stop
65 /etc/init.d/lighttpd start
66 fi
67 fi
68 fi
70 # Configure apache server
71 if [ -f "$1/etc/apache/httpd.conf" ]
72 then
73 if [ ! -f "$1/etc/apache/conf.d/phpldapadmin" ]
74 then
75 cat > "$1/etc/apache/conf.d/phpldapadmin" <<EOT
76 <IfModule mod_alias.c>
77 Alias /phpldapadmin /usr/share/phpldapadmin
78 </IfModule>
79 <DirectoryMatch /usr/share/phpldapadmin/>
80 DirectoryIndex index.php
81 Options +FollowSymLinks
82 AllowOverride None
83 Order allow,deny
84 Allow from all
85 </DirectoryMatch>
86 EOT
87 if [ -z "$1" ]
88 then
89 # Start Web server.
90 /etc/init.d/apache stop
91 /etc/init.d/apache start
92 fi
93 fi
94 fi
95 cat <<EOT
96 ------
97 Login DN and password are found in /etc/openldap/slapd.conf with rootdn and rootpw keywords:
98 $(grep ^rootdn "$1/etc/openldap/slapd.conf")
99 $(grep ^rootpw "$1/etc/openldap/slapd.conf")
100 ------
101 EOT
102 }