Want more features on Pastebin? Sign Up, it's FREE!
Guest

tp_smapi-pf fix for /usr merge

By: a guest on Dec 25th, 2012  |  syntax: Bash  |  size: 1.80 KB  |  views: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: lockheed
  2. # Contributor: Steven Davidovitz <steviedizzle ð gmail đ com>
  3. # Contributor: Nick B <Shirakawasuna ð gmail đ com>
  4. # Contributor: Christof Musik <christof ð senfdax đ de>
  5. # Contributor: Stefan Rupp <archlinux ð stefanrupp đ de>
  6. # Contributor: Ignas Anikevicius <anikevicius ð gmail đ com>
  7. _pkgname=tp_smapi
  8.  
  9. # make the AUR parser think the following lines are comments
  10. # to bypass the buggy parser check
  11. [[ "#" ]] && _kernext=${_kernext:-}
  12. [[ "#" ]] && _kernver=${_kernver:-$(uname -r)}
  13. [[ "#" ]] && _extramodules=$(readlink -f "/usr/lib/modules/$_kernver/extramodules" | sed 's#^/usr/lib/modules/##')
  14. [[ "#" ]] && _kernver=$(< /usr/lib/modules/$_extramodules/version)
  15.  
  16. pkgname=$_pkgname-pf$_kernext
  17. pkgver=0.41
  18. pkgrel=8
  19. pkgdesc="Modules for ThinkPad's SMAPI functionality, for -pf kernels"
  20. [[ -n $_kernext ]] && pkgdesc+=" (for linux$_kernext)"
  21. arch=('i686' 'x86_64')
  22. url="http://tpctl.sourceforge.net/"
  23. license=('GPL')
  24. depends=("linux$_kernext-pf")
  25. makedepends=("linux$_kernext-headers")
  26. install=$_pkgname-pf.install
  27. source=(https://github.com/downloads/evgeni/tp_smapi/tp_smapi-$pkgver.tar.gz)
  28. md5sums=('63c683415c764568f6bf17c7eabe4752')
  29. sha256sums=('6aef02b92d10360ac9be0db29ae390636be55017990063a092a285c70b54e666')
  30.  
  31. build() {
  32.   cd "$srcdir/tp_smapi-$pkgver"
  33.   sed -ri "s/^(KVER\s*:=).*$/\1$_kernver/" Makefile
  34.   make HDAPS=1
  35. }
  36.  
  37. package() {
  38.   make -C "/lib/modules/$_kernver/build" \
  39.   INSTALL_MOD_PATH="$pkgdir" M="$srcdir/$_pkgname-$pkgver" modules_install
  40.  
  41.   cd "$pkgdir/lib/modules/"
  42.   mv "$_kernver/extra" "$_extramodules"
  43.   rmdir "$_kernver"
  44.  
  45.   # compress kernel modules
  46.   find "$pkgdir" -name "*.ko" -exec gzip -9 {} +
  47.  
  48.   # update kernel version in install file
  49.   sed -ri "s/^(extramodules=).*$/\1$_extramodules/" "$startdir/$_pkgname-pf.install"
  50. }
clone this paste RAW Paste Data