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