aboutsummaryrefslogtreecommitdiffstats
path: root/main/hostapd/APKBUILD
blob: a445780ca9a1920b225dfd63c58d52ff69e0df3c (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=hostapd
pkgver=2.6
pkgrel=0
pkgdesc="daemon for wireless software access points"
url="http://hostap.epitest.fi/hostapd/"
arch="all"
license="custom"
depends=
makedepends="libressl-dev libnl3-dev linux-headers"
install=
subpackages="$pkgname-doc"
patches="
	CVE-2012-4445.patch
	libressl-compat.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
	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/^#//' \
		-e '/^#CONFIG_ACS=y/s/^#//' \
		defconfig >> .config
	echo "CC ?= ${CC:-gcc}" >> .config
	echo "CFLAGS += -I/usr/include/libnl3" >> .config
	echo "LIBS += -L/usr/lib" >> .config
}

build() {
	cd "$builddir"
	make || return 1
	msg "nt_password_hash"
	make nt_password_hash || 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 "$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="eaa56dce9bd8f1d195eb62596eab34c7  hostapd-2.6.tar.gz
0d01d4641e0c33f79c1f4372613655bf  CVE-2012-4445.patch
a4d1949ad55c3cb6c6f774a95ed6a3c8  libressl-compat.patch
29b561d4ee34dc22a8a0ae0bf1db5c45  hostapd.initd
c91382209042defa04e79d0ae841a29e  hostapd.confd"
sha256sums="01526b90c1d23bec4b0f052039cc4456c2fd19347b4d830d1d58a0a6aea7117d  hostapd-2.6.tar.gz
06dc7df2159fb0604191f66d35164caa5927963eebe77b5f2c389bd7590e2a49  CVE-2012-4445.patch
663bf347be3d95650be72ac1b465078bccf77cac879ddff05d3989448229c120  libressl-compat.patch
cae79127d088c047c1460d5b63eb67da1a830eb725a8c95e50070e516ad02800  hostapd.initd
6c14e88b14bb9a93d2dca69239d829f435e93180e621319aeed0f3987290dfba  hostapd.confd"
sha512sums="e60baaa092786250b8de9935f5417c7626f5d749210cce9f83d776b65c19fc92a8141f41923389f05c16295d482a15ae8d8b744f4667425040c99e3c2f5b1bda  hostapd-2.6.tar.gz
619acce84516dead1e03e5da71657ea4c4b6f3ca8271574409773aeb316cbddc88095b50320804f457f001f4f3fe83053e660c008d8409f59bb4d3bfe058b601  CVE-2012-4445.patch
e6428a7fde025550e8d8252a04dd3a9009f95b6cab064c1f76bf4e5c321bc6acba9a21511e25f996fe98f6c9f1c057bc5af7aa9e6dd19e0bbc537b2be67d494f  libressl-compat.patch
b54b7c6aa17e5cb86a9b354a516eb2dbefb544df18471339c61d82776de447011a2ac290bea1e6c8beae4b6cebefafb8174683ea42fb773e9e8fe6c679f33ba3  hostapd.initd
0882263bbd7c0b05bf51f51d66e11a23a0b8ca7da2a3b8a30166d2c5f044c0c134e6bccb1d02c9e81819ca8fb0c0fb55c7121a08fe7233ccaa73ff8ab9a238fe  hostapd.confd"