--- ./package/network/hostapd/hostapd.conf	2008-08-04 23:56:36.000000000 +0100
+++ ./package/network/hostapd/hostapd.conf	2008-08-18 14:19:41.000000000 +0100
@@ -12,5 +12,16 @@
 # GNU General Public License can be found in the file COPYING.
 # --- T2-COPYRIGHT-NOTE-END ---
 
+config() {
+	cp -v ./defconfig .config
+	
+	if pkginstalled madwifi; then
+		echo CONFIG_DRIVER_MADWIFI=y>>.config
+		echo CFLAGS += -I./madwifi>>.config
+		
+		tar ${taropt%f} --exclude $x/Makefile -f `match_source_file -p madwifi`
+	fi
+}
+
 hook_add preconf 3 'cd hostapd'
-hook_add premake 3 'cp -v ./defconfig .config'
+hook_add premake 3 "config"
--- ./package/network/hostapd/hostapd.desc	2008-08-17 17:31:23.000000000 +0100
+++ ./package/network/hostapd/hostapd.desc	2008-08-20 20:26:51.000000000 +0100
@@ -35,3 +35,4 @@
 [P] X -----5---9 800.000
 
 [D] 1869787736 hostapd-0.6.4.tar.gz http://hostap.epitest.fi/releases/
+[D] X madwifi-r3837.tar.gz svn+http://svn.madwifi.org/madwifi/trunk/ madwifi -r3837
