rev |
line source |
pascal@1155
|
1 # SliTaz package receipt.
|
pascal@1155
|
2
|
pascal@1155
|
3 PACKAGE="phpldapadmin"
|
Hans-G?nter@23428
|
4 VERSION="1.2.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@15198
|
8 LICENSE="GPL2"
|
Hans-G?nter@23428
|
9 WEB_SITE="https://github.com/leenooks/phpLDAPadmin/"
|
Hans-G?nter@23428
|
10
|
Hans-G?nter@23428
|
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
|
Hans-G?nter@23428
|
12 WGET_URL="${WEB_SITE}archive/$VERSION.tar.gz"
|
pascal@15198
|
13
|
pascal@1155
|
14 DEPENDS="php-ldap"
|
pascal@1155
|
15
|
Hans-G?nter@23428
|
16 CONFIG_FILES="/etc/phpldapadmin/config.php"
|
Hans-G?nter@23428
|
17
|
Hans-G?nter@23428
|
18 HOST_ARCH="any"
|
Hans-G?nter@23428
|
19
|
pascal@1155
|
20 # Rules to gen a SliTaz package suitable for Tazpkg.
|
pascal@1155
|
21 genpkg_rules()
|
pascal@1155
|
22 {
|
Hans-G?nter@23428
|
23 mkdir -p $fs/usr/share/phpldapadmin
|
Hans-G?nter@23428
|
24 mkdir -p $fs/etc
|
Hans-G?nter@23428
|
25 mkdir -p $fs/usr/share/applications
|
Hans-G?nter@23428
|
26
|
Hans-G?nter@23428
|
27 cp -a $src/. $fs/usr/share/phpldapadmin
|
Hans-G?nter@23428
|
28 mv $fs/usr/share/phpldapadmin/config $fs/etc/phpldapadmin
|
pascal@1155
|
29 ln -s /etc/phpldapadmin $fs/usr/share/phpldapadmin/config
|
Hans-G?nter@23428
|
30 mv $fs/etc/phpldapadmin/config.php.example $fs/etc/phpldapadmin/config.php
|
Hans-G?nter@23428
|
31 cp $stuff/phpldapadmin.desktop $fs/usr/share/applications
|
Hans-G?nter@23428
|
32 chown -R www.www $fs/usr/share/phpldapadmin $fs/etc/phpldapadmin
|
Hans-G?nter@23428
|
33 chmod 700 $fs/etc/phpldapadmin
|
Hans-G?nter@23428
|
34 chmod 600 $fs/etc/phpldapadmin/config.php
|
pascal@1155
|
35 }
|
pascal@1155
|
36
|
pascal@1155
|
37 post_install()
|
pascal@1155
|
38 {
|
Hans-G?nter@23428
|
39 if [ -s "$1/etc/openldap/slapd.conf" ]
|
Hans-G?nter@23428
|
40 then
|
pascal@18730
|
41 rootdn=$(awk '/^rootdn/ { print $2 }' < "$1/etc/openldap/slapd.conf" | sed 's/"//g')
|
Hans-G?nter@23428
|
42 sed -i "s|'login','dn','');|'login','dn','');\\n\$ldapservers->SetValue(\$i,'login','dn','$rootdn');|" \
|
Hans-G?nter@23428
|
43 "$1/etc/phpldapadmin/config.php"
|
pascal@18730
|
44 chown 80.80 "$1/etc/phpldapadmin/config.php"
|
pascal@1403
|
45 fi
|
Hans-G?nter@23428
|
46
|
pascal@1314
|
47 # Configure lighttpd server
|
Hans-G?nter@23428
|
48 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
|
Hans-G?nter@23428
|
49 then
|
Hans-G?nter@23428
|
50 if ! grep -q /usr/share/phpldapadmin/ "$1/etc/lighttpd/lighttpd.conf"
|
Hans-G?nter@23428
|
51 then
|
pascal@18730
|
52 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpldapadmin/" => "/usr/share/phpldapadmin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
|
Hans-G?nter@23428
|
53 if [ -z "$1" ]
|
Hans-G?nter@23428
|
54 then
|
pascal@1155
|
55 # Start Web server.
|
pascal@1155
|
56 /etc/init.d/lighttpd stop
|
pascal@1155
|
57 /etc/init.d/lighttpd start
|
pascal@1155
|
58 fi
|
pascal@1155
|
59 fi
|
pascal@1155
|
60 fi
|
Hans-G?nter@23428
|
61
|
pascal@1314
|
62 # Configure apache server
|
Hans-G?nter@23428
|
63 if [ -f "$1/etc/apache/httpd.conf" ]
|
Hans-G?nter@23428
|
64 then
|
Hans-G?nter@23428
|
65 if [ ! -f "$1/etc/apache/conf.d/phpldapadmin" ]
|
Hans-G?nter@23428
|
66 then
|
pascal@18730
|
67 cat > "$1/etc/apache/conf.d/phpldapadmin" <<EOT
|
pascal@1314
|
68 <IfModule mod_alias.c>
|
pascal@1314
|
69 Alias /phpldapadmin /usr/share/phpldapadmin
|
pascal@1314
|
70 </IfModule>
|
pascal@1314
|
71 <DirectoryMatch /usr/share/phpldapadmin/>
|
pascal@1314
|
72 DirectoryIndex index.php
|
pascal@1314
|
73 Options +FollowSymLinks
|
pascal@1314
|
74 AllowOverride None
|
pascal@1314
|
75 Order allow,deny
|
pascal@1314
|
76 Allow from all
|
pascal@1314
|
77 </DirectoryMatch>
|
pascal@1314
|
78 EOT
|
Hans-G?nter@23428
|
79 if [ -z "$1" ]
|
Hans-G?nter@23428
|
80 then
|
pascal@1314
|
81 # Start Web server.
|
pascal@1314
|
82 /etc/init.d/apache stop
|
pascal@1314
|
83 /etc/init.d/apache start
|
pascal@1314
|
84 fi
|
pascal@1314
|
85 fi
|
pascal@1314
|
86 fi
|
pascal@1311
|
87 cat <<EOT
|
pascal@1311
|
88 ------
|
pascal@1311
|
89 Login DN and password are found in /etc/openldap/slapd.conf with rootdn and rootpw keywords:
|
pascal@18730
|
90 $(grep ^rootdn "$1/etc/openldap/slapd.conf")
|
pascal@18730
|
91 $(grep ^rootpw "$1/etc/openldap/slapd.conf")
|
pascal@1311
|
92 ------
|
pascal@1311
|
93 EOT
|
pascal@1155
|
94 }
|