mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 04:16:46 +02:00
testing/py3-serial: drop py2
This commit is contained in:
parent
7d36036f99
commit
dd7faeee0c
@ -1,64 +1,50 @@
|
||||
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
|
||||
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
|
||||
pkgname=py-serial
|
||||
pkgname=py3-serial
|
||||
_pkgname=pyserial
|
||||
pkgver=3.4
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Python Serial Port Extension"
|
||||
url="http://pyserial.sourceforge.net/"
|
||||
options="!check" # testsuite not ready for py3
|
||||
url="https://github.com/pyserial/pyserial"
|
||||
arch="noarch"
|
||||
license="Python"
|
||||
depends="python2"
|
||||
makedepends="python2-dev python3-dev py-setuptools"
|
||||
install=""
|
||||
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-doc $pkgname-examples"
|
||||
license="BSD-3-Clause"
|
||||
depends="python3"
|
||||
makedepends="py3-setuptools"
|
||||
subpackages="$pkgname-doc $pkgname-examples"
|
||||
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
|
||||
|
||||
builddir="$srcdir"/$_pkgname-$pkgver
|
||||
|
||||
replaces="py-serial" # Backwards compatibility
|
||||
provides="py-serial=$pkgver-r$pkgrel" # Backwards compatibility
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
python2 setup.py build || return 1
|
||||
python3 setup.py build || return 1
|
||||
python3 setup.py build
|
||||
}
|
||||
|
||||
check() {
|
||||
python3 setup.py test
|
||||
}
|
||||
|
||||
package() {
|
||||
depends="py2-${pkgname#py-} py3-${pkgname#py-}"
|
||||
mkdir -p "$pkgdir"
|
||||
}
|
||||
|
||||
_py2() {
|
||||
_py_common python2
|
||||
rm "$subpkgdir/usr/bin/miniterm.py"
|
||||
}
|
||||
|
||||
_py3() {
|
||||
_py_common python3
|
||||
}
|
||||
|
||||
_py_common() {
|
||||
local python="$1"
|
||||
depends="$python"
|
||||
|
||||
cd "$builddir"
|
||||
$python setup.py install --prefix=/usr --root="$subpkgdir"
|
||||
python3 setup.py install --prefix=/usr --root="$pkgdir"
|
||||
}
|
||||
|
||||
doc() {
|
||||
cd "$builddir"
|
||||
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/ || return 1
|
||||
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/
|
||||
# Documentation files
|
||||
_docs="appendix.rst examples.rst index.rst pyserial.rst \
|
||||
pyserial_api.rst shortintro.rst tools.rst url_handlers.rst"
|
||||
for _doc in $_docs; do
|
||||
mv "$srcdir"/$_pkgname-$pkgver/documentation/$_doc \
|
||||
"$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1
|
||||
"$subpkgdir"/usr/share/doc/$pkgname/$_doc
|
||||
done
|
||||
}
|
||||
|
||||
examples() {
|
||||
cd "$builddir"
|
||||
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/examples || return 1
|
||||
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/examples
|
||||
# Example files
|
||||
_examples="port_publisher.sh rfc2217_server.py tcp_serial_redirect.py\
|
||||
wxSerialConfigDialog.py wxTerminal.py port_publisher.py\
|
||||
@ -67,7 +53,7 @@ examples() {
|
||||
wxSerialConfigDialog.wxg wxTerminal.wxg"
|
||||
for _example in $_examples; do
|
||||
mv "$srcdir"/$_pkgname-$pkgver/examples/$_example \
|
||||
"$subpkgdir"/usr/share/doc/$pkgname/examples/$_example || return 1
|
||||
"$subpkgdir"/usr/share/doc/$pkgname/examples/$_example
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user