aboutsummaryrefslogtreecommitdiffstats
path: root/main/libxml2/APKBUILD
blob: 75091d1821f29e14c48d684d5d929f4880bea51d (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=libxml2
pkgver=2.9.10
pkgrel=6
pkgdesc="XML parsing library, version 2"
url="http://www.xmlsoft.org/"
arch="all"
license="MIT"
depends_dev="zlib-dev xz-dev"
checkdepends="perl tar"
makedepends_host="$depends_dev"
subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-utils"
if [ -z "$BOOTSTRAP" ]; then
	makedepends_build="python3-dev"
	subpackages="$subpackages py3-$pkgname:_py3"
	py_configure="--with-python=/usr/bin/python3"
fi
options="!strip"
source="http://xmlsoft.org/sources/libxml2-$pkgver.tar.gz
	CVE-2019-20388.patch
	libxml2-CVE-2020-7595.patch
	revert-Make-xmlFreeNodeList-non-recursive.patch
	libxml2-2.9.8-python3-unicode-errors.patch
	CVE-2020-24977.patch
	"

# secfixes:
#   2.9.10-r5:
#     - CVE-2020-24977
#   2.9.10-r4:
#     - CVE-2019-20388
#   2.9.8-r3:
#     - CVE-2020-7595
#   2.9.8-r1:
#     - CVE-2018-9251
#     - CVE-2018-14404
#     - CVE-2018-14567
#   2.9.4-r4:
#     - CVE-2017-5969
#   2.9.4-r2:
#     - CVE-2016-9318
#   2.9.4-r1:
#     - CVE-2016-5131

prepare() {
	default_prepare

	# setup.py is generated
	rm python/setup.py

	# We don't build libxml2 with icu.
	rm test/icu_parse_test.xml
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-lzma \
		--with-zlib \
		$py_configure
	make
}

check() {
	rm -f test/ebcdic_566012.xml
	make runtests
}

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

	# We don't need static lib for python bindings.
	if [ -z "$BOOTSTRAP" ]; then
		rm "$pkgdir"/usr/lib/python*/site-packages/*.a
	fi
}

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

_py3() {
	pkgdesc="$pkgname python3 bindings"
	mkdir -p "$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="0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed  libxml2-2.9.10.tar.gz
46ade1189ef24cb56bd38c2c58aaacc8f3e8404656b9976754e9ec9bfe17f71e9a1fdb6febd02947f6120b5ce320cbc7391baf8d0cb042877bcf81553010ad04  CVE-2019-20388.patch
90db832e60c700e971669f57a54fdb297660c42602089b4e77e013a7051c880f380f0c98c059d9f54de99855b2d9be78fcf0639443f3765a925b52fc093fb4d9  libxml2-CVE-2020-7595.patch
347178e432379d543683cba21b902e7305202c03e8dbd724ae395963d677096a5cfc4e345e208d498163ca5174683c167610fc2b297090476038bc2bb7c84b4f  revert-Make-xmlFreeNodeList-non-recursive.patch
a205c97fa1488fb8907cfa08b5f82e2055c80b86213dc3cc5c4b526fe6aa786bcc4e4eeb226c44635a1d021307b39e3940f706c42fb60e9e3e9b490a84164df7  libxml2-2.9.8-python3-unicode-errors.patch
b25a49cfb51569799ada41bad0efaf2666d70b9efb380987c3d5678fd943ada5d0baa18a3db5efa58dac65db8e2d2915ab5c6bac850d0c610656c89734853fd5  CVE-2020-24977.patch
"