Fix module version handling; other improvements

master
Davi da Silva Böger 8 years ago
parent 69822b4304
commit 9e1675db1c

@ -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

@ -4,8 +4,9 @@
# Contributor : abbradar <nikoamia at gmail {dot} com>
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}/"
}

Loading…
Cancel
Save