summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamCore2015-06-08 21:34:12 +0200
committerTamCore2015-06-08 21:34:12 +0200
commit804b401444182f4c6e13609057e701ab41c2d436 (patch)
tree45cf08f564e7afb465d99c45dc97ec1fe7a842bf
downloadaur-804b401444182f4c6e13609057e701ab41c2d436.tar.gz
initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD27
-rw-r--r--dkms.conf15
-rw-r--r--kbase.patch11
-rw-r--r--tp_smapi-dkms.install45
5 files changed, 119 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..2cdc7492408
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = tp_smapi-dkms
+ pkgdesc = DKMS controlled modules for ThinkPad's SMAPI functionality
+ pkgver = 0.41
+ pkgrel = 7
+ url = http://www.thinkwiki.org/wiki/Tp_smapi
+ install = tp_smapi-dkms.install
+ arch = any
+ license = GPL
+ depends = dkms
+ provides = tp_smapi=0
+ conflicts = tp_smapi
+ options = !strip
+ source = https://github.com/x539/tp_smapi/archive/master.tar.gz
+ source = dkms.conf
+ source = kbase.patch
+ md5sums = b1b42fdd181d5cb3306eacbedda7845f
+ md5sums = 348a6bda27ecd69112417fbda8d7a2ee
+ md5sums = 933c95f6a6ff187d7dd0bcf413b30b8e
+
+pkgname = tp_smapi-dkms
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..21c8d0bb608
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,27 @@
+pkgname=tp_smapi-dkms
+pkgver=0.41
+pkgrel=7
+pkgdesc="DKMS controlled modules for ThinkPad's SMAPI functionality"
+arch=(any)
+url="http://www.thinkwiki.org/wiki/Tp_smapi"
+license=('GPL')
+depends=('dkms')
+conflicts=('tp_smapi')
+provides=("tp_smapi=${pkgver%.*}")
+options=(!strip)
+install='tp_smapi-dkms.install'
+source=('https://github.com/x539/tp_smapi/archive/master.tar.gz' 'dkms.conf' 'kbase.patch')
+md5sums=('b1b42fdd181d5cb3306eacbedda7845f'
+ '348a6bda27ecd69112417fbda8d7a2ee'
+ '933c95f6a6ff187d7dd0bcf413b30b8e')
+
+package()
+{
+ # patch Makefile for recent kernel module directory change
+ patch -p1 < kbase.patch
+
+ mkdir -p "${pkgdir}"/usr/src/${pkgname}-${pkgver}
+ cp -a tp_smapi-master/{*.{h,c},Makefile} "${pkgdir}"/usr/src/${pkgname}-${pkgver}
+ cp dkms.conf "${pkgdir}"/usr/src/${pkgname}-${pkgver}
+ sed -i 's/KVER/KERNELRELEASE/g' "${pkgdir}"/usr/src/${pkgname}-${pkgver}/Makefile
+}
diff --git a/dkms.conf b/dkms.conf
new file mode 100644
index 00000000000..771f1aae9ff
--- /dev/null
+++ b/dkms.conf
@@ -0,0 +1,15 @@
+PACKAGE_VERSION=0.41
+PACKAGE_NAME="tp_smapi-dkms"
+AUTOINSTALL="yes"
+
+MAKE="make KVER=${kernelver} HDAPS=1"
+CLEAN="make clean"
+
+BUILT_MODULE_NAME[0]="hdaps"
+DEST_MODULE_LOCATION[0]="/updates"
+
+BUILT_MODULE_NAME[1]="thinkpad_ec"
+DEST_MODULE_LOCATION[1]="/extra"
+
+BUILT_MODULE_NAME[2]="tp_smapi"
+DEST_MODULE_LOCATION[2]="/extra"
diff --git a/kbase.patch b/kbase.patch
new file mode 100644
index 00000000000..236d02fdbe5
--- /dev/null
+++ b/kbase.patch
@@ -0,0 +1,11 @@
+--- a/tp_smapi-master/Makefile 2012-07-18 12:54:48.332768620 +0200
++++ b/tp_smapi-master/Makefile 2012-07-18 12:54:42.919519373 +0200
+@@ -2,7 +2,7 @@
+ # This part runs as a normal, top-level Makefile:
+ X:=$(shell false)
+ KVER := $(shell uname -r)
+-KBASE := /lib/modules/$(KVER)
++KBASE := /usr/lib/modules/$(KVER)
+ KSRC := $(KBASE)/source
+ KBUILD := $(KBASE)/build
+ MOD_DIR := $(KBASE)/kernel
diff --git a/tp_smapi-dkms.install b/tp_smapi-dkms.install
new file mode 100644
index 00000000000..58ec0988042
--- /dev/null
+++ b/tp_smapi-dkms.install
@@ -0,0 +1,45 @@
+ver=0.41
+post_install() {
+ DKMS=`which dkms 2>/dev/null`
+
+ echo ">>> DKMS: Module add, build, and install "
+
+ $DKMS add -m tp_smapi-dkms -v $ver
+ for kver in /usr/lib/modules/*
+ do
+ if test -e ${kver}/build
+ then
+ kver="`basename $kver`"
+
+ $DKMS build -m tp_smapi-dkms -v $ver -k $kver
+ $DKMS install -m tp_smapi-dkms -v $ver -k $kver
+
+ echo ">>> Updating kernel modules..."
+ depmod -a $kver
+ fi
+ done
+}
+
+pre_upgrade() {
+ pre_remove
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+ DKMS=`which dkms 2>/dev/null`
+ echo ">>> DKMS: Module uninstall "
+
+ line=`$DKMS status -m tp_smapi-dkms`
+ if echo "$line" | grep -E 'added|built|installed'; then
+ version=`echo "$line" | sed "s/tp_smapi-dkms,\([^,]*\)[,:].*/\1/;t;d"`
+ $DKMS remove -m tp_smapi-dkms -v $version --all
+ fi
+
+}
+
+post_remove() {
+ /sbin/depmod -a
+}