wok-current view phpldapadmin/receipt @ rev 25693
Up depends pkgs for cups, need to rebuild it for ssl 3.0
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sun Mar 24 15:17:37 2024 +0000 (7 months ago) |
parents | 5ea0ce1cecc0 |
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 current_version()
21 {
22 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
23 sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
24 }
26 # Rules to gen a SliTaz package suitable for Tazpkg.
27 genpkg_rules()
28 {
29 mkdir -p $fs/usr/share/phpldapadmin
30 mkdir -p $fs/etc
31 mkdir -p $fs/usr/share/applications
33 cp -a $src/. $fs/usr/share/phpldapadmin
34 mv $fs/usr/share/phpldapadmin/config $fs/etc/phpldapadmin
35 ln -s /etc/phpldapadmin $fs/usr/share/phpldapadmin/config
36 mv $fs/etc/phpldapadmin/config.php.example $fs/etc/phpldapadmin/config.php
37 cp $stuff/phpldapadmin.desktop $fs/usr/share/applications
38 chown -R www.www $fs/usr/share/phpldapadmin
39 chown -R www.www $fs/etc/phpldapadmin
40 chmod 700 $fs/etc/phpldapadmin
41 chmod 600 $fs/etc/phpldapadmin/config.php
42 }
44 post_install()
45 {
46 if [ -s "$1/etc/openldap/slapd.conf" ]
47 then
48 rootdn=$(awk '/^rootdn/ { print $2 }' < "$1/etc/openldap/slapd.conf" | sed 's/"//g')
49 sed -i "s|'login','dn','');|'login','dn','');\\n\$ldapservers->SetValue(\$i,'login','dn','$rootdn');|" \
50 "$1/etc/phpldapadmin/config.php"
51 chown 80.80 "$1/etc/phpldapadmin/config.php"
52 fi
54 # Configure lighttpd server
55 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
56 then
57 if ! grep -q /usr/share/phpldapadmin/ "$1/etc/lighttpd/lighttpd.conf"
58 then
59 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpldapadmin/" => "/usr/share/phpldapadmin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
60 if [ -z "$1" ]
61 then
62 # Start Web server.
63 /etc/init.d/lighttpd stop
64 /etc/init.d/lighttpd start
65 fi
66 fi
67 fi
69 # Configure apache server
70 if [ -f "$1/etc/apache/httpd.conf" ]
71 then
72 if [ ! -f "$1/etc/apache/conf.d/phpldapadmin" ]
73 then
74 cat > "$1/etc/apache/conf.d/phpldapadmin" <<EOT
75 <IfModule mod_alias.c>
76 Alias /phpldapadmin /usr/share/phpldapadmin
77 </IfModule>
78 <DirectoryMatch /usr/share/phpldapadmin/>
79 DirectoryIndex index.php
80 Options +FollowSymLinks
81 AllowOverride None
82 Order allow,deny
83 Allow from all
84 </DirectoryMatch>
85 EOT
86 if [ -z "$1" ]
87 then
88 # Start Web server.
89 /etc/init.d/apache stop
90 /etc/init.d/apache start
91 fi
92 fi
93 fi
94 cat <<EOT
95 ------
96 Login DN and password are found in /etc/openldap/slapd.conf with rootdn and rootpw keywords:
97 $(grep ^rootdn "$1/etc/openldap/slapd.conf")
98 $(grep ^rootpw "$1/etc/openldap/slapd.conf")
99 ------
100 EOT
101 }