updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / tp_smapi / PKGBUILD
blob8aa9d266db98e20e929c8bb3de129e1eca041ec0
1 # Maintainer: xduugu
2 # Contributor: nh2
3 # Contributor: Steven Davidovitz <steviedizzle ð gmail đ com>
4 # Contributor: Nick B <Shirakawasuna ð gmail đ com>
5 # Contributor: Christof Musik <christof ð senfdax đ de>
6 # Contributor: Stefan Rupp <archlinux ð stefanrupp đ de>
7 # Contributor: Ignas Anikevicius <anikevicius ð gmail đ com>
9 _pkgname=tp_smapi
10 _kernext=
11 _kernver=${_kernver:-$(uname -r)}
12 _extramodules=extramodules-${_kernver%.*}-ARCH
13 [[ ! -d /lib/modules/$_extramodules ]] && _extramodules=$_kernver
14 pkgname=$_pkgname$_kernext
15 pkgver=0.41
16 pkgrel=2
17 pkgdesc="Modules for ThinkPad's SMAPI functionality"
18 [[ -n $_kernext ]] && pkgdesc="$pkgdesc (for linux$_kernext)"
19 arch=('i686' 'x86_64')
20 url="http://tpctl.sourceforge.net/"
21 license=('GPL')
22 depends=("linux$_kernext")
23 makedepends=("linux$_kernext-headers")
24 install=$_pkgname.install
25 source=(https://cloud.github.com/downloads/evgeni/$_pkgname/$_pkgname-$pkgver.tar.gz) # https://github.com/downloads/evgeni/$_pkgname/$_pkgname-$pkgver.tar.gz
26 md5sums=('63c683415c764568f6bf17c7eabe4752')
27 sha256sums=('6aef02b92d10360ac9be0db29ae390636be55017990063a092a285c70b54e666')
29 build() {
30   cd "$srcdir/$_pkgname-$pkgver"
31   sed -ri "s/^(KVER\s*:=).*$/\1$_kernver/" Makefile
32   make HDAPS=1
35 package() {
36   make -C "/lib/modules/$_kernver/build" INSTALL_MOD_PATH="$pkgdir" M="$srcdir/$_pkgname-$pkgver" modules_install
38   if [[ $_extramodules != $_kernver ]]; then
39     cd "$pkgdir/lib/modules/"
40     mv "$_kernver/extra" "$_extramodules"
41     rmdir "$_kernver"
42   else
43     # move hdaps.ko into updates to override in-tree kernel module
44     cd "$pkgdir/lib/modules/$_kernver/"
45     mkdir updates
46     mv extra/hdaps.ko updates
47   fi
49   # compress kernel modules
50   find "$pkgdir" -name "*.ko" -exec gzip -9 {} +
52   # update kernel version in install file
53   sed -ri "s/^(kernver=).*$/\1$_kernver/" "$startdir/$_pkgname.install"