From 9e1675db1c529152a19ba7459c067067c59b0de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20da=20Silva=20B=C3=B6ger?= Date: Tue, 31 Jan 2017 17:48:37 -0200 Subject: [PATCH] Fix module version handling; other improvements --- .SRCINFO | 6 +++--- PKGBUILD | 28 +++++++++++++++------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 7073210..9bee5a9 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Tue Jan 31 18:59:22 UTC 2017 +# Tue Jan 31 19:48:13 UTC 2017 pkgbase = bbswitch-dkms-git pkgdesc = kernel module allowing to switch dedicated graphics card on Optimus laptops, dkms version pkgver = 0.8.r0.g0c38f97 - pkgrel = 1 + pkgrel = 2 url = http://github.com/Bumblebee-Project/bbswitch arch = i686 arch = x86_64 @@ -15,7 +15,7 @@ pkgbase = bbswitch-dkms-git conflicts = bbswitch-git conflicts = bbswitch conflicts = dkms-bbswitch - source = bbswitch::git://github.com/Bumblebee-Project/bbswitch.git#branch=develop + source = git://github.com/Bumblebee-Project/bbswitch.git#branch=develop sha256sums = SKIP pkgname = bbswitch-dkms-git diff --git a/PKGBUILD b/PKGBUILD index 44d98f0..748b1d9 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,8 +4,9 @@ # Contributor : abbradar pkgname=bbswitch-dkms-git +_pkgname='bbswitch' pkgver=0.8.r0.g0c38f97 -pkgrel=1 +pkgrel=2 pkgdesc="kernel module allowing to switch dedicated graphics card on Optimus laptops, dkms version" arch=('i686' 'x86_64') url="http://github.com/Bumblebee-Project/bbswitch" @@ -15,25 +16,26 @@ conflicts=('bbswitch-git' 'bbswitch' 'dkms-bbswitch') depends=('dkms' 'linux-headers') makedepends=('git') _gitroot='git://github.com/Bumblebee-Project/bbswitch.git' -_gitname='bbswitch' _gitbranch='develop' -source=("${_gitname}::${_gitroot}#branch=${_gitbranch}") +source=("${_gitroot}#branch=${_gitbranch}") sha256sums=("SKIP") + pkgver() { - cd "$srcdir/${_gitname}" + cd "$srcdir/${_pkgname}" git describe --long | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g' } -build() { - cd "${srcdir}/${_gitname}" +package() { + cd "${srcdir}/${_pkgname}" - # create dkms.conf - sed -e "s/#MODULE_VERSION#/${pkgver}/" < "dkms/dkms.conf" > dkms.conf -} + # Exceprt adapted from upstream Makefile.dkms + modver=`awk -F'"' '/define *BBSWITCH_VERSION/{print $2}' < bbswitch.c` + sed -e "s/#MODULE_VERSION#/${modver}/" < "dkms/dkms.conf" > dkms.conf -package() { - cd "${srcdir}/${_gitname}" - install -dm755 "${pkgdir}/usr/src/bbswitch-${pkgver}/" - cp -r * "${pkgdir}/usr/src/bbswitch-${pkgver}/" + install -dm755 "${pkgdir}/usr/src/${_pkgname}-${modver}" + install -Dm644 Makefile bbswitch.c dkms.conf "${pkgdir}/usr/src/${_pkgname}-${modver}" + + install -dm755 "${pkgdir}/usr/share/doc/${_pkgname}/" + install -Dm644 NEWS README.md "${pkgdir}/usr/share/doc/${_pkgname}/" }