Hi Hanno,

Here is a package patch you or others can try instead. The chilli
configuration comes out of one or more /etc/config/chilli UCI objects.
Each 'option' is a chilli option and 'tundev' is required (use tun0,
tun1, etc). If it works for you, we can make it a formal patch
submission. 

Cheers,
David

On Sat, 2012-12-29 at 11:43 +1300, Hanno Schupp wrote:
> Dear All,
> 
> I am trying to get coova-chilli 1.3.0 supported, but the compile
> process is failing. Usually it is just a matter of updating the
> version number nad md5 checksum to get the upgrade happening, like so:
> #
> # Copyright (C) 2007-2010 OpenWrt.org
> #
> # This is free software, licensed under the GNU General Public License
> v2.
> # See /LICENSE for more information.
> #
> 
> include $(TOPDIR)/rules.mk
> 
> PKG_NAME:=coova-chilli
> +PKG_VERSION:=1.3.0
> -PKG_VERSION:=1.2.9
> PKG_RELEASE:=1
> 
> PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> PKG_SOURCE_URL:=http://ap.coova.org/chilli
> +PKG_MD5SUM:=dc0037e3cdebcb60508081b4e42e984a
> -PKG_MD5SUM:=a493d0562fc3b05fe86d8ad65f7f2dc0
> 
> PKG_FIXUP:=autoreconf
> PKG_INSTALL:=1
> 
> 
> That usually does the trick, however, I am getting a compile error
> caused by a libtool version mismatch when compileing on my Ubuntu
> 12.04 LTS x64 machine:
> 
> Compile log:
> ...
> config.status: executing libtool commands
> make[3]: Leaving directory
> `/home/hanno/attitude/build_dir/target-mips_r2_uClibc-0.9.33.2/coova-chilli-1.3.0'
> make[3]: Entering directory
> `/home/hanno/attitude/build_dir/target-mips_r2_uClibc-0.9.33.2/coova-chilli-1.3.0'
> (CDPATH="${ZSH_VERSION+.}:" && cd .
> && /bin/bash 
> /home/hanno/attitude/build_dir/target-mips_r2_uClibc-0.9.33.2/coova-chilli-1.3.0/missing
>  --run autoheader)
> rm -f stamp-h1
> touch config.h.in
> cd . && /bin/bash ./config.status config.h
> config.status: creating config.h
> config.status: config.h is unchanged
> make  all-recursive
> make[4]: Entering directory
> `/home/hanno/attitude/build_dir/target-mips_r2_uClibc-0.9.33.2/coova-chilli-1.3.0'
> Making all in bstring
> make[5]: Entering directory
> `/home/hanno/attitude/build_dir/target-mips_r2_uClibc-0.9.33.2/coova-chilli-1.3.0/bstring'
> /bin/bash ../libtool --tag=CC   --mode=compile
> mips-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H -I. -I..
> -I/home/hanno/attitude/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include 
> -I/home/hanno/attitude/staging_dir/target-mips_r2_uClibc-0.9.33.2/include 
> -I/home/hanno/attitude/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include
>  
> -I/home/hanno/attitude/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include
>    -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts 
> -Wno-error=unused-but-set-variable -msoft-float  -MT bstrlib.lo -MD -MP -MF 
> .deps/bstrlib.Tpo -c -o bstrlib.lo bstrlib.c
> libtool: Version mismatch error.  This is libtool 2.4.2
> Debian-2.4.2-1ubuntu1, but the
> libtool: definition of this LT_INIT comes from libtool 2.4.
> libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2
> Debian-2.4.2-1ubuntu1
> libtool: and run autoconf again.
> make[5]: *** [bstrlib.lo] Error 63
> ...
> 
> I have tried various techniques such as adding the directives below in
> coova-chilli's Makefile but to no avail. I have also tried to update
> the libtool package to version 2.4.2 in the buildroot toolchain, but
> then other packages fail to compile (i.e. liboping).
> PKG_FIXUP:=autoreconf patch-libtool
> PKG_REMOVE_FILES:=aclocal.m4
> 
> What else could be done to get coova 1.3.0 compiled? Since it is said
> to be lighter on memory usage than previous versions it may be an
> attractive release for embedded systems.
> 
> Cheers
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

diff -upNr coova-chilli/files/chilli.firewall coova-chilli-new/files/chilli.firewall
--- coova-chilli/files/chilli.firewall	1969-12-31 16:00:00.000000000 -0800
+++ coova-chilli-new/files/chilli.firewall	2012-12-28 16:31:04.000000000 -0800
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+chilli_firewall() {
+    local cfg="$1"
+
+    local network ifname tun
+
+    config_get network "$cfg" network
+
+    . /lib/functions/network.sh
+    network_get_device ifname ${network:-lan}
+
+    if [ "$ifname" = "" ]
+    then
+	config_get ifname "$cfg" dhcpif
+    fi
+
+    config_get tun "$cfg" tundev
+
+    for n in ACCEPT DROP REJECT
+    do
+	iptables -F zone_${network}_${n}
+	iptables -I zone_${network}_${n} -i $tun -j $n
+	iptables -I zone_${network}_${n} -o $tun -j $n
+    done
+    
+    iptables -D forward -i ${ifname} -j zone_${network}_forward
+    iptables -A forward -i ${ifname} -j DROP
+    iptables -A forward -i $tun -j zone_${network}_forward
+    
+    iptables -D input -i ${ifname} -j zone_${network}
+    iptables -A input -i $tun -j zone_${network}
+    
+    iptables -I zone_${network} -p tcp --dport 3990 -j ACCEPT
+    iptables -I zone_${network} -p tcp --dport 3991 -j ACCEPT
+}
+
+chilli_post_core_cb() {
+    config_load chilli
+    config_foreach chilli_firewall chilli
+}
diff -upNr coova-chilli/files/chilli.init coova-chilli-new/files/chilli.init
--- coova-chilli/files/chilli.init	1969-12-31 16:00:00.000000000 -0800
+++ coova-chilli-new/files/chilli.init	2012-12-28 16:46:03.000000000 -0800
@@ -0,0 +1,61 @@
+#!/bin/sh /etc/rc.common
+                                    
+START=30
+STOP=90
+
+config_cb() { 
+    chilli_inst=$2
+    if [ "$chilli_inst" != "" ]
+    then
+	rm -f /var/run/chilli_${chilli_inst}*
+	chilli_conf=/var/run/chilli_${chilli_inst}.conf
+	eval "start_chilli_$chilli_inst=1"
+    fi
+}
+
+option_cb() {
+    case "$1" in
+        # UCI settings
+	network)
+	    . /lib/functions/network.sh
+	    local ifname
+	    network_get_device ifname $2
+	    echo "dhcpif=\"$ifname\"" >> $chilli_conf
+	    ;;
+	disabled)
+	    eval "start_chilli_$chilli_inst=0"
+	    ;;
+        # boolean settings
+	dhcpbroadcast|nodynip|vlanlocation|locationstopstart|locationcopycalled|locationimmediateupdate|locationopt82|coanoipcheck|noradallow|proxymacaccept|proxyonacct|dhcpmacset|dhcpradius|noc2c|eapolenable|uamanydns|uamanyip|uamnatanyip|nouamsuccess|nowispr1|nowispr2|domaindnslocal|radsec|macauth|macreauth|macauthdeny|macallowlocal|strictmacauth|strictdhcp|ieee8021q|only8021q|radiusoriginalurl|swapoctets|statusfilesave|wpaguests|openidauth|papalwaysok|mschapv2|chillixml|acctupdate|dnsparanoia|seskeepalive|usetap|noarpentries|framedservice|scalewin|redir|injectwispr|redirurl|routeonetone|nousergardendata|uamgardendata|uamotherdata|withunixipc|uamallowpost|redirssl|uamuissl|layer3|patricia|redirdnsreq|dhcpnotidle|ipv6|ipv6only)
+	    [ "$2" = "true" -o "$2" = "1" ] && echo "$1" >> $chilli_conf
+	    ;;
+	*)
+	    echo "$1=\"$2\"" >> $chilli_conf
+	    ;;
+    esac
+}
+
+start_chilli() {
+    local cfg="$1"
+    local start_chilli=$(eval "echo \$start_chilli_$cfg")
+    [ "$start_chilli" = "0" ] && return
+    local base=/var/run/chilli_${cfg}
+    chilli -c ${base}.conf \
+	--pidfile ${base}.pid \
+	--cmdsocket ${base}.sock \
+	--unixipc ${base}.ipc &
+}
+
+start() {
+    config_load chilli
+    config_foreach start_chilli chilli
+}
+
+stop() {                                                       
+    ls /var/run/chilli*.pid 2>/dev/null && {
+	kill $(cat /var/run/chilli*.pid)
+	sleep 1
+	killall -9 chilli
+	rm -f /var/run/chilli*
+    }
+}
diff -upNr coova-chilli/Makefile coova-chilli-new/Makefile
--- coova-chilli/Makefile	2012-12-28 16:38:17.000000000 -0800
+++ coova-chilli-new/Makefile	2012-12-28 16:38:23.000000000 -0800
@@ -8,15 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coova-chilli
-PKG_VERSION:=1.2.9
+PKG_VERSION:=1.3.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://ap.coova.org/chilli
-PKG_MD5SUM:=a493d0562fc3b05fe86d8ad65f7f2dc0
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
+PKG_SOURCE_URL:=http://coova-chilli.s3.amazonaws.com/
+PKG_MD5SUM:=dc0037e3cdebcb60508081b4e42e984a
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -25,33 +22,102 @@ define Package/coova-chilli
   SECTION:=net
   CATEGORY:=Network
   DEPENDS:=+kmod-tun +librt
-  TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
-  URL:=http://www.coova.org/CoovaChilli
+  TITLE:=Wireless LAN HotSpot controller
+  URL:=http://www.coova.org/
+endef
+
+define Package/coova-chilli-miniportal
+  SUBMENU:=Captive Portals
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+coova-chilli
+  TITLE:=CoovaChilli MiniPortal
+  URL:=http://www.coova.org/
 endef
 
 define Package/coova-chilli/description
 	CoovaChilli is an open source access controller for wireless LAN
 	access points and is based on ChilliSpot. It is used for authenticating
 	users of a wireless (or wired) LAN. It supports web based login (UAM)
-	which is today's standard for public HotSpots and it supports Wireless
-	Protected Access (WPA) which is the standard of the future.
-	Authentication,	authorization and accounting (AAA) is handled by your
-	favorite radius server.
+	which is today's standard for public HotSpots and it supports Wireless Protected
+	Access (WPA) which is the standard of the future. Authentication,
+	authorization and accounting (AAA) is handled by your favorite
+	radius server.
 endef
 
-define Package/coova-chilli/conffiles
-/etc/chilli.conf
+define Build/Configure
+  (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
+		$(TARGET_CONFIGURE_OPTS) \
+                CFLAGS="$(strip $(TARGET_CFLAGS)) -DNEED_DN_SKIPNAME" \
+                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+                LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
+		ac_cv_func_malloc_0_nonnull=yes \
+		ac_cv_func_realloc_0_nonnull=yes \
+		ac_cv_func_memcmp_working=yes \
+		ac_cv_func_setvbuf_reversed=no \
+                ./configure \
+			--target=$(GNU_TARGET_NAME) \
+			--host=$(GNU_TARGET_NAME) \
+			--build=$(GNU_HOST_NAME) \
+			--program-prefix="" \
+			--program-suffix="" \
+			--prefix=/usr \
+			--sysconfdir=/etc \
+			--exec-prefix=/usr \
+			--bindir=/usr/bin \
+			--datadir=/usr/share \
+			--includedir=/usr/include \
+			--infodir=/usr/share/info \
+			--libdir=/usr/lib \
+			--libexecdir=/usr/lib \
+			--localstatedir=/var \
+			--mandir=/usr/share/man \
+			--sbindir=/usr/sbin \
+			--enable-shared \
+			--disable-static \
+			--with-gnu-ld \
+			--enable-miniconfig \
+			--enable-miniportal \
+			--enable-chilliredir \
+			--enable-chilliproxy \
+			--enable-binstatusfile \
+        );
 endef
 
-define Package/coova-chilli/install
-	$(INSTALL_DIR) $(1)/etc
-	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
+define Build/Compile
+	$(MAKE) -C $(PKG_BUILD_DIR) \
+		DESTDIR="$(PKG_INSTALL_DIR)" \
+		all install
+endef
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/
+endef
+
+
+define Package/coova-chilli-miniportal/install
 	$(INSTALL_DIR) $(1)/etc/chilli
-	$(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/
+	$(CP) $(PKG_INSTALL_DIR)/etc/chilli/www $(1)/etc/chilli/
+endef
+
+define Package/coova-chilli/install
+	$(INSTALL_DIR) $(1)/etc/chilli 
+	$(CP) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
+	$(CP) $(PKG_INSTALL_DIR)/etc/chilli/up.sh $(1)/etc/chilli/
+	$(CP) $(PKG_INSTALL_DIR)/etc/chilli/down.sh $(1)/etc/chilli/
+	$(CP) $(PKG_INSTALL_DIR)/etc/chilli/wwwsh $(1)/etc/chilli/
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(CP) files/chilli.init $(1)/etc/init.d/chilli
+	$(INSTALL_DIR) $(1)/lib/firewall
+	$(CP) files/chilli.firewall $(1)/lib/firewall/chilli.sh
 	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
 	$(INSTALL_DIR) $(1)/usr/lib/
 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,coova-chilli))
+$(eval $(call BuildPackage,coova-chilli-miniportal))
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to