# Recipe (MakeRecipe) for Iwlwifi by Daniele Maccari, on Mon Jan 7 15:32:44 CET 2008
# Recipe for version 1.2.23 by Daniele Maccari, on Mon Jan 7 15:32:44 CET 2008
compile_version=1.10.0
url="http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-1.2.23.tgz"
#file="iwlwifi-1.2.23.tgz"
file_size=363312
file_md5=0a6ae714ba5cb22d55f6b6fd2e29dc2d
recipe_type=makefile
makefile='Makefile'

unmanaged_files=(
	"$goboModules/$(uname -r)/kernel/drivers/net/wireless/iwl3945.ko"
	"$goboModules/$(uname -r)/kernel/drivers/net/wireless/iwl4965.ko"

)

build_variables=(
	"DEVMOD=y"
)

pre_build(){
	#Check for mac80211
	if ! zcat $goboStatus/config.gz | grep -q "CONFIG_MAC80211=[m,y]"; then
		Log_Error "Your kernel does not support mac80211 stack or \
			configuration could not be read. Make sure you have enabled \
			CONFIG_MAC80211=y/m in your kernel or reconfigure your kernel \
			to include it."
		Ask_Continue "Do you want to continue anyway? (Not recommended \
			unless you know what you do)"
	fi
	
	#Check for patches to apply
	make check_inc source
}

post_install(){
	if zcat $goboStatus/config.gz | grep -q "CONFIG_MAC80211=m"; then
		echo You seem to have the mac80211 stack built as a module.\
			Be sure to load it at startup in order to use this driver.
	fi

	# Make a note that this is a third part module that needs
	# recompiling with a new kernel
	mkdir -p ${target}/Shared/Compile/Recompile/Linux/
	touch ${target}/Shared/Compile/Recompile/Linux/Iwlwifi
}
