aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-serial/APKBUILD
blob: e66f793bd0ed1460886d1df5592405fb21f15089 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-serial
_pkgname=pyserial
pkgver=2.6
pkgrel=0
pkgdesc="Python Serial Port Extension"
url="http://pyserial.sourceforge.net/"
arch="noarch"
license="Python"
depends="python"
makedepends="python-dev"
install=""
subpackages="$pkgname-doc $pkgname-examples"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"

_builddir="$srcdir"/$_pkgname-$pkgver
build() {
	cd "$_builddir"
	python setup.py build || return 1
}

package() {
	cd "$_builddir"
	python setup.py install --prefix=/usr --root="$pkgdir" || return 1
}

doc() {
	cd "$_builddir"
	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/ || return 1
	# Documentation files
	_docs="appendix.rst examples.rst pyparallel.rst pyserial.rst \
		pyserial_api.rst shortintro.rst"
	for _doc in $_docs; do
		mv "$srcdir"/$_pkgname-$pkgver/documentation/$_doc \
			"$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1
	done
}

examples() {
	cd "$_builddir"
	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/examples || return 1
	# Example files
	_examples="enhancedserial.py rfc2217_server.py scan.py \
		scanlinux.py tcp_serial_redirect.py port_publisher.py port_publisher.sh"
	for _example in $_examples; do
		mv "$srcdir"/$_pkgname-$pkgver/examples/$_example \
			"$subpkgdir"/usr/share/doc/$pkgname/examples/$_example || return 1
	done
}

md5sums="cde799970b7c1ce1f7d6e9ceebe64c98  pyserial-2.6.tar.gz"
sha256sums="049dbcda0cd475d3be903e721d60889ee2cc4ec3b62892a81ecef144196413ed  pyserial-2.6.tar.gz"
sha512sums="41682f8fafb6c5fa9642d3a0a3d6d0648101c38d157005f9c4e019e55d534953486072caf05647d8828b0e19c8259cc61cac856a570bf09904922ffd175fad2d  pyserial-2.6.tar.gz"