wok-next annotate daloradius/receipt @ rev 21020
Cleaning is almost finished... I should proceed to upgrades.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Nov 02 14:15:08 2018 +0200 (2018-11-02) |
parents | 9e01bc6321ea |
children |
rev | line source |
---|---|
al@21020 | 1 # SliTaz package receipt v2. |
pascal@18275 | 2 |
pascal@18275 | 3 PACKAGE="daloradius" |
pascal@18275 | 4 VERSION="0.9-9" |
pascal@18275 | 5 CATEGORY="network" |
al@21020 | 6 SHORT_DESC="A RADIUS web platform for managing Hotspots" |
pascal@18275 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@18275 | 8 LICENSE="GPL2" |
al@21020 | 9 WEB_SITE="http://daloradius.com/" |
al@21020 | 10 |
pascal@18275 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@18275 | 12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" |
pascal@18275 | 13 |
al@21020 | 14 genpkg_rules() { |
pascal@18275 | 15 mkdir -p $fs/usr/share/daloradius $fs/etc/mysql.d |
pascal@18275 | 16 cp -a $src/* $fs/usr/share/daloradius |
pascal@18275 | 17 mv $fs/usr/share/daloradius/library/daloradius.conf.php $fs/etc/ |
pascal@18275 | 18 ln -s /etc/daloradius.conf.php $fs/usr/share/daloradius/library/daloradius.conf.php |
pascal@18275 | 19 cat > $fs/etc/mysql.d/daloradius <<EOT |
pascal@18275 | 20 #!/bin/sh |
pascal@18275 | 21 |
pascal@18275 | 22 mysqldump readius > /dev/null 2>&1 | grep -qi daloradius || |
pascal@18275 | 23 mysql -u root radius < /usr/share/daloradius/contrib/db/mysql-daloradius.sql |
pascal@18275 | 24 chmod -x /etc/mysql.d/daloradius |
pascal@18275 | 25 EOT |
pascal@18275 | 26 chmod 755 $fs/etc/mysql.d/daloradius |
al@21020 | 27 DEPENDS="php-gd php-mysql freeradius" |
pascal@18275 | 28 } |
pascal@18275 | 29 |
al@21020 | 30 post_install() { |
pascal@18275 | 31 # Configure lighttpd server |
pascal@18730 | 32 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then |
pascal@18730 | 33 if ! grep -q /usr/share/daloradius/ "$1/etc/lighttpd/lighttpd.conf"; then |
al@21020 | 34 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/daloradius/" => "/usr/share/daloradius/",|g' -i "$1/etc/lighttpd/lighttpd.conf" |
pascal@18275 | 35 if [ -z "$1" ]; then |
pascal@18275 | 36 # Start Web server. |
pascal@18275 | 37 /etc/init.d/lighttpd stop |
pascal@18275 | 38 /etc/init.d/lighttpd start |
pascal@18275 | 39 fi |
pascal@18275 | 40 fi |
pascal@18275 | 41 fi |
pascal@18275 | 42 # Configure apache server |
pascal@18730 | 43 if [ -f "$1/etc/apache/httpd.conf" ]; then |
pascal@18730 | 44 if [ ! -f "$1/etc/apache/conf.d/daloradius" ]; then |
pascal@18730 | 45 cat > "$1/etc/apache/conf.d/daloradius" <<EOT |
pascal@18275 | 46 <IfModule mod_alias.c> |
pascal@18275 | 47 Alias /daloradius /usr/share/daloradius |
pascal@18275 | 48 </IfModule> |
pascal@18275 | 49 <Directory /usr/share/daloradius/> |
pascal@18275 | 50 DirectoryIndex index.php |
pascal@18275 | 51 Options +FollowSymLinks |
pascal@18275 | 52 AllowOverride None |
pascal@18275 | 53 Order allow,deny |
pascal@18275 | 54 Allow from all |
pascal@18275 | 55 </Directory> |
pascal@18275 | 56 EOT |
pascal@18275 | 57 if [ -z "$1" ]; then |
pascal@18275 | 58 # Start Web server. |
pascal@18275 | 59 /etc/init.d/apache stop |
pascal@18275 | 60 /etc/init.d/apache start |
pascal@18275 | 61 fi |
pascal@18275 | 62 fi |
pascal@18275 | 63 fi |
pascal@18275 | 64 } |