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