blob: cfca80feeb3a0ede13f75c4de2526b96840d46a7 (
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
|
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=libxml2
pkgver=2.9.8
pkgrel=0
pkgdesc="XML parsing library, version 2"
url="http://www.xmlsoft.org/"
arch="all"
license="MIT"
depends_dev="zlib-dev"
checkdepends="perl tar"
makedepends="$depends_dev python2-dev python3-dev"
subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-utils
py-$pkgname:_py py2-$pkgname:_py py3-$pkgname:_py"
options="!strip"
source="http://xmlsoft.org/sources/$pkgname-$pkgver.tar.gz"
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
# We don't build libxml2 with icu.
rm test/icu_parse_test.xml
cp -ra "$builddir" "$builddir"-python2
}
libxml2_configure() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
"$@"
}
build() {
cd "$builddir"
libxml2_configure \
--with-python=/usr/bin/python3
make
msg "build python2"
cd "$builddir"-python2
libxml2_configure \
--with-python=/usr/bin/python2
make
}
check() {
rm "$builddir"-python2/test/ebcdic_566012.xml
make -C "$builddir"-python2 runtests
}
package() {
cd "$builddir"
make -j1 DESTDIR="$pkgdir" install
make -j1 -C "$builddir"-python2/python DESTDIR="$pkgdir" install
# We don't need static lib for python bindings.
rm "$pkgdir"/usr/lib/python*/site-packages/*.a
}
dev() {
default_dev
mv "$pkgdir"/usr/lib/*.sh "$subpkgdir"/usr/lib/
}
_py() {
local python
cd "$builddir"
case $subpkgname in
py2-*) python=python2;;
py3-*) python=python3;;
py-*) mkdir -p "$subpkgdir"; return 0;; # dummy py- package
esac
pkgdesc="$pkgname $python bindings"
install_if="py-libxml2=$pkgver-r$pkgrel $python"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/$python* "$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"
|