From e350d34883d753ba4fefa137aff9514814815e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20B=C4=83c=C3=AErcea?= Date: Tue, 16 Jun 2015 09:36:46 +0300 Subject: [PATCH] Initial import --- .SRCINFO | 24 +++++++++++++++++++ PKGBUILD | 50 +++++++++++++++++++++++++++++++++++++++ bbswitch-dkms-git.install | 25 ++++++++++++++++++++ dkms.conf.in | 7 ++++++ makefile_dkms.patch | 26 ++++++++++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 .SRCINFO create mode 100644 PKGBUILD create mode 100644 bbswitch-dkms-git.install create mode 100644 dkms.conf.in create mode 100644 makefile_dkms.patch diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..bdc05ff --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = bbswitch-dkms-git + pkgdesc = kernel module allowing to switch dedicated graphics card on Optimus laptops, dkms version + pkgver = v0.8.r0.g0c38f97 + pkgrel = 1 + url = http://github.com/Bumblebee-Project/bbswitch + install = bbswitch-dkms-git.install + arch = i686 + arch = x86_64 + license = GPL + depends = dkms + depends = linux-headers + provides = bbswitch + conflicts = bbswitch-git + conflicts = bbswitch + conflicts = dkms-bbswitch + source = bbswitch::git://github.com/Bumblebee-Project/bbswitch.git#branch=develop + source = dkms.conf.in + source = makefile_dkms.patch + sha256sums = SKIP + sha256sums = 6bcdd486de01b8cb4842d94be7b33baa52c9405782bf227102cfa32ed691b8cd + sha256sums = a05fb9e528f8d67d9819054d548c74e05e799cc570eddcb4f81a886b6d4d3812 + +pkgname = bbswitch-dkms-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..73b23f1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,50 @@ +# Maintainer : adytzu2007 +# Contributor: Samsagax +# Contributor : abbradar + +pkgname=bbswitch-dkms-git +pkgver=v0.8.r0.g0c38f97 +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') +imakedepends=('git') +install=bbswitch-dkms-git.install +_gitroot='git://github.com/Bumblebee-Project/bbswitch.git' +_gitname='bbswitch' +_gitbranch='develop' +source=("${_gitname}::${_gitroot}#branch=${_gitbranch}" + "dkms.conf.in" + "makefile_dkms.patch") +sha256sums=("SKIP" + "6bcdd486de01b8cb4842d94be7b33baa52c9405782bf227102cfa32ed691b8cd" + "a05fb9e528f8d67d9819054d548c74e05e799cc570eddcb4f81a886b6d4d3812") + +pkgver() { + cd "$srcdir/${_gitname}" + git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' +} + +prepare() { + cd "${srcdir}/${_gitname}" + + # patch Makefile to consider KERNELRELEASE + patch -p1 < "${srcdir}/makefile_dkms.patch" +} + +build() { + cd "${srcdir}/${_gitname}" + + # create dkms.conf + sed -e "s/@PKGVER@/${pkgver}/" < "${srcdir}/dkms.conf.in" > dkms.conf +} + +package() { + cd "${srcdir}/${_gitname}" + install -dm755 "${pkgdir}/usr/src/bbswitch-${pkgver}/" + cp -r * "${pkgdir}/usr/src/bbswitch-${pkgver}/" +} diff --git a/bbswitch-dkms-git.install b/bbswitch-dkms-git.install new file mode 100644 index 0000000..2748873 --- /dev/null +++ b/bbswitch-dkms-git.install @@ -0,0 +1,25 @@ +PKGVER="$(ls /usr/src/ | grep bbswitch | sed 's/^.*-//')" +_dkms="/usr/bin/dkms" + + +post_install() { + ${_dkms} add -m "bbswitch/${PKGVER}" + ${_dkms} build -m "bbswitch/${PKGVER}" + ${_dkms} install -m "bbswitch/${PKGVER}" +} + +post_upgrade() { + post_install +} + +pre_remove() { + ${_dkms} remove -m "bbswitch/${PKGVER}" --all +} + +pre_upgrade() { + pre_remove +} + +post_remove() { + depmod -a +} diff --git a/dkms.conf.in b/dkms.conf.in new file mode 100644 index 0000000..664314a --- /dev/null +++ b/dkms.conf.in @@ -0,0 +1,7 @@ +PACKAGE_NAME="bbswitch" +PACKAGE_VERSION="@PKGVER@" +MAKE[0]="make" +CLEAN="make clean" +BUILT_MODULE_NAME[0]="bbswitch" +DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi" +AUTOINSTALL="yes" diff --git a/makefile_dkms.patch b/makefile_dkms.patch new file mode 100644 index 0000000..7bece6b --- /dev/null +++ b/makefile_dkms.patch @@ -0,0 +1,26 @@ +From 3b43b75b969852ec353a556f9abe5fdc091a6e86 Mon Sep 17 00:00:00 2001 +From: Adrian Bacircea +Date: Fri, 31 May 2013 12:43:53 +0300 +Subject: [PATCH] Makefile + +--- + Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 9073c91..dd4bd95 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,8 @@ + modname := bbswitch + obj-m := $(modname).o + +-KVERSION := $(shell uname -r) ++KERNELRELEASE ?= $(shell uname -r) ++KVERSION = $(KERNELRELEASE) + KDIR := /lib/modules/$(KVERSION)/build + PWD := "$$(pwd)" + +-- +1.8.3 +