### this file is sourced not run
PKGVER=2.5
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=hostapd-$PKGVER.tar.gz
MD5SUM=69f9cec3f76d74f402864a43e4f8624f
SRC_URL=http://w1.fi/releases/$TARBALL
BUNDLE=

SLACKREQ='libnl openssl'
SLACKDESC="hostapd: hostapd $PKGVER (Wireless AP daemon)  
hostapd:  
hostapd: hostapd is a user space daemon for access point and authentication 
hostapd: servers. It implements IEEE 802.11 access point management, IEEE 
hostapd: 802.1X/WPA/WPA2/EAP Authenticators, RADIUS client, EAP server, and 
hostapd: RADIUS authentication server. In short, it makes your computer to 
hostapd: function as a Wi-Fi access point/router. It is actually the same 
hostapd: software used in some real-life Wi-Fi routers to provide the AP 
hostapd: functionality.  
hostapd: 
hostapd: http://w1.fi/hostapd/  
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/hostapd*/hostapd
	
	# our config is defconfig + wired, LIBNL32, radius server, 80211n, and fully dynamic vlan
	cp defconfig .config &&
	sed -i -e '
		s/#CONFIG_DRIVER_WIRED/CONFIG_DRIVER_WIRED/;
		s/#CONFIG_LIBNL32/CONFIG_LIBNL32/;
		s/#CONFIG_RADIUS_SERVER/CONFIG_RADIUS_SERVER/;
		s/#CONFIG_IEEE80211N/CONFIG_IEEE80211N/;
		s/#CONFIG_FULL_DYNAMIC_VLAN/CONFIG_FULL_DYNAMIC_VLAN/;
		' .config &&
	
	make $MAKEFLAGS &&
	cp hostapd /usr/sbin &&
	cp hostapd_cli /usr/bin &&
	cp *.8 /usr/share/man/man8 &&
	cp *.1 /usr/share/man/man1 &&
	
	mkdir -p /usr/share/hostapd/samples &&
	cp README /usr/share/hostapd &&
	cp hostapd.accept hostapd.conf hostapd.deny hostapd.eap_user \
	   hostapd.radius_clients hostapd.vlan hostapd.wpa_psk wired.conf \
	   /usr/share/hostapd/samples &&
	pkg_build_slackdesc
}


