wok annotate daloradius/receipt @ rev 24508
updated ed (1.15 -> 1.18)
author | Hans-G?nter Theisgen |
---|---|
date | Sun Feb 20 17:14:34 2022 +0100 (2022-02-20) |
parents | 8bed0ad1f0db |
children | 8ea0030e77cb |
rev | line source |
---|---|
pascal@18275 | 1 # SliTaz package receipt. |
pascal@18275 | 2 |
pascal@18275 | 3 PACKAGE="daloradius" |
Hans-G?nter@24461 | 4 VERSION="1.1-2" |
pascal@18275 | 5 CATEGORY="network" |
pascal@18275 | 6 SHORT_DESC="A RADIUS web platform for managing Hotspots." |
pascal@18275 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@18275 | 8 LICENSE="GPL2" |
pascal@18275 | 9 WEB_SITE="http://www.daloradius.com/" |
Hans-G?nter@24461 | 10 |
Hans-G?nter@24461 | 11 TARBALL="$PACKAGE-$VERSION.zip" |
pascal@18275 | 12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" |
pascal@18275 | 13 |
al@20474 | 14 DEPENDS="php-gd php-mysql freeradius" |
pascal@18275 | 15 |
pascal@24385 | 16 # What is the latest version available today? |
pascal@24385 | 17 current_version() |
pascal@24385 | 18 { |
pascal@24385 | 19 wget -O - https://sourceforge.net/projects/daloradius/files/daloradius/ 2>/dev/null | \ |
pascal@24506 | 20 sed '/scope="row/!d;/daloradius\/daloradius/!d;/zip/!d;s|.*/daloradius/daloradius-*||;s|.zip.*||;q' |
pascal@24385 | 21 } |
pascal@24385 | 22 |
pascal@18275 | 23 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@18275 | 24 genpkg_rules() |
pascal@18275 | 25 { |
Hans-G?nter@24461 | 26 mkdir -p $fs/usr/share/daloradius |
Hans-G?nter@24461 | 27 mkdir -p $fs/etc/mysql.d |
Hans-G?nter@24461 | 28 |
Hans-G?nter@24461 | 29 cp -a $src/* $fs/usr/share/daloradius |
Hans-G?nter@24461 | 30 mv $fs/usr/share/daloradius/daloradius/library/daloradius.conf.php \ |
Hans-G?nter@24461 | 31 $fs/etc/ |
Hans-G?nter@24461 | 32 ln -s /etc/daloradius.conf.php $fs/usr/share/daloradius/daloradius/library/daloradius.conf.php |
pascal@18275 | 33 cat > $fs/etc/mysql.d/daloradius <<EOT |
pascal@18275 | 34 #!/bin/sh |
pascal@18275 | 35 |
pascal@18275 | 36 mysqldump readius > /dev/null 2>&1 | grep -qi daloradius || |
pascal@18275 | 37 mysql -u root radius < /usr/share/daloradius/contrib/db/mysql-daloradius.sql |
pascal@18275 | 38 chmod -x /etc/mysql.d/daloradius |
pascal@18275 | 39 EOT |
pascal@18275 | 40 chmod 755 $fs/etc/mysql.d/daloradius |
pascal@18275 | 41 } |
pascal@18275 | 42 |
pascal@18275 | 43 post_install() |
pascal@18275 | 44 { |
pascal@18275 | 45 # Configure lighttpd server |
Hans-G?nter@24461 | 46 if [ -f "$1/etc/lighttpd/lighttpd.conf" ] |
Hans-G?nter@24461 | 47 then |
Hans-G?nter@24461 | 48 if ! grep -q /usr/share/daloradius/ "$1/etc/lighttpd/lighttpd.conf" |
Hans-G?nter@24461 | 49 then |
pascal@18730 | 50 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/daloradius/" => "/usr/share/daloradius/",|g' -i "$1/etc/lighttpd/lighttpd.conf" |
Hans-G?nter@24461 | 51 if [ -z "$1" ] |
Hans-G?nter@24461 | 52 then |
pascal@18275 | 53 # Start Web server. |
pascal@18275 | 54 /etc/init.d/lighttpd stop |
pascal@18275 | 55 /etc/init.d/lighttpd start |
pascal@18275 | 56 fi |
pascal@18275 | 57 fi |
pascal@18275 | 58 fi |
pascal@18275 | 59 # Configure apache server |
Hans-G?nter@24461 | 60 if [ -f "$1/etc/apache/httpd.conf" ] |
Hans-G?nter@24461 | 61 then |
Hans-G?nter@24461 | 62 if [ ! -f "$1/etc/apache/conf.d/daloradius" ] |
Hans-G?nter@24461 | 63 then |
pascal@18730 | 64 cat > "$1/etc/apache/conf.d/daloradius" <<EOT |
pascal@18275 | 65 <IfModule mod_alias.c> |
pascal@18275 | 66 Alias /daloradius /usr/share/daloradius |
pascal@18275 | 67 </IfModule> |
pascal@18275 | 68 <Directory /usr/share/daloradius/> |
pascal@18275 | 69 DirectoryIndex index.php |
pascal@18275 | 70 Options +FollowSymLinks |
pascal@18275 | 71 AllowOverride None |
pascal@18275 | 72 Order allow,deny |
pascal@18275 | 73 Allow from all |
pascal@18275 | 74 </Directory> |
pascal@18275 | 75 EOT |
Hans-G?nter@24461 | 76 if [ -z "$1" ] |
Hans-G?nter@24461 | 77 then |
pascal@18275 | 78 # Start Web server. |
pascal@18275 | 79 /etc/init.d/apache stop |
pascal@18275 | 80 /etc/init.d/apache start |
pascal@18275 | 81 fi |
pascal@18275 | 82 fi |
pascal@18275 | 83 fi |
pascal@18275 | 84 } |