aboutsummaryrefslogtreecommitdiffstats
path: root/main/hostapd/APKBUILD
blob: 29cf45519b1722738a5dba7b60ab7bce8dd26e3f (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=hostapd
pkgver=2.1
pkgrel=0
pkgdesc="daemon for wireless software access points"
url="http://hostap.epitest.fi/hostapd/"
arch="all"
license="custom"
depends=
makedepends="openssl-dev libnl-dev"
install=
subpackages="$pkgname-doc"
patches="CVE-2012-4445.patch musl-fix-types.patch"
source="http://hostap.epitest.fi/releases/$pkgname-$pkgver.tar.gz
	$patches
	$pkgname.initd
	$pkgname.confd"


_builddir="$srcdir"/$pkgname-$pkgver/hostapd

prepare() {
	local conf="$_builddir/.config"

	cd "$_builddir"/..
	for i in $patches; do
		msg $i
		patch -p1 -i "$srcdir"/$i || return 1
	done

	cd "$_builddir"
	sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \
		hostapd.conf

	# toolchain setup
	echo "CC = ${CC:-gcc}" > $conf

	# EAP authentication methods
	echo "CONFIG_EAP=y" >> $conf
	echo "CONFIG_EAP_MD5=y" >> $conf

	# SSL authentication methods
	echo "CONFIG_EAP_TLS=y" >> $conf
	echo "CONFIG_EAP_TTLS=y" >> $conf
	echo "CONFIG_EAP_MSCHAPV2=y" >> $conf
	echo "CONFIG_EAP_PEAP=y" >> $conf

	# Enable Wi-Fi Protected Setup
	echo "CONFIG_WPS=y" >> $conf
	echo "CONFIG_WPS_UPNP=y" >> $conf

	echo "CONFIG_EAP_GTC=y" >> $conf
	echo "CONFIG_EAP_SIM=y" >> $conf
	echo "CONFIG_EAP_AKA=y" >> $conf
	echo "CONFIG_EAP_PAX=y" >> $conf
	echo "CONFIG_EAP_PSK=y" >> $conf
	echo "CONFIG_EAP_SAKE=y" >> $conf
	echo "CONFIG_EAP_GPSK=y" >> $conf
	echo "CONFIG_EAP_GPSK_SHA256=y" >> $conf

	# drivers
	echo "CONFIG_DRIVER_HOSTAP=y" >> $conf
	echo "CONFIG_DRIVER_WIRED=y" >> $conf
	echo "CONFIG_DRIVER_PRISM54=y" >> $conf

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

	# enable nl80211 driver"
	echo "CONFIG_DRIVER_NL80211=y" >> $conf
	echo "CFLAGS += -I/usr/include/netlink" >> $conf
	echo "LIBS += -L/usr/lib" >> $conf

	# misc
	echo "CONFIG_PKCS12=y" >> $conf
	echo "CONFIG_RADIUS_SERVER=y" >> $conf
	echo "CONFIG_IAPP=y" >> $conf
	echo "CONFIG_IEEE80211R=y" >> $conf
	echo "CONFIG_IEEE80211W=y" >> $conf
	echo "CONFIG_IEEE80211N=y" >> $conf
	echo "CONFIG_PEERKEY=y" >> $conf
	echo "CONFIG_RSN_PREAUTH=y" >> $conf

	# IPv6 support
	echo "CONFIG_IPV6=y" >> $conf
}

build() {
	cd "$_builddir"
	make || return 1

	make nt_password_hash || return 1 
	make hlr_auc_gw || return 1
}

package() {
	cd "$_builddir"
	install -d "$pkgdir"/etc/hostapd
	install hostapd.conf hostapd.accept hostapd.deny hostapd.eap_user \
		hostapd.radius_clients hostapd.sim_db hostapd.wpa_psk \
		"$pkgdir"/etc/hostapd/ || return 1

	install -Dm755 hostapd "$pkgdir"/usr/sbin/hostapd \
		&& install -Dm755 hostapd_cli "$pkgdir"/usr/bin/hostapd_cli \
		&& install -Dm755 nt_password_hash \
			"$pkgdir"/usr/bin/nt_password_hash \
		&& install -Dm755 hlr_auc_gw "$pkgdir"/usr/bin/hlr_auc_gw \
		&& install -Dm755 "$srcdir"/hostapd.initd \
			"$pkgdir"/etc/init.d/hostapd \
		&& install -Dm644 "$srcdir"/hostapd.confd \
			"$pkgdir"/etc/conf.d/hostapd \
		&& install -Dm644 hostapd.8 \
			"$pkgdir"/usr/share/man/man8/hostapd.8 \
		&& install -Dm644 hostapd_cli.1 \
			"$pkgdir"/usr/share/man/man1/hostapd_cli \
		|| return 1
}

md5sums="bb9c50e87c5af6f89f387e63911effac  hostapd-2.1.tar.gz
0d01d4641e0c33f79c1f4372613655bf  CVE-2012-4445.patch
1ed73d28faae5d004bd8e34891df6eea  musl-fix-types.patch
de734b22c3ad1e85309b5634d29c6225  hostapd.initd
c91382209042defa04e79d0ae841a29e  hostapd.confd"
sha256sums="5c7110f55b6092e5277e26edc961eda2def12b94218129d116f5681e34bb2f88  hostapd-2.1.tar.gz
06dc7df2159fb0604191f66d35164caa5927963eebe77b5f2c389bd7590e2a49  CVE-2012-4445.patch
35ec232335ccd8329d267bd75b972936e11cc4b487e47a1b73b390bb7551389e  musl-fix-types.patch
4bb2e7bfe8149353bb17ae74c3e6cf3c833af0b00303f7eb1eb4efe9867458e6  hostapd.initd
6c14e88b14bb9a93d2dca69239d829f435e93180e621319aeed0f3987290dfba  hostapd.confd"
sha512sums="d39291fd7b7b886de54dbf64740b5404f6b154af35dc568c51dbd90584b352c2422d1f89ae25ca705ecd6a55ca011b1f3efad8eaa450e6077a322bf7f3551b7f  hostapd-2.1.tar.gz
619acce84516dead1e03e5da71657ea4c4b6f3ca8271574409773aeb316cbddc88095b50320804f457f001f4f3fe83053e660c008d8409f59bb4d3bfe058b601  CVE-2012-4445.patch
9386de2aec75d5aa1da72c37a4fd0607d1666e9d3f0233a33a66a3ca4408cbb4efca1172a5b9b5d78dc88cf7ffab3366f38578a46f07d8aacc56c66b4a8e2cde  musl-fix-types.patch
d840249b8f537875948e192665b980884bfc977681e577b27e3c5ae4c9724b0c2123cfee72eebbd0d5a33bf0979d7837fc48f8053e66dd06854cca1e8689b798  hostapd.initd
0882263bbd7c0b05bf51f51d66e11a23a0b8ca7da2a3b8a30166d2c5f044c0c134e6bccb1d02c9e81819ca8fb0c0fb55c7121a08fe7233ccaa73ff8ab9a238fe  hostapd.confd"