aboutsummaryrefslogtreecommitdiffstats
path: root/main/dahdi-linux-lts/APKBUILD
blob: 772452cac2f77feb67265458c9727f80f43454fe (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
# Contributor: Timo Teras <timo.teras@iki.fi>
# Contributor: wener <wenermail@gmail.com>
# Maintainer: wener <wenermail@gmail.com>

# when changing _ver we *must* bump _rel
_name=dahdi-linux
_ver=3.1.0
_rel=0

_flavor=${FLAVOR:-lts}
_kpkg=linux-$_flavor
_kver=5.15.5
_krel=0

_kpkgver="$_kver-r$_krel"
_kabi="$_kver-$_krel-$_flavor"

pkgname=$_name-$_flavor
pkgver=$_kver
pkgrel=$(( $_krel + $_rel ))

pkgdesc="Digium Asterisk Hardware Device Interface drivers"
url="https://www.asterisk.org/"
arch="x86_64"
license="GPL-2.0-or-later"
depends="dahdi-linux $_kpkg=$_kpkgver"
# we need wget and tar because make install downloads firmware and uses fancy
# options for tar and wget.
makedepends="$_kpkg-dev=$_kpkgver wget tar perl"
subpackages="$pkgname-dev"
source="http://downloads.digium.com/pub/telephony/dahdi-linux/releases/${_name}-$_ver.tar.gz
	dahdi-depmod.patch
	dahdi-bri_dchan.patch
	kernel-compat-5.4.patch
	kernel-5.6.patch
	kernel-5.9.patch
	"

builddir="$srcdir/$_name-$_ver"

prepare() {
	default_prepare
	# verify the kernel version
	local _kapkbuild=../../main/linux-$_flavor/APKBUILD
	if [ -f $_kapkbuild ]; then
		(	. $_kapkbuild
			pkgname=$_name-$_flavor
			[ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver"
			[ "$_krel" != "$pkgrel" ] && die "please update _krel to $pkgrel"
			return 0
		)
	fi
}

build() {
	cd "$srcdir/$_name-$_ver"
	make KVERS="${_kabi}" DYNFS="yes"
}

package() {
	cd "$srcdir/$_name-$_ver"
	make KVERS="${_kabi}" DYNFS="yes" \
		DESTDIR="$pkgdir" install-modules
	rm -rf "$pkgdir"/lib/firmware "$pkgdir"/usr/lib/hotplug/firmware \
		"$pkgdir"/usr/include || true
}

# 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-${_kabi}
	install -D "$srcdir"/$_name-$_ver/drivers/dahdi/Module.symvers \
		"$dir"/drivers/dahdi/Module.symvers
	ln -s /usr/include "$dir"/include
}

sha512sums="
440f5e44c933c609f2b3cfcf013c84bcd0c37929a43d69aac0276b11484cb890cd5939c5ac5950cad54d934d27ee6ff0b18f2bdd58477ed9be8055de107727b4  dahdi-linux-3.1.0.tar.gz
aba01eb90d9db1c595ff22078c76aadb20900486b5794d38b7ee61fa30d2fb51be318a4d059246017640447aee03fb09bb5514c818e3caa1cd98e331ec065173  dahdi-depmod.patch
fa2fa9e96eefc0f31a1a4a8f8f44e77936f6da0d7b74fe3c3d1f0de085621744ae4367932ac97a10b7f96b7d0954843b0bfe07a251b85434079cc6da29e243ba  dahdi-bri_dchan.patch
a03fde27c801bd7a9f5267505072a50dc738dcac9cafb08539bbd38eb78f3bb688f067bbbcbe05521a6f38fe28d4e8bfee68c30acea24647a4ea0d28a05bd987  kernel-compat-5.4.patch
136f49357761252cde233e664c1972beb140877ae46d8095364377eafcbe3ca908adcb6741881d9b0d0716a8525cda134e1db221f38b1ef3d39aea0b9c522b0d  kernel-5.6.patch
2430f50caf6145c0fc3c318fb54968004939a5eb7a3e2d85e9a91a2a71b8408a16cecc63e8c741659b6974bad078d0ead540e5364729e29a62ba81c84638923a  kernel-5.9.patch
"