wok annotate daloradius/receipt @ rev 24385
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 07 11:38:23 2022 +0000 (2022-02-07) |
parents | 8c864718b7b3 |
children | 8bed0ad1f0db |
rev | line source |
---|---|
pascal@18275 | 1 # SliTaz package receipt. |
pascal@18275 | 2 |
pascal@18275 | 3 PACKAGE="daloradius" |
pascal@18275 | 4 VERSION="0.9-9" |
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 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@18275 | 10 WEB_SITE="http://www.daloradius.com/" |
pascal@18275 | 11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" |
pascal@18275 | 12 |
al@20474 | 13 DEPENDS="php-gd php-mysql freeradius" |
pascal@18275 | 14 |
pascal@24385 | 15 # What is the latest version available today? |
pascal@24385 | 16 current_version() |
pascal@24385 | 17 { |
pascal@24385 | 18 wget -O - https://sourceforge.net/projects/daloradius/files/daloradius/ 2>/dev/null | \ |
pascal@24385 | 19 sed '/scope="row/!d;/daloradius\/daloradius/!d;s|.*/daloradius/daloradius-*||;s|/.*||;q' |
pascal@24385 | 20 } |
pascal@24385 | 21 |
pascal@18275 | 22 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@18275 | 23 genpkg_rules() |
pascal@18275 | 24 { |
pascal@18275 | 25 mkdir -p $fs/usr/share/daloradius $fs/etc/mysql.d |
pascal@18275 | 26 cp -a $src/* $fs/usr/share/daloradius |
pascal@18275 | 27 mv $fs/usr/share/daloradius/library/daloradius.conf.php $fs/etc/ |
pascal@18275 | 28 ln -s /etc/daloradius.conf.php $fs/usr/share/daloradius/library/daloradius.conf.php |
pascal@18275 | 29 cat > $fs/etc/mysql.d/daloradius <<EOT |
pascal@18275 | 30 #!/bin/sh |
pascal@18275 | 31 |
pascal@18275 | 32 mysqldump readius > /dev/null 2>&1 | grep -qi daloradius || |
pascal@18275 | 33 mysql -u root radius < /usr/share/daloradius/contrib/db/mysql-daloradius.sql |
pascal@18275 | 34 chmod -x /etc/mysql.d/daloradius |
pascal@18275 | 35 EOT |
pascal@18275 | 36 chmod 755 $fs/etc/mysql.d/daloradius |
pascal@18275 | 37 } |
pascal@18275 | 38 |
pascal@18275 | 39 post_install() |
pascal@18275 | 40 { |
pascal@18275 | 41 # Configure lighttpd server |
pascal@18730 | 42 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then |
pascal@18730 | 43 if ! grep -q /usr/share/daloradius/ "$1/etc/lighttpd/lighttpd.conf"; then |
pascal@18730 | 44 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 | 45 if [ -z "$1" ]; then |
pascal@18275 | 46 # Start Web server. |
pascal@18275 | 47 /etc/init.d/lighttpd stop |
pascal@18275 | 48 /etc/init.d/lighttpd start |
pascal@18275 | 49 fi |
pascal@18275 | 50 fi |
pascal@18275 | 51 fi |
pascal@18275 | 52 # Configure apache server |
pascal@18730 | 53 if [ -f "$1/etc/apache/httpd.conf" ]; then |
pascal@18730 | 54 if [ ! -f "$1/etc/apache/conf.d/daloradius" ]; then |
pascal@18730 | 55 cat > "$1/etc/apache/conf.d/daloradius" <<EOT |
pascal@18275 | 56 <IfModule mod_alias.c> |
pascal@18275 | 57 Alias /daloradius /usr/share/daloradius |
pascal@18275 | 58 </IfModule> |
pascal@18275 | 59 <Directory /usr/share/daloradius/> |
pascal@18275 | 60 DirectoryIndex index.php |
pascal@18275 | 61 Options +FollowSymLinks |
pascal@18275 | 62 AllowOverride None |
pascal@18275 | 63 Order allow,deny |
pascal@18275 | 64 Allow from all |
pascal@18275 | 65 </Directory> |
pascal@18275 | 66 EOT |
pascal@18275 | 67 if [ -z "$1" ]; then |
pascal@18275 | 68 # Start Web server. |
pascal@18275 | 69 /etc/init.d/apache stop |
pascal@18275 | 70 /etc/init.d/apache start |
pascal@18275 | 71 fi |
pascal@18275 | 72 fi |
pascal@18275 | 73 fi |
pascal@18275 | 74 } |