wok-current view phpldapadmin/receipt @ rev 16349

ARM: remove pkgs that dont build (php is even not cross compiled and python modules are hard to cross)
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 13 02:20:46 2014 +0200 (2014-04-13)
parents 78cb1e930abd
children 97679aef4f16
line source
1 # SliTaz package receipt.
3 PACKAGE="phpldapadmin"
4 VERSION="1.2.1"
5 CATEGORY="misc"
6 SHORT_DESC="Administration of LDAP over the Web."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tgz"
10 WEB_SITE="http://phpldapadmin.sourceforge.net/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 CONFIG_FILES="/etc/phpldapadmin/config.php"
13 HOST_ARCH="any"
15 DEPENDS="php-ldap"
17 # Rules to gen a SliTaz package suitable for Tazpkg.
18 genpkg_rules()
19 {
20 mkdir -p $fs/usr/share/phpldapadmin $fs/etc $fs/usr/share/applications
21 cp -a $src/. $fs/usr/share/phpldapadmin
22 mv $fs/usr/share/phpldapadmin/config $fs/etc/phpldapadmin
23 ln -s /etc/phpldapadmin $fs/usr/share/phpldapadmin/config
24 mv $fs/etc/phpldapadmin/config.php.example $fs/etc/phpldapadmin/config.php
25 cp $stuff/phpldapadmin.desktop $fs/usr/share/applications
26 chown -R www.www $fs/usr/share/phpldapadmin $fs/etc/phpldapadmin
27 chmod 700 $fs/etc/phpldapadmin
28 chmod 600 $fs/etc/phpldapadmin/config.php
29 }
31 post_install()
32 {
33 if [ -s $1/etc/openldap/slapd.conf ]; then
34 rootdn=$(awk '/^rootdn/ { print $2 }' < $1/etc/openldap/slapd.conf | sed 's/"//g')
35 sed -i "s|'login','dn','');|'login','dn','');\\n\$ldapservers->SetValue(\$i,'login','dn','$rootdn');|" $1/etc/phpldapadmin/config.php
36 chown 80.80 $1/etc/phpldapadmin/config.php
37 fi
38 # Configure lighttpd server
39 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
40 if ! grep -q /usr/share/phpldapadmin/ $1/etc/lighttpd/lighttpd.conf; then
41 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpldapadmin/" => "/usr/share/phpldapadmin/",|g' -i $1/etc/lighttpd/lighttpd.conf
42 if [ -z "$1" ]; then
43 # Start Web server.
44 /etc/init.d/lighttpd stop
45 /etc/init.d/lighttpd start
46 fi
47 fi
48 fi
49 # Configure apache server
50 if [ -f $1/etc/apache/httpd.conf ]; then
51 if [ ! -f $1/etc/apache/conf.d/phpldapadmin ]; then
52 cat > $1/etc/apache/conf.d/phpldapadmin <<EOT
53 <IfModule mod_alias.c>
54 Alias /phpldapadmin /usr/share/phpldapadmin
55 </IfModule>
56 <DirectoryMatch /usr/share/phpldapadmin/>
57 DirectoryIndex index.php
58 Options +FollowSymLinks
59 AllowOverride None
60 Order allow,deny
61 Allow from all
62 </DirectoryMatch>
63 EOT
64 if [ -z "$1" ]; then
65 # Start Web server.
66 /etc/init.d/apache stop
67 /etc/init.d/apache start
68 fi
69 fi
70 fi
71 cat <<EOT
72 ------
73 Login DN and password are found in /etc/openldap/slapd.conf with rootdn and rootpw keywords:
74 $(grep ^rootdn $1/etc/openldap/slapd.conf)
75 $(grep ^rootpw $1/etc/openldap/slapd.conf)
76 ------
77 EOT
78 }