aboutsummaryrefslogtreecommitdiffstats
path: root/main/dahdi-linux-hardened/APKBUILD
blob: 28fded6004978fc0bf05f475968fcdb6a81f599d (plain) (blame)
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
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>

_flavor=hardened
_kpkg=linux-$_flavor
_kver=4.9.28
_kpkgrel=1
_mypkgrel=0

_kpkgver="$_kver-r$_kpkgrel"
_abi_release=${_kver}-${_kpkgrel}-${_flavor}
_realname=dahdi-linux

pkgname=${_realname}-${_flavor}
pkgver=$_kver
# when chaning _dahdiver we *must* bump _mypkgrel
_dahdiver=2.11.1
pkgrel=$(( $_kpkgrel + $_mypkgrel ))
pkgdesc="Digium Asterisk Hardware Device Interface drivers $_dahdiver"
url="http://www.asterisk.org"
arch="x86 x86_64"
license="GPL"
depends="dahdi-linux linux-${_flavor}=${_kpkgver}"
# we need wget and tar because make install downloads firmware and uses fancy
# options for tar and wget.
makedepends="linux-${_flavor}-dev=${_kpkgver} wget tar perl"
install=
subpackages="$pkgname-dev"
provides="${_realname}-grsec=${pkgver}-r${pkgrel}"
source="http://downloads.digium.com/pub/telephony/dahdi-linux/releases/${_realname}-$_dahdiver.tar.gz
	dahdi-depmod.patch
	dahdi-bri_dchan.patch
	dahdi-zaphfc.patch
	zaphfc-dahdi-flortz.diff
	zaphfc-dahdi-2.4.0.patch
	zaphfc-dahdi-2.5.0.patch
	zaphfc-dahdi-2.6.0.patch
	zaphfc-dahdi-2.7.0.patch
	constify.patch
	linux-3.13.patch
	linux-4.4.patch
	"

prepare() {
	cd "$srcdir/$_realname-$_dahdiver"
	# verify the kernel version
	(

	if [ -f "$startdir"/../linux-${_flavor}/APKBUILD ]; then
		. "$startdir"/../linux-${_flavor}/APKBUILD
		if [ "$_kver" != "$pkgver" ]; then
			die "dahdi-linux-grsec: please update _kver to $pkgver"
		fi
		if [ "$_kpkgrel" != "$pkgrel" ]; then
			die "dahdi-linux-grsec: please update _kpkgrel to $pkgrel"
		fi
	fi
	) || return 1

	for i in $source; do
		case $i in
		*.patch|*.diff)
			msg "Applying $i"
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
}

build() {
	cd "$srcdir/$_realname-$_dahdiver"
	make KVERS="${_abi_release}" DYNFS="yes" MODULES_EXTRA="zaphfc" \
		|| return 1
}

package() {
	cd "$srcdir/$_realname-$_dahdiver"
	make KVERS="${_abi_release}" DYNFS="yes" MODULES_EXTRA="zaphfc" \
		DESTDIR="$pkgdir" install-modules || return 1
	rm -rf "$pkgdir"/lib/firmware "$pkgdir"/usr/lib/hotplug/firmware \
		"$pkgdir"/usr/include
}

# since we sourced the APKBUILD above we got the dev() function there to
# so we override it again.
depends_dev="dahdi-linux-dev"
dev() {
	default_dev
	local dir="$subpkgdir"/usr/src/dahdi-headers-${_abi_release}
	install -D "$srcdir"/$_realname-$_dahdiver/drivers/dahdi/Module.symvers \
		"$dir"/drivers/dahdi/Module.symvers
	ln -s /usr/include "$dir"/include
}

sha512sums="db15d9237f157b5349de8f4cdb45573ed42e1dd25c83f900835c7e15637a19e1e95c7c990dc786c1e3f37f32419f3d009e179d27b5d16421789ff9bc76f54224  dahdi-linux-2.11.1.tar.gz
aba01eb90d9db1c595ff22078c76aadb20900486b5794d38b7ee61fa30d2fb51be318a4d059246017640447aee03fb09bb5514c818e3caa1cd98e331ec065173  dahdi-depmod.patch
fa2fa9e96eefc0f31a1a4a8f8f44e77936f6da0d7b74fe3c3d1f0de085621744ae4367932ac97a10b7f96b7d0954843b0bfe07a251b85434079cc6da29e243ba  dahdi-bri_dchan.patch
8ef31c9723237da83954832df5aee1f5daa23f8fefe07a1a191a2c5da2c2308001d68cee83500f7ef43166bfc0d65552b0ca5362789c5c82a7217e09362fd5fe  dahdi-zaphfc.patch
f18043fd18a05be7e49daa9d8c96c8a8c45936b14e82e30523e4d88b1620a73147f765d24d2038c4ec0855901e36e8e2b188d596f94437dfb80f6d76ab699d9d  zaphfc-dahdi-flortz.diff
8068fcbba81b819bbd14a1a324457d0febd5350d16c6443be035c50f7759010376bd92d3c7ea69b47309e02603e587387b643f64663652e162853515371a6da5  zaphfc-dahdi-2.4.0.patch
95811d56f5567bbab1e6fac89fdc7a4d78252a54a416e884903ae2709f8922f5cd02c492de0bad5c35fdfd52250ec231ed11457e36ba33f8747c3226491882de  zaphfc-dahdi-2.5.0.patch
7533c640817f71789c922bb9a5a3b6132b5b47958770929b1c9a50a1e2e6de914e278f466a85ef99759e291e5907c56d60926c74075f4e731a9910a46c1be3ea  zaphfc-dahdi-2.6.0.patch
daca74da31c655265164a854987d45ca5ee3af1defbe2d49a9f1a70a48a43dc2bc3ceba724781ae29e3a9078b827f641d2e29809fb25101986f2f69c767d1382  zaphfc-dahdi-2.7.0.patch
c247ce53dd0c9f069d4881c89bd0dc1a816562761874731924af482c40736d6604b360b26642ba5d5d86208c8231de703aa0d858e40911cb0dda46c8fabfd19e  constify.patch
dfc2b0357dc3d2a37c45f1fcc503009cf35e99c8b174d0dd7c91ac4c2c9bb3428f9a19a3f264446069fd751441833f43e11b3b55a060865c6daca9bef74008be  linux-3.13.patch
18cc299c9b9ab05b93769c0aa68595d3b3b640b97c6ee546b9cbe551f08679557c7e2a5a8255577ab6ae7036c2210550b45066b03d04ebbe7adad1a59aba5866  linux-4.4.patch"