# SliTaz package receipt.

PACKAGE="coova-chilli"
VERSION="1.3.0"
CATEGORY="network"
SHORT_DESC="Captive portal or wireless LAN access point controller."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL3"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://www.coova.org/CoovaChilli"
WGET_URL="https://coova.github.io/coova-chilli/$TARBALL"

DEPENDS="libssl curl libidn"
BUILD_DEPENDS="openssl-dev curl-dev"

# What is the latest version available today?
current_version()
{
	wget -O - https://github.com/coova/coova-chilli/releases 2>/dev/null | \
	sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
	./configure  --prefix=/usr --mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--sysconfdir=/etc --localstatedir=/var --enable-largelimits \
		--enable-binstatusfile --enable-statusfile --enable-chilliproxy \
		--enable-chilliradsec --enable-chilliredir --with-openssl --with-curl \
		--with-poll --enable-dhcpopt --enable-sessgarden --enable-dnslog \
		--enable-ipwhitelist --enable-redirdnsreq --enable-miniconfig \
		--enable-libjson --enable-layer3 --enable-proxyvsa --enable-miniportal \
		--enable-chilliscript --enable-eapol --enable-uamdomainfile \
		--enable-modules --enable-multiroute \
		$CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/lib/coova-chilli
	cp -a $install/usr/lib/coova-chilli/*.so* $fs/usr/lib/
	cp -a $install/usr/lib/*.so* $fs/usr/lib/
	cp -a $install/usr/sbin $fs/usr/
	cp -a $install/etc $fs/
}