summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin J. Pohly2015-07-02 13:32:11 -0400
committerDevin J. Pohly2015-07-02 13:32:11 -0400
commitbc2399eb6e6d32133ada7b3800e673ef09df7258 (patch)
treeb90f78f6f72fe09b8464d50c748e2925c9d62c42
downloadaur-bc2399eb6e6d32133ada7b3800e673ef09df7258.tar.gz
Import from AUR3
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD54
-rw-r--r--piuio.install14
3 files changed, 89 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..c94fa15812a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = piuio-git
+ pkgdesc = Kernel driver for the PIUIO arcade input device
+ pkgver = 0.3.1.r0.gb8bdcb5
+ pkgrel = 2
+ url = https://github.com/djpohly/piuio
+ install = piuio.install
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = git
+ makedepends = kmod
+ makedepends = linux-headers
+ provides = piuio
+ conflicts = piuio
+ source = git+https://github.com/djpohly/piuio.git
+ sha256sums = SKIP
+
+pkgname = piuio-git
+ depends = linux>=4.0
+ depends = linux<4.1
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..faea8b02a32
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,54 @@
+# Maintainer: Devin J. Pohly <djpohly+arch@gmail.com>
+# To build for alternate kernels, change pkgname to match
+pkgname=piuio-git
+#pkgname=piuio-git-lts
+pkgver=0.3.1.r0.gb8bdcb5
+pkgrel=2
+_srcname=piuio
+_kernelname=${pkgname#piuio-git}
+pkgdesc="Kernel driver for the PIUIO arcade input device"
+arch=('i686' 'x86_64')
+url="https://github.com/djpohly/$_srcname"
+license=('GPL2')
+makedepends=('git' 'kmod' "linux$_kernelname-headers")
+provides=("piuio$_kernelname")
+conflicts=("piuio$_kernelname")
+install=$_srcname.install
+source=("git+https://github.com/djpohly/$_srcname.git")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/$_srcname"
+ git describe --long --tags | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
+}
+
+build() {
+ # Build against currently installed headers for the given kernel
+ _kernver=$(pacman -Q "linux$_kernelname-headers" | cut -d' ' -f2)
+ _kerneldir=/usr/lib/modules/$_kernver${_kernelname:--ARCH}/build
+
+ cd "$srcdir/$_srcname/mod"
+
+ make modules KDIR="$_kerneldir"
+}
+
+package() {
+ cd "$srcdir/$_srcname/mod"
+
+ # Get the version from the already-built module, in case installed
+ # version has changed since build.
+ _kernver=$(modinfo -F vermagic "$_srcname.ko" | cut -d' ' -f1)
+ _kernminor=${_kernver%.*}
+ _nextminor=${_kernminor%.*}.$((${_kernminor##*.}+1))
+ depends=("linux$_kernelname>=$_kernminor" "linux$_kernelname<$_nextminor")
+
+ install -Dm644 "$_srcname.ko" \
+ "$pkgdir/usr/lib/modules/extramodules-$_kernminor${_kernelname:--ARCH}/$_srcname.ko"
+
+ # Set kernel version in install script (for depmod)
+ sed \
+ -e "s/^KERNEL_VERSION=.*/KERNEL_VERSION=$_kernminor${_kernelname:--ARCH}/" \
+ -i "$startdir/$install"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/piuio.install b/piuio.install
new file mode 100644
index 00000000000..bd81dd676ff
--- /dev/null
+++ b/piuio.install
@@ -0,0 +1,14 @@
+KERNEL_VERSION=
+
+post_install() {
+ echo ">>> Updating module dependencies. Please wait..."
+ depmod "$(< "/usr/lib/modules/extramodules-$KERNEL_VERSION/version")"
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}