diff options
author | xentec <xentec@aix0.eu> | 2018-02-21 00:40:24 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-03-05 11:23:32 +0000 |
commit | 39b040c6827e4273e82bd4dc78529d71e3a73264 (patch) | |
tree | c8e5487a47c4ea877218265f7f92f64293fd1db7 /main/dahdi-linux-vanilla | |
parent | 810493476f47d2d1f3bfdb1f1d5bdedf8ce9d86a (diff) | |
download | aports-39b040c6827e4273e82bd4dc78529d71e3a73264.tar.bz2 aports-39b040c6827e4273e82bd4dc78529d71e3a73264.tar.xz |
[kmodule]-vanilla: clean up, streamline, modernize
Diffstat (limited to 'main/dahdi-linux-vanilla')
-rw-r--r-- | main/dahdi-linux-vanilla/APKBUILD | 90 |
1 files changed, 40 insertions, 50 deletions
diff --git a/main/dahdi-linux-vanilla/APKBUILD b/main/dahdi-linux-vanilla/APKBUILD index 6d22a9e523..6c49306855 100644 --- a/main/dahdi-linux-vanilla/APKBUILD +++ b/main/dahdi-linux-vanilla/APKBUILD @@ -1,33 +1,45 @@ # Contributor: Timo Teras <timo.teras@iki.fi> # Maintainer: Timo Teras <timo.teras@iki.fi> -_flavor=vanilla +# when changing _ver we *must* bump _rel +_name=dahdi-linux +_ver=2.11.1 +_rel=0 + +_flavor=${FLAVOR:-vanilla} _kpkg=linux-$_flavor _kver=4.14.20 -_kpkgrel=0 -_mypkgrel=0 +_krel=0 + +_kpkgver="$_kver-r$_krel" +_kabi="$_kver-$_krel-$_flavor" -_kpkgver="$_kver-r$_kpkgrel" -_abi_release=${_kver}-${_kpkgrel}-${_flavor} -_realname=dahdi-linux +# verify the kernel version before entering chroot +_kapkbuild=../../main/linux-vanilla/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 -pkgname=${_realname}-${_flavor} +pkgname=$_name-$_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" +pkgrel=$(( $_krel + $_rel )) + +pkgdesc="Digium Asterisk Hardware Device Interface drivers $_ver" url="http://www.asterisk.org" arch="x86 x86_64" -license="GPL" -depends="dahdi-linux linux-${_flavor}=${_kpkgver}" +license="GPL-2.0" +depends="dahdi-linux $_kpkg=$_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= +makedepends="$_kpkg-dev=$_kpkgver wget tar perl" subpackages="$pkgname-dev" -provides="${_realname}-grsec=${pkgver}-r${pkgrel}" -source="http://downloads.digium.com/pub/telephony/dahdi-linux/releases/${_realname}-$_dahdiver.tar.gz +#provides="${_name}-grsec=${pkgver}-r${pkgrel}" +source="http://downloads.digium.com/pub/telephony/dahdi-linux/releases/${_name}-$_ver.tar.gz dahdi-depmod.patch dahdi-bri_dchan.patch dahdi-zaphfc.patch @@ -42,44 +54,22 @@ source="http://downloads.digium.com/pub/telephony/dahdi-linux/releases/${_realna linux-4.13.patch " -prepare() { - cd "$srcdir/$_realname-$_dahdiver" - # verify the kernel version - ( +builddir="$srcdir/$_name-$_ver" - 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 -} +# grsec legacy +[ "$_flavor" = "hardened" ] && provides="$_name-grsec=$pkgver-r$pkgrel" build() { - cd "$srcdir/$_realname-$_dahdiver" - make KVERS="${_abi_release}" DYNFS="yes" MODULES_EXTRA="zaphfc" \ - || return 1 + cd "$srcdir/$_name-$_ver" + make KVERS="${_kabi}" DYNFS="yes" MODULES_EXTRA="zaphfc" } package() { - cd "$srcdir/$_realname-$_dahdiver" - make KVERS="${_abi_release}" DYNFS="yes" MODULES_EXTRA="zaphfc" \ - DESTDIR="$pkgdir" install-modules || return 1 + cd "$srcdir/$_name-$_ver" + make KVERS="${_kabi}" DYNFS="yes" MODULES_EXTRA="zaphfc" \ + DESTDIR="$pkgdir" install-modules rm -rf "$pkgdir"/lib/firmware "$pkgdir"/usr/lib/hotplug/firmware \ - "$pkgdir"/usr/include + "$pkgdir"/usr/include || true } # since we sourced the APKBUILD above we got the dev() function there to @@ -87,8 +77,8 @@ package() { 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 \ + 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 } |