APKBUILD 2.8 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=hostapd
J0WI's avatar
J0WI committed
3
pkgver=2.9
4
pkgrel=0
Natanael Copa's avatar
Natanael Copa committed
5
pkgdesc="daemon for wireless software access points"
J0WI's avatar
J0WI committed
6
url="https://w1.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"
11
patches=""
Natanael Copa's avatar
Natanael Copa committed
12
source="http://hostap.epitest.fi/releases/$pkgname-$pkgver.tar.gz
13
	$patches
Natanael Copa's avatar
Natanael Copa committed
14 15
	$pkgname.initd
	$pkgname.confd"
16
options="!check" #no testsuite
17
builddir="$srcdir"/$pkgname-$pkgver/hostapd
Natanael Copa's avatar
Natanael Copa committed
18

19
# secfixes:
20 21
#   2.8-r0:
#     - CVE-2019-11555
22
#     - CVE-2019-9496
23 24
#   2.7-r0:
#     - CVE-2017-13082
25 26 27 28 29 30 31 32 33 34 35
#   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
36
prepare() {
37
	local conf="$builddir/.config"
Natanael Copa's avatar
Natanael Copa committed
38

39
	cd "$builddir"/..
40 41
	for i in $patches; do
		msg $i
tmpfile's avatar
tmpfile committed
42
		patch -p1 -i "$srcdir"/$i
43 44
	done

45
	cd "$builddir"
Natanael Copa's avatar
Natanael Copa committed
46 47 48 49
	sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \
		hostapd.conf

	# toolchain setup
Natanael Copa's avatar
Natanael Copa committed
50 51 52 53 54 55 56 57 58 59
	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/^#//' \
60
		-e '/^#CONFIG_ACS=y/s/^#//' \
Natanael Copa's avatar
Natanael Copa committed
61 62 63 64
		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
65 66 67
}

build() {
68
	cd "$builddir"
tmpfile's avatar
tmpfile committed
69
	make
Natanael Copa's avatar
Natanael Copa committed
70
	msg "nt_password_hash"
tmpfile's avatar
tmpfile committed
71
	make nt_password_hash
Natanael Copa's avatar
Natanael Copa committed
72 73 74
}

package() {
75
	cd "$builddir"
Natanael Copa's avatar
Natanael Copa committed
76 77 78
	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
79
		"$pkgdir"/etc/hostapd/
Natanael Copa's avatar
Natanael Copa committed
80 81 82 83 84 85 86 87 88 89 90 91

	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
92
			"$pkgdir"/usr/share/man/man1/hostapd_cli
Natanael Copa's avatar
Natanael Copa committed
93
}
J0WI's avatar
J0WI committed
94
sha512sums="66c729380152db18b64520bda55dfa00af3b0264f97b5de100b81a46e2593571626c4bdcf900f0988ea2131e30bc8788f75d8489dd1f57e37fd56e8098e48a9c  hostapd-2.9.tar.gz
95
b54b7c6aa17e5cb86a9b354a516eb2dbefb544df18471339c61d82776de447011a2ac290bea1e6c8beae4b6cebefafb8174683ea42fb773e9e8fe6c679f33ba3  hostapd.initd
Timo Teräs's avatar
Timo Teräs committed
96
0882263bbd7c0b05bf51f51d66e11a23a0b8ca7da2a3b8a30166d2c5f044c0c134e6bccb1d02c9e81819ca8fb0c0fb55c7121a08fe7233ccaa73ff8ab9a238fe  hostapd.confd"