aboutsummaryrefslogtreecommitdiffstats
path: root/main/wpa_supplicant/APKBUILD
blob: 4fb5a17afc224189d08af6fde326f8f5a8c5b81b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=wpa_supplicant
pkgver=1.0
pkgrel=1
pkgdesc="A utility providing key negotiation for WPA wireless networks"
url="http://hostap.epitest.fi/wpa_supplicant"
arch="all"
license="GPL"
subpackages="$pkgname-doc"
depends=
makedepends="openssl-dev dbus-dev libnl3-dev"
source="http://hostap.epitest.fi/releases/$pkgname-$pkgver.tar.gz
	wpa_supplicant.initd
	wpa_supplicant.confd
	libnl3-includes.patch
	"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	for i in *.patch; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	cd "$_builddir"/wpa_supplicant
	# Toolchain setup
	echo "CC = ${CC:-gcc}" > .config

	# Basic setup
	echo "CONFIG_CTRL_IFACE=y" >> .config
	echo "CONFIG_BACKEND=file" >> .config

	# Basic authentication methods
	# NOTE: we don't set GPSK or SAKE as they conflict
	# with the below options
	echo "CONFIG_EAP_GTC=y"         >> .config
	echo "CONFIG_EAP_MD5=y"         >> .config
	echo "CONFIG_EAP_OTP=y"         >> .config
	echo "CONFIG_EAP_PAX=y"         >> .config
	echo "CONFIG_EAP_PSK=y"         >> .config
	echo "CONFIG_EAP_TLV=y"         >> .config
	echo "CONFIG_IEEE8021X_EAPOL=y" >> .config
	echo "CONFIG_PKCS12=y"          >> .config
	echo "CONFIG_PEERKEY=y"         >> .config
	echo "CONFIG_EAP_LEAP=y"        >> .config
	echo "CONFIG_EAP_MSCHAPV2=y"    >> .config
	echo "CONFIG_EAP_PEAP=y"        >> .config
	echo "CONFIG_EAP_TLS=y"         >> .config
	echo "CONFIG_EAP_TTLS=y"        >> .config

	# dbus support
	echo "CONFIG_CTRL_IFACE_DBUS=y" >> .config

	# debug
	# echo "CONFIG_DEBUG_FILE=y" >> .config

	# Smart card authentication
	#echo "CONFIG_EAP_SIM=y"       >> .config
	#echo "CONFIG_EAP_AKA=y"       >> .config
	#echo "CONFIG_EAP_AKA_PRIME=y" >> .config
	#echo "CONFIG_PCSC=y"          >> .config

	# readline/history support for wpa_cli
	#echo "CONFIG_READLINE=y" >> .config

	# SSL authentication methods
	echo "CONFIG_TLS=openssl"    >> .config
	echo "CONFIG_SMARTCARD=y"    >> .config
	# use gnutls
	# echo "CONFIG_TLS=gnutls"     >> .config
	# echo "CONFIG_GNUTLS_EXTRA=y" >> .config
	#echo "CONFIG_TLS=internal"   >> .config

	# Linux specific drivers
	echo "CONFIG_DRIVER_ATMEL=y"       >> .config
	#echo "CONFIG_DRIVER_BROADCOM=y"   >> .config
	#echo "CONFIG_DRIVER_HERMES=y"	   >> .config
	echo "CONFIG_DRIVER_HOSTAP=y"      >> .config
	echo "CONFIG_DRIVER_IPW=y"         >> .config
	echo "CONFIG_DRIVER_NDISWRAPPER=y" >> .config
	echo "CONFIG_DRIVER_NL80211=y"     >> .config
	#echo "CONFIG_DRIVER_PRISM54=y"    >> .config
	echo "CONFIG_DRIVER_RALINK=y"      >> .config
	echo "CONFIG_DRIVER_WEXT=y"        >> .config
	echo "CONFIG_DRIVER_WIRED=y"       >> .config

	# Add include path for madwifi-driver headers
	#echo "CFLAGS += -I/usr/include/madwifi" >> .config
	#echo "CONFIG_DRIVER_MADWIFI=y"          >> .config

	# Wi-Fi Protected Setup (WPS)
	echo "CONFIG_WPS=y" >> .config

	# Enable mitigation against certain attacks against TKIP
	echo "CONFIG_DELAYED_MIC_ERROR_REPORT=y" >> .config

	echo "CONFIG_LIBNL32=y" >> .config
}

build() {
	cd "$_builddir"/wpa_supplicant
	make LIBDIR=/lib BINDIR=/sbin || return 1
	# comment out the network={ } stansas in config
	sed -i -e '/^network=/,/}/s/^/#/' wpa_supplicant.conf
}

package() {
	cd "$_builddir"/wpa_supplicant
	make DESTDIR="$pkgdir" LIBDIR=/lib BINDIR=/sbin install || return 1
	install -Dm644 wpa_supplicant.conf \
		"$pkgdir"/etc/wpa_supplicant/wpa_supplicant.conf
	install -Dm644 doc/docbook/wpa_supplicant.conf.5 \
		"$pkgdir"/usr/share/man/man5/wpa_supplicant.conf.5 || return 1
	for i in wpa_background wpa_cli wpa_passphrase wpa_supplicant; do
		install -Dm644 doc/docbook/$i.8 \
			"$pkgdir"/usr/share/man/man8/$i.8 || return 1
	done

	# dbus
	cd dbus || return 1
	install -d "$pkgdir"/etc/dbus-1/system.d
	install dbus-wpa_supplicant.conf \
		"$pkgdir"/etc/dbus-1/system.d/wpa_supplicant.conf || return 1
	install -d "$pkgdir"/usr/share/dbus-1/system-services
	install fi.epitest.hostap.WPASupplicant.service \
		"$pkgdir"/usr/share/dbus-1/system-services || return 1
	install -d "$pkgdir"/var/run/wpa_supplicant
	install -Dm755 "$srcdir"/wpa_supplicant.initd \
		"$pkgdir"/etc/init.d/wpa_supplicant || return 1
	install -Dm755 "$srcdir"/wpa_supplicant.confd \
		"$pkgdir"/etc/conf.d/wpa_supplicant || return 1
}
md5sums="8650f6aa23646ef634402552d0669640  wpa_supplicant-1.0.tar.gz
55f853354f51ba947e4dd6ee2bb0d64a  wpa_supplicant.initd
bc117427f2c538439f3f1481a028ee06  wpa_supplicant.confd
473fb6b77909ec5a50b6f4d91370e86b  libnl3-includes.patch"