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>
11 _kernver=${_kernver:-$(uname -r)}
12 _extramodules=extramodules-${_kernver%.*}-ARCH
13 [[ ! -d /lib/modules/$_extramodules ]] && _extramodules=$_kernver
14 pkgname=$_pkgname$_kernext
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/"
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')
30 cd "$srcdir/$_pkgname-$pkgver"
31 sed -ri "s/^(KVER\s*:=).*$/\1$_kernver/" Makefile
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"
43 # move hdaps.ko into updates to override in-tree kernel module
44 cd "$pkgdir/lib/modules/$_kernver/"
46 mv extra/hdaps.ko updates
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"