[arch-commits] Commit in python-bluepy/repos (2 files)
Felix Yan
felixonmars at archlinux.org
Mon Nov 4 06:34:42 UTC 2019
Date: Monday, November 4, 2019 @ 06:34:41
Author: felixonmars
Revision: 523429
archrelease: copy trunk to community-staging-x86_64
Added:
python-bluepy/repos/community-staging-x86_64/
python-bluepy/repos/community-staging-x86_64/PKGBUILD
(from rev 523428, python-bluepy/trunk/PKGBUILD)
----------+
PKGBUILD | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 79 insertions(+)
Copied: python-bluepy/repos/community-staging-x86_64/PKGBUILD (from rev 523428, python-bluepy/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2019-11-04 06:34:41 UTC (rev 523429)
@@ -0,0 +1,79 @@
+# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+
+_pyname=bluepy-v
+pkgbase=python-bluepy
+pkgname=('python-bluepy' 'python2-bluepy')
+pkgver=1.3.0
+pkgrel=2
+pkgdesc='Python module for interfacing with Bluetooth LE devices through Bluez'
+url='https://github.com/IanHarvey/bluepy'
+arch=('x86_64')
+license=('GPL2')
+makedepends=('bluez' 'glib2'
+ 'python' 'python-setuptools' 'python-sphinx'
+ 'python2' 'python2-setuptools' 'python2-sphinx')
+options=('!makeflags')
+source=(${pkgbase}-${pkgver}.tar.gz::https://github.com/IanHarvey/bluepy/archive/v/${pkgver}.tar.gz)
+sha256sums=('878e68e6d0f2823a5ebc5763e97ed887cc599120a5cc0bac577b7d655db6cd3e')
+sha512sums=('817fcc44646008a4aadac39b1e9ef694fd706b4d23e2299c78084e48f804beec2e76af2701572ce76d9cf325de09e0ded539dd1ceb6ed574cb5d589045c17e37')
+
+prepare() {
+ (cd ${_pyname}-${pkgver}
+ sed 's|CFLAGS =|CFLAGS +=|g' -i bluepy/Makefile
+ sed 's|CPPFLAGS =|CPPFLAGS +=|g' -i bluepy/Makefile
+ sed 's| $(LDLIBS)| $(LDFLAGS) $(LDLIBS)|g' -i bluepy/Makefile
+ )
+ cp -a ${_pyname}-${pkgver}{,-py2}
+ (cd ${_pyname}-${pkgver}-py2
+ sed 's|env python$|env python2|g' -i bluepy/*.py
+ sed 's|/usr/bin/python$|/usr/bin/python2|g' -i bluepy/*.py
+ )
+}
+
+build() {
+ msg2 "Building python..."
+ (cd ${_pyname}-${pkgver}
+ python setup.py build
+ make -C bluepy
+ make -C docs man text SPHINXBUILD=sphinx-build
+ )
+ msg2 "Building python2..."
+ (cd ${_pyname}-${pkgver}-py2
+ python2 setup.py build
+ make -C bluepy
+ make -C docs man text SPHINXBUILD=sphinx-build2
+ )
+}
+
+package_python-bluepy() {
+ depends=('python' 'python-setuptools' 'bluez' 'glib2')
+ cd ${_pyname}-${pkgver}
+
+ # install
+ python setup.py install --root="${pkgdir}" --prefix=/usr -O1 --skip-build
+ install -Dm 644 README.md docs/_build/text/*.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
+ install -Dm 644 docs/_build/man/bluepy.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
+ install -Dm 755 bluepy/bluepy-helper -t "${pkgdir}"/usr/lib/python*/site-packages/bluepy
+
+ # cleanup
+ rm "${pkgdir}"/usr/lib/python*/site-packages/bluepy/{bluez-src.tgz,Makefile,bluepy-helper.c}
+}
+
+package_python2-bluepy() {
+ depends=('python2' 'python2-setuptools' 'bluez' 'glib2')
+ cd ${_pyname}-${pkgver}-py2
+
+ # install
+ python2 setup.py install --root="${pkgdir}" --prefix=/usr -O1 --skip-build
+ install -Dm 644 README.md docs/_build/text/*.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
+ install -Dm 644 docs/_build/man/bluepy.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
+ install -Dm 755 bluepy/bluepy-helper -t "${pkgdir}"/usr/lib/python*/site-packages/bluepy
+
+ # cleanup
+ rm "${pkgdir}"/usr/lib/python*/site-packages/bluepy/{bluez-src.tgz,Makefile,bluepy-helper.c}
+ for prog in blescan sensortag thingy52; do
+ mv "${pkgdir}/usr/bin/${prog}"{,-py2}
+ done
+}
+
+# vim: ts=2 sw=2 et:
More information about the arch-commits
mailing list