APKBUILD 3.63 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=hostapd
3
pkgver=2.7
4
pkgrel=3
Natanael Copa's avatar
Natanael Copa committed
5 6
pkgdesc="daemon for wireless software access points"
url="http://hostap.epitest.fi/hostapd/"
7
arch="all"
Natanael Copa's avatar
Natanael Copa committed
8
license="custom"
9
makedepends="openssl-dev libnl3-dev linux-headers"
10
subpackages="$pkgname-doc $pkgname-openrc"
Leonardo Arena's avatar
Leonardo Arena committed
11
patches="CVE-2012-4445.patch
12
	CVE-2019-9496.patch
13
	0001-EAP-pwd-server-Fix-reassembly-buffer-handling.patch
14
	0003-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch
15
	"
Natanael Copa's avatar
Natanael Copa committed
16
source="http://hostap.epitest.fi/releases/$pkgname-$pkgver.tar.gz
17
	$patches
Natanael Copa's avatar
Natanael Copa committed
18 19
	$pkgname.initd
	$pkgname.confd"
Leonardo Arena's avatar
Leonardo Arena committed
20
options="!check" #no testsuite
21
builddir="$srcdir"/$pkgname-$pkgver/hostapd
Natanael Copa's avatar
Natanael Copa committed
22

Leonardo Arena's avatar
Leonardo Arena committed
23
# secfixes:
24 25
#   2.7-r3:
#     - CVE-2019-9496
26 27
#   2.7-r1:
#     - CVE-2019-11555
28 29
#   2.7-r0:
#     - CVE-2017-13082
Leonardo Arena's avatar
Leonardo Arena committed
30 31 32 33 34 35 36 37 38 39 40
#   2.6-r2:
#     - CVE-2017-13077
#     - CVE-2017-13078
#     - CVE-2017-13079
#     - CVE-2017-13080
#     - CVE-2017-13081
#     - CVE-2017-13082
#     - CVE-2017-13086
#     - CVE-2017-13087
#     - CVE-2017-13088

Natanael Copa's avatar
Natanael Copa committed
41
prepare() {
42
	local conf="$builddir/.config"
Natanael Copa's avatar
Natanael Copa committed
43

44
	cd "$builddir"/..
45 46
	for i in $patches; do
		msg $i
tmpfile's avatar
tmpfile committed
47
		patch -p1 -i "$srcdir"/$i
48 49
	done

50
	cd "$builddir"
Natanael Copa's avatar
Natanael Copa committed
51 52 53 54
	sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \
		hostapd.conf

	# toolchain setup
Natanael Copa's avatar
Natanael Copa committed
55 56 57 58 59 60 61 62 63 64
	sed \
		-e '/^#CONFIG_DRIVER_NL80211=y/s/^#//' \
		-e '/^#CONFIG_RADIUS_SERVER=y/s/^#//' \
		-e '/^#CONFIG_DRIVER_WIRED=y/s/^#//' \
		-e '/^#CONFIG_DRIVER_NONE=y/s/^#//' \
		-e '/^#CONFIG_IEEE80211N=y/s/^#//' \
		-e '/^#CONFIG_IEEE80211R=y/s/^#//' \
		-e '/^#CONFIG_IEEE80211AC=y/s/^#//' \
		-e '/^#CONFIG_FULL_DYNAMIC_VLAN=y/s/^#//' \
		-e '/^#CONFIG_LIBNL32=y/s/^#//' \
65
		-e '/^#CONFIG_ACS=y/s/^#//' \
Natanael Copa's avatar
Natanael Copa committed
66 67 68 69
		defconfig >> .config
	echo "CC ?= ${CC:-gcc}" >> .config
	echo "CFLAGS += -I/usr/include/libnl3" >> .config
	echo "LIBS += -L/usr/lib" >> .config
Natanael Copa's avatar
Natanael Copa committed
70 71 72
}

build() {
73
	cd "$builddir"
tmpfile's avatar
tmpfile committed
74
	make
Natanael Copa's avatar
Natanael Copa committed
75
	msg "nt_password_hash"
tmpfile's avatar
tmpfile committed
76
	make nt_password_hash
Natanael Copa's avatar
Natanael Copa committed
77 78 79
}

package() {
80
	cd "$builddir"
Natanael Copa's avatar
Natanael Copa committed
81 82 83
	install -d "$pkgdir"/etc/hostapd
	install hostapd.conf hostapd.accept hostapd.deny hostapd.eap_user \
		hostapd.radius_clients hostapd.sim_db hostapd.wpa_psk \
tmpfile's avatar
tmpfile committed
84
		"$pkgdir"/etc/hostapd/
Natanael Copa's avatar
Natanael Copa committed
85 86 87 88 89 90 91 92 93 94 95 96

	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 "$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 \
tmpfile's avatar
tmpfile committed
97
			"$pkgdir"/usr/share/man/man1/hostapd_cli
Natanael Copa's avatar
Natanael Copa committed
98
}
99
sha512sums="1c9a210dfffb951fb667be19aa44ad8c66dccd2aed26cdab939185923550e3c1998a678ebe6975e560e1b3385bff2098f1b2cb773452ba66fb35246fdd3eb2c1  hostapd-2.7.tar.gz
100
619acce84516dead1e03e5da71657ea4c4b6f3ca8271574409773aeb316cbddc88095b50320804f457f001f4f3fe83053e660c008d8409f59bb4d3bfe058b601  CVE-2012-4445.patch
101
90981a52d6cb2e91f67a9bc830d3db02da6fde4bea0cf512b22111da6c8ab151f5dd171a2f2e409d9ff75e388e72c2314dd023a98fdabf16248b11a950bde881  CVE-2019-9496.patch
102
7038044885871271ac724790663d5c0a428db83b41a691747be7a618ae893670a98f3ba52a297937249084296b0e9bcfd791edaa3928548efddb259e1a15f46c  0001-EAP-pwd-server-Fix-reassembly-buffer-handling.patch
103
99c734fe395b4231aa6a097a08a00e5dab65ea9c37a7c83b1904a37c39307d9e7e95485734b0d483687126f4100c75f8a7b1420f0a2edcbfe07b454a14548822  0003-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch
104
b54b7c6aa17e5cb86a9b354a516eb2dbefb544df18471339c61d82776de447011a2ac290bea1e6c8beae4b6cebefafb8174683ea42fb773e9e8fe6c679f33ba3  hostapd.initd
Timo Teräs's avatar
Timo Teräs committed
105
0882263bbd7c0b05bf51f51d66e11a23a0b8ca7da2a3b8a30166d2c5f044c0c134e6bccb1d02c9e81819ca8fb0c0fb55c7121a08fe7233ccaa73ff8ab9a238fe  hostapd.confd"