wok-6.x view freeradius-dialupadmin/receipt @ rev 1833
php-*: fix post_install
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Dec 10 17:20:52 2008 +0000 (2008-12-10) |
parents | 79d7b34e8525 |
children | bd6010223726 |
line source
1 # SliTaz package receipt.
3 PACKAGE="freeradius-dialupadmin"
4 VERSION="2.1.1"
5 CATEGORY="network"
6 SHORT_DESC="radius server web interface"
7 MAINTAINER="Serge Daigle sdaigl@lacitec.on.ca"
8 DEPENDS="php"
9 WEB_SITE="http://www.freeradius.org/"
10 WANTED="freeradius"
11 CONFIG_FILES="/etc/dialupadmin"
13 # Rules to gen a SliTaz package suitable for Tazpkg.
14 genpkg_rules()
15 {
16 src=$(cd ../freeradius/freeradius-server-$VERSION; pwd)
17 mkdir -p $fs/usr/share $fs/etc/dialupadmin
18 cp -a $src/dialup_admin $fs/usr/share
19 cp -a $src/dialup_admin/conf/* $fs/etc/dialupadmin
20 rm -rf $fs/usr/share/dialup_admin/conf
21 ln -s /etc/dialupadmin $fs/usr/share/dialup_admin
22 }
24 post_install()
25 {
26 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
27 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
28 etc/dialupadmin
29 EOT
30 # Configure lighttpd server
31 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
32 if ! grep -q /usr/share/dialup_admin/ $1/etc/lighttpd/lighttpd.conf; then
33 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/dialupadmin/" => "/usr/share/dialup_admin/htdocs/",|g' -i $1/etc/lighttpd/lighttpd.conf
34 if [ -z "$1" ]; then
35 # Start Web server.
36 /etc/init.d/lighttpd stop
37 /etc/init.d/lighttpd start
38 fi
39 fi
40 fi
41 # Configure apache server
42 if [ -f $1/etc/apache/httpd.conf ]; then
43 if [ ! -f $1/etc/apache/conf.d/phpldapadmin ]; then
44 cat > $1/etc/apache/conf.d/phpldapadmin <<EOT
45 <IfModule mod_alias.c>
46 Alias /dialupadmin /usr/share/dialup_admin/htdocs
47 </IfModule>
48 <DirectoryMatch /usr/share/dialup_admin/htdocs/>
49 DirectoryIndex index.html
50 Options +FollowSymLinks
51 AllowOverride None
52 Order allow,deny
53 Allow from all
54 </DirectoryMatch>
55 EOT
56 if [ -z "$1" ]; then
57 # Start Web server.
58 /etc/init.d/apache stop
59 /etc/init.d/apache start
60 fi
61 fi
62 fi
63 }
65 repack_cleanup()
66 {
67 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
68 }