summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD51
2 files changed, 70 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d8fd42e01749
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = python2-cython-hidapi-git
+ pkgdesc = A Cython interface to the HIDAPI from https://github.com/signal11/hidapi for Python 2
+ pkgver = 0.7.99.5.r58.78722d3
+ pkgrel = 2
+ url = https://github.com/trezor/cython-hidapi
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = git
+ depends = python2
+ depends = libusb
+ depends = cython2
+ provides = python2-cython-hidapi
+ conflicts = python2-cython-hidapi
+ source = git+https://github.com/trezor/cython-hidapi.git
+ sha256sums = SKIP
+
+pkgname = python2-cython-hidapi-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a1611903dbaa
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: jyantis <yantis@yantis.net>
+
+pkgname=python2-cython-hidapi-git
+pkgver=0.7.99.5.r58.78722d3
+_gitname=cython-hidapi
+pkgrel=2
+pkgdesc="A Cython interface to the HIDAPI from https://github.com/signal11/hidapi for Python 2"
+arch=('i686' 'x86_64')
+url='https://github.com/trezor/cython-hidapi'
+license=('GPL')
+depends=('python2' 'libusb' 'cython2')
+source=('git+https://github.com/trezor/cython-hidapi.git')
+sha256sums=('SKIP')
+provides=('python2-cython-hidapi')
+conflicts=('python2-cython-hidapi')
+makedepends=('git')
+
+pkgver() {
+ cd ${_gitname}
+ set -o pipefail
+
+ _gitversion=$( git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" )
+
+ # If there is a setup.py then pull the version tag from the file
+ if [ -f "setup.py" ]; then
+ if grep --quiet "version = " setup.py; then
+ printf "%s.%s" "$(grep -R "version = " setup.py | awk -F\' '{print $2}')" $_gitversion | sed 's/-/./g'
+ elif grep --quiet "version=" setup.py; then
+ printf "%s.%s" "$(grep -R "version=" setup.py | awk -F\' '{print $2}')" $_gitversion | sed 's/-/./g'
+ else
+ printf "%s" $_gitversion
+ fi
+ else
+ printf "%s" $_gitversion
+ fi
+}
+
+build() {
+ cd ${_gitname}
+ git submodule init
+ git submodule update
+ python2 setup.py build
+}
+
+package() {
+ cd ${_gitname}
+ python2 setup.py install --root="${pkgdir}" --optimize=1
+}
+
+# vim:set ts=2 sw=2 et: