aboutsummaryrefslogtreecommitdiffstats
path: root/main/dahdi-linux-vserver/APKBUILD
blob: 7b5cb6d0004392c9e533acc0f4a7133b82e90920 (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
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>

_flavor=${FLAVOR:-vserver}

# source the kernel version
if [ -f ../linux-${_flavor}/APKBUILD ]; then
	. ../linux-${_flavor}/APKBUILD
fi

_kernelver="$pkgver-r$pkgrel"
_kpkgrel=$pkgrel
_realname=dahdi-linux

pkgname=${_realname}-${_flavor}
pkgver=$pkgver
# when bumping _dahdiver we *must* bump _mypkgrel
_dahdiver=2.5.0
_mypkgrel=1
pkgrel=$(( $_kpkgrel + $_mypkgrel ))
pkgdesc="Digium Asterisk Hardware Device Interface drivers $_dahdiver"
url="http://www.asterisk.org"
arch="all"
license="GPL"
depends="dahdi-linux linux-${_flavor}=${_kernelver}"
# we need wget and tar because make install downloads firmware and uses fancy
# options for tar and wget.
makedepends="linux-${_flavor}-dev=${_kernelver} wget tar perl"
install=
subpackages="$pkgname-dev"
source="http://downloads.digium.com/pub/telephony/dahdi-linux/releases/${_realname}-$_dahdiver.tar.gz
	dahdi-depmod.patch
	dahdi-bri_dchan.patch
	dahdi-2.5.0-bri-fixes.patch
	dahdi-zaphfc.patch
	zaphfc-dahdi-flortz.diff
	zaphfc-dahdi-2.4.0.patch
	zaphfc-dahdi-2.5.0.patch
	"

prepare() {
	cd "$srcdir/$_realname-$_dahdiver"
	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"
	export GCC_SPECS=/usr/share/gcc/hardenednopie.specs
	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
	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
}

md5sums="449f6591ccedb68937b5b30cbd37cea3  dahdi-linux-2.5.0.tar.gz
c78fb8d80f9efdffd950297c88ff9273  dahdi-depmod.patch
3bb419ac598534cd4ad5248f23656001  dahdi-bri_dchan.patch
9088ee5cd24f94b7f90c24e5ed6071e0  dahdi-2.5.0-bri-fixes.patch
a822c092f0548cd13f5e8d8cba053af6  dahdi-zaphfc.patch
291c5c44c86ab02443a742415461ddca  zaphfc-dahdi-flortz.diff
0fdcd8c8c93bc1fe33c0af12b6cc6b05  zaphfc-dahdi-2.4.0.patch
fc49cf22258d63487a83560385c3f6fa  zaphfc-dahdi-2.5.0.patch"