summaryrefslogtreecommitdiff
path: root/system/libxml2/APKBUILD
blob: 8630b944574a5600bb55ec46d7fc88cfaf11b94c (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libxml2
pkgver=2.9.8
pkgrel=0
pkgdesc="XML parsing library"
url="http://www.xmlsoft.org/"
arch="all"
license="MIT"
depends=
depends_dev="zlib-dev icu-dev"
checkdepends="perl tar"
makedepends="$depends_dev python3-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-utils py-libxml2:py"
options="!check !strip"  # Impossible to run on Python 3
source="ftp://ftp.xmlsoft.org/${pkgname}/${pkgname}-${pkgver}.tar.gz
	python-segfault-fix.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

# secfixes:
#   2.9.4-r1:
#     - CVE-2016-5131
#   2.9.4-r2:
#     - CVE-2016-9318
#   2.9.4-r4:
#     - CVE-2017-5969

prepare() {
	default_prepare
	# setup.py is generated
	rm python/setup.py
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-icu \
		--with-python=/usr/bin/python3
	make
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir" install
}

dev() {
	default_dev
	mv "$pkgdir"/usr/lib/*.sh "$subpkgdir"/usr/lib/
}

py() {
	cd "$builddir"

	pkgdesc="$pkgname Python bindings"
	provides="py3-libxml2=$pkgver-r$pkgrel"
	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python3* "$subpkgdir"/usr/lib/
}

utils() {
	pkgdesc="XML utilities"
	replaces="libxml2"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="28903282c7672206effa1362fd564cbe4cf5be44264b083a7d14e383f73bccd1b81bcafb5f4f2f56f5e7e05914c660e27668c9ce91b1b9f256ef5358d55ba917  libxml2-2.9.8.tar.gz
384b3d2031cd8f77528190bbb7652faa9ccb22bc604bcf4927e59046d38830dac38010828fe1568b6514976f725981a6d3ac1aa595d31477a36db2afe491452c  python-segfault-fix.patch"