summaryrefslogtreecommitdiff
path: root/libre/tp_smapi-libre-lts/PKGBUILD
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-10-22 00:06:13 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-10-22 00:06:13 -0400
commitdc831bb9d74e073e3e95d8ce8d0715edd7eee1b0 (patch)
tree594c45c42823ba6043ca959227cf96a20e916988 /libre/tp_smapi-libre-lts/PKGBUILD
parentdfb2fcdea0928d362f80caf0a5181c9851bffad9 (diff)
parentdc0e4891b14c9112d374bad83ec5d21a55db57e2 (diff)
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'libre/tp_smapi-libre-lts/PKGBUILD')
-rw-r--r--libre/tp_smapi-libre-lts/PKGBUILD60
1 files changed, 60 insertions, 0 deletions
diff --git a/libre/tp_smapi-libre-lts/PKGBUILD b/libre/tp_smapi-libre-lts/PKGBUILD
new file mode 100644
index 000000000..91ae34864
--- /dev/null
+++ b/libre/tp_smapi-libre-lts/PKGBUILD
@@ -0,0 +1,60 @@
+# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
+# Contributor: xduugu
+# Contributor: nh2
+# Contributor: Steven Davidovitz <steviedizzle ð gmail đ com>
+# Contributor: Nick B <Shirakawasuna ð gmail đ com>
+# Contributor: Christof Musik <christof ð senfdax đ de>
+# Contributor: Stefan Rupp <archlinux ð stefanrupp đ de>
+# Contributor: Ignas Anikevicius <anikevicius ð gmail đ com>
+# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>
+
+pkgname=tp_smapi-libre-lts
+_pkgname=tp_smapi
+_extramodules=/usr/lib/modules/extramodules-3.0-LIBRE-LTS
+pkgver=0.41
+pkgrel=9
+pkgdesc="linux-libre-lts modules for ThinkPad's SMAPI functionality"
+arch=('i686' 'x86_64')
+url='https://github.com/evgeni/tp_smapi'
+license=('GPL')
+depends=('linux-libre-lts>=3.0' 'linux-libre-lts<3.1')
+makedepends=('linux-libre-lts-headers>=3.0' 'linux-libre-lts-headers<3.1')
+replaces=('tp_smapi-lts')
+conflicts=('tp_smapi-lts')
+provides=("tp_smapi-lts=${pkgver}")
+install='tp_smapi-lts.install'
+source=("https://github.com/downloads/evgeni/${_pkgname}/${_pkgname}-${pkgver}.tar.gz")
+md5sums=('63c683415c764568f6bf17c7eabe4752')
+
+build() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+
+ _kernver=$(< "${_extramodules}/version")
+
+ sed -ri -e "s/^(KVER\s*:=).*$/\1 ${_kernver}/" \
+ -e "s#^(KBASE\s*:=).*\$#\1 ${_extramodules%/*}/${_kernver}#" Makefile
+
+ make HDAPS=1
+}
+
+package() {
+ _kernver=$(< "${_extramodules}/version")
+
+ make -C "${_extramodules%/*}/${_kernver}/build" \
+ INSTALL_MOD_PATH="${pkgdir}/${_extramodules%%/lib/*}" \
+ M="${srcdir}/${_pkgname}-${pkgver}" modules_install
+
+ cd "${pkgdir}/${_extramodules%/*}"
+ mv "${_kernver}/extra" "${_extramodules##*/}"
+ rmdir "${_kernver}"
+
+ # compress kernel modules
+ find "${pkgdir}" -name "*.ko" -exec gzip -9 {} +
+
+ # load module on startup
+ echo tp_smapi > "${srcdir}/tp_smapi-lts.conf"
+ install -Dm644 "${srcdir}/tp_smapi-lts.conf" "${pkgdir}/usr/lib/modules-load.d/tp_smapi-lts.conf"
+
+ # update kernel version in install file
+ sed -ri "s#^(extramodules=).*\$#\1${_extramodules}#" "${startdir}/tp_smapi-lts.install"
+}