wok-next view daloradius/receipt @ rev 21071

Update atkmm, cairo, cmake, db, elfutils, emacs, glib, glib-networking, glibmm, gobject-introspection, libsigc++, meson, openssl, zstd
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Dec 13 00:46:54 2018 +0200 (2018-12-13)
parents 9e01bc6321ea
children
line source
1 # SliTaz package receipt v2.
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 WEB_SITE="http://daloradius.com/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
14 genpkg_rules() {
15 mkdir -p $fs/usr/share/daloradius $fs/etc/mysql.d
16 cp -a $src/* $fs/usr/share/daloradius
17 mv $fs/usr/share/daloradius/library/daloradius.conf.php $fs/etc/
18 ln -s /etc/daloradius.conf.php $fs/usr/share/daloradius/library/daloradius.conf.php
19 cat > $fs/etc/mysql.d/daloradius <<EOT
20 #!/bin/sh
22 mysqldump readius > /dev/null 2>&1 | grep -qi daloradius ||
23 mysql -u root radius < /usr/share/daloradius/contrib/db/mysql-daloradius.sql
24 chmod -x /etc/mysql.d/daloradius
25 EOT
26 chmod 755 $fs/etc/mysql.d/daloradius
27 DEPENDS="php-gd php-mysql freeradius"
28 }
30 post_install() {
31 # Configure lighttpd server
32 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
33 if ! grep -q /usr/share/daloradius/ "$1/etc/lighttpd/lighttpd.conf"; then
34 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/daloradius/" => "/usr/share/daloradius/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
35 if [ -z "$1" ]; then
36 # Start Web server.
37 /etc/init.d/lighttpd stop
38 /etc/init.d/lighttpd start
39 fi
40 fi
41 fi
42 # Configure apache server
43 if [ -f "$1/etc/apache/httpd.conf" ]; then
44 if [ ! -f "$1/etc/apache/conf.d/daloradius" ]; then
45 cat > "$1/etc/apache/conf.d/daloradius" <<EOT
46 <IfModule mod_alias.c>
47 Alias /daloradius /usr/share/daloradius
48 </IfModule>
49 <Directory /usr/share/daloradius/>
50 DirectoryIndex index.php
51 Options +FollowSymLinks
52 AllowOverride None
53 Order allow,deny
54 Allow from all
55 </Directory>
56 EOT
57 if [ -z "$1" ]; then
58 # Start Web server.
59 /etc/init.d/apache stop
60 /etc/init.d/apache start
61 fi
62 fi
63 fi
64 }