public
Created

PKGBUILD dkms-bbswitch-git

  • Download Gist
gistfile1.sh
Shell
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
# Maintainer: Samsagax <samsagax@gmail.com>
 
pkgname=dkms-bbswitch-git
pkgver=20121019
pkgrel=1
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")
license=('GPL')
provides=('bbswitch')
conflicts=('bbswitch-git' 'bbswitch' 'dkms-bbswitch')
depends=('dkms' 'linux-headers')
makedepends=('git')
source=('dkms.conf.in')
md5sums=('262c8a723584860fa86f8e5fc8a4889a')
install=dkms-bbswitch.install
_gitroot=('git://github.com/Bumblebee-Project/bbswitch.git')
_gitname=("bbswitch")
_gitbranch=('develop')
 
build() {
cd ${srcdir}
 
## Git checkout
if [ -d ${srcdir}/${_gitname} ] ; then
msg "Git checkout: Updating existing tree"
cd ${_gitname} && git pull origin
msg "Git checkout: Tree has been updated"
else
msg "Git checkout: Retrieving sources"
git clone ${_gitroot} --branch ${_gitbranch}
fi
msg "Checkout completed"
}
 
package() {
cd ${srcdir}/${_gitname}
install -dm755 "${pkgdir}/usr/src/bbswitch-${pkgver}/"
for i in "${srcdir}/${_gitname}/"{Makefile,bbswitch.c}; do
install -D -m644 "${i}" "${pkgdir}/usr/src/bbswitch-${pkgver}/"
done
sed "s/#MODULE_VERSION#/${pkgver}/" "${srcdir}/dkms.conf.in" > "${pkgdir}/usr/src/bbswitch-${pkgver}/dkms.conf"
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.