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