Date: Sunday, March 17, 2013 @ 04:30:05
  Author: svenstaro
Revision: 86437

upgpkg: bbswitch 0.5-2

Pushing bbswitch for linux 3.7

Added:
  bbswitch/trunk/bbswitch.install
Modified:
  bbswitch/trunk/PKGBUILD

------------------+
 PKGBUILD         |   38 ++++++++------------------------------
 bbswitch.install |   12 ++++++++++++
 2 files changed, 20 insertions(+), 30 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2013-03-17 03:11:41 UTC (rev 86436)
+++ PKGBUILD    2013-03-17 03:30:05 UTC (rev 86437)
@@ -4,51 +4,29 @@
 
 pkgname=bbswitch
 pkgver=0.5
+_extramodules=extramodules-3.7-ARCH # Don't forget to update bbswitch.install
 pkgrel=2
 pkgdesc="Kernel module allowing to switch dedicated graphics card on Optimus 
laptops"
 arch=('i686' 'x86_64')
 url=("http://github.com/Bumblebee-Project/bbswitch";)
 license=('GPL')
-provides=('bbswitch')
-conflicts=('dkms-bbswitch' 'dkms-bbswitch-git')
-makedepends=('linux-headers')
+depends=('linux>=3.7' 'linux<3.8')
+makedepends=('linux-headers>=3.7' 'linux-headers<3.8')
 install=bbswitch.install
 
source=("https://github.com/downloads/Bumblebee-Project/bbswitch/${pkgname}-${pkgver}.tar.gz";)
+md5sums=('5e0e6eb9c5e8c10db56e5b349b43bba7')
 
-
 build() {
   cd ${srcdir}/${pkgname}-${pkgver}
 
-  sed -i "s|/lib/modules|/usr/lib/modules|g" Makefile
+  _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
    
-  for _kernver in $_KERNELS; do
-    msg2 "Building module for $_kernver..."
-
-    # KDIR is necessary even when cleaning
-    make KDIR=/usr/src/linux-${_kernver} clean
-    make KDIR=/usr/src/linux-${_kernver}
-  done
+  make KDIR=/usr/src/linux-${_kernver}
 }
 
 package() {
   cd ${srcdir}/${pkgname}-${pkgver}
    
-   # Find all extramodules directories
-  _EXTRAMODULES=`find /usr/lib/modules -name version | sed 
's|\/usr\/lib\/modules\/||; s|\/version||'`
-
-  # Loop through all detected kernels
-  for _kernver in $_KERNELS; do 
-    
-    # Loop through all detected extramodules directories
-    for _moduledirs in $_EXTRAMODULES; do
-      # Check which extramodules directory corresponds with the built module
-      if [ `cat "/usr/lib/modules/${_moduledirs}/version"` = $_kernver ]; then
-        mkdir -p "${pkgdir}/usr/lib/modules/${_moduledirs}/"
-        install -m644 bbswitch.ko "${pkgdir}/usr/lib/modules/${_moduledirs}/"
-        gzip "${pkgdir}/usr/lib/modules/${_moduledirs}/bbswitch.ko"            
          
-      fi
-    done
-  done 
+  install -Dm644 bbswitch.ko 
"${pkgdir}"/usr/lib/modules/${_extramodules}/bbswitch.ko
+  gzip "${pkgdir}/usr/lib/modules/${_extramodules}/bbswitch.ko"                
      
 }
-
-md5sums=('5e0e6eb9c5e8c10db56e5b349b43bba7')

Added: bbswitch.install
===================================================================
--- bbswitch.install                            (rev 0)
+++ bbswitch.install    2013-03-17 03:30:05 UTC (rev 86437)
@@ -0,0 +1,12 @@
+post_install() {
+    EXTRAMODULES='extramodules-3.7-ARCH'
+    depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
+
+post_upgrade() {
+    post_install
+}
+
+post_remove() {
+    post_install
+}

Reply via email to