summaryrefslogtreecommitdiff
path: root/libre
diff options
context:
space:
mode:
authorMárcio Alexandre Silva Delgado <coadde@adinet.com.uy>2012-09-07 19:41:31 -0300
committerMárcio Alexandre Silva Delgado <coadde@adinet.com.uy>2012-09-07 19:41:31 -0300
commit1dc4e85ae5edb9ad6989e6036ce0526db4d6ea20 (patch)
tree920b7ff4f527d6a97c5426e7f6482b6288b74ad1 /libre
parentb79d3b51317c6c90b1a79de8da9bfce8b846a36f (diff)
parent768b9fcb365ef93a8fe8024f20a0bef4cc0c68a7 (diff)
downloadabslibre-1dc4e85ae5edb9ad6989e6036ce0526db4d6ea20.tar.gz
abslibre-1dc4e85ae5edb9ad6989e6036ce0526db4d6ea20.tar.bz2
abslibre-1dc4e85ae5edb9ad6989e6036ce0526db4d6ea20.zip
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'libre')
-rw-r--r--libre/tp_smapi-libre/PKGBUILD63
-rw-r--r--libre/tp_smapi-libre/tp_smapi.install13
2 files changed, 76 insertions, 0 deletions
diff --git a/libre/tp_smapi-libre/PKGBUILD b/libre/tp_smapi-libre/PKGBUILD
new file mode 100644
index 000000000..be2b8de26
--- /dev/null
+++ b/libre/tp_smapi-libre/PKGBUILD
@@ -0,0 +1,63 @@
+# 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
+pkgname=tp_smapi-libre
+pkgver=0.41
+pkgrel=5
+pkgdesc="Modules for ThinkPad's SMAPI functionality"
+arch=('i686' 'x86_64')
+url='https://github.com/evgeni/tp_smapi'
+license=('GPL')
+depends=('linux-libre>=3.5' 'linux-libre<3.6')
+makedepends=('linux-libre-headers>=3.5' 'linux-libre-headers<3.6')
+replaces=("${_pkgname}")
+conflicts=("${_pkgname}")
+provides=("${_pkgname}=${pkgver}")
+install="${_pkgname}.install"
+source=("https://github.com/downloads/evgeni/${_pkgname}/${_pkgname}-${pkgver}.tar.gz")
+md5sums=('63c683415c764568f6bf17c7eabe4752')
+
+build() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+
+ _kernver=${_kernver:-$(uname -r)}
+ _extramodules=$(readlink -f "/usr/lib/modules/${_kernver}/extramodules" || true)
+ _kernver=$(< "${_extramodules}/version")
+
+ sed -ri -e "s/^(KVER\s*:=).*$/\1 ${_kernver}/" \
+ -e "s#^(KBASE\s*:=).*\$#\1 ${_extramodules%/*}/${_kernver}#" Makefile
+
+ make HDAPS=1
+}
+
+package() {
+ _kernver=${_kernver:-$(uname -r)}
+ _extramodules=$(readlink -f "/usr/lib/modules/${_kernver}/extramodules" || true)
+ _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 libre modules
+ find "${pkgdir}" -name "*.ko" -exec gzip -9 {} +
+
+ # load module on startup
+ echo tp_smapi > "${srcdir}/${_pkgname}.conf"
+ install -Dm644 "${srcdir}/${_pkgname}.conf" "${pkgdir}/usr/lib/modules-load.d/${_pkgname}.conf"
+
+ # update kernel libre version in install file
+ sed -ri "s#^(extramodules=).*\$#\1${_extramodules}#" "${startdir}/${_pkgname}.install"
+}
diff --git a/libre/tp_smapi-libre/tp_smapi.install b/libre/tp_smapi-libre/tp_smapi.install
new file mode 100644
index 000000000..5fe1bab90
--- /dev/null
+++ b/libre/tp_smapi-libre/tp_smapi.install
@@ -0,0 +1,13 @@
+extramodules=/usr/lib/modules/extramodules-3.5-ARCH
+
+post_install() {
+ depmod -v $(< "$extramodules/version") &>/dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}