APKBUILD 2.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>

_flavor=vserver

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

_kernelver="$pkgver-r$pkgrel"
_abi_release=${pkgver}-${_flavor}
13
_kpkgrel=$pkgrel
14 15 16 17 18
_realname=dahdi-linux

pkgname=${_realname}-${_flavor}
pkgver=$pkgver
_dahdiver=2.2.0.2
19 20
_mypkgrel=0
pkgrel=$(( $_kpkgrel + $_mypkgrel ))
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
pkgdesc="Digium Asterisk Hardware Device Interface drivers $_dahdiver"
url="http://www.asterisk.org"
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-zaphfc.patch
	zaphfc-dahdi-flortz.diff
	dahdi-linux-2.2.0-hfc-4s.patch
	dahdi-2.6.31.patch
37 38 39
	dahdi-2.2.0.2-driver_data-2.6.32.patch
	dahdi-2.2.0.2-includes.patch
	dahdi-2.2.0.2-gcc44-hack.patch
40 41
	"

42
prepare() {
43 44 45 46 47
	cd "$srcdir/$_realname-$_dahdiver"
	for i in ../*.patch ../*.diff; do
		msg "Applying $i"
		patch -p1 < $i || return 1;
	done
48
}
49

50 51
build() {
	cd "$srcdir/$_realname-$_dahdiver"
52 53
	make KVERS="${_abi_release}" DYNFS="yes" MODULES_EXTRA="zaphfc" \
		|| return 1
54 55 56 57
}

package() {
	cd "$srcdir/$_realname-$_dahdiver"
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
	make KVERS="${_abi_release}" DYNFS="yes" MODULES_EXTRA="zaphfc" \
		DESTDIR="$pkgdir" install
	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-$pkgver/drivers/dahdi/Module.symvers \
		"$dir"/drivers/dahdi/Module.symvers
	ln -s /usr/include "$dir"/include
}

md5sums="1f932729ad28f2f028afcf2cc5ccf7ba  dahdi-linux-2.2.0.2.tar.gz
c78fb8d80f9efdffd950297c88ff9273  dahdi-depmod.patch
4b41a82ff390ac64c08092c5a3eab6a8  dahdi-bri_dchan.patch
78
3be420539f5e2e2b94a1bf3d711ec630  dahdi-zaphfc.patch
79 80
291c5c44c86ab02443a742415461ddca  zaphfc-dahdi-flortz.diff
68dfe17a49cca15ae439fd83f4ccfbc5  dahdi-linux-2.2.0-hfc-4s.patch
81 82 83 84
bd5e7457ee8f37c10ed7ec383995e4fa  dahdi-2.6.31.patch
7f9452ef37385e03e05147081d6951a1  dahdi-2.2.0.2-driver_data-2.6.32.patch
6c208d6346a3668cea900baa45298f6a  dahdi-2.2.0.2-includes.patch
eeb4b2870d23d7c020cd99b5b1a633e9  dahdi-2.2.0.2-gcc44-hack.patch"