wok annotate freeradius-dialupadmin/receipt @ rev 1348

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