1 | # remove the comment below, when we have python3 support
|
---|
2 | #global with_python3 1
|
---|
3 |
|
---|
4 | #define svn_url e:/trees/libxml2/trunk
|
---|
5 | %define svn_url http://svn.netlabs.org/repos/ports/xml2/trunk
|
---|
6 | %define svn_rev 1830
|
---|
7 |
|
---|
8 | Summary: Library providing XML and HTML support
|
---|
9 | Name: libxml2
|
---|
10 | Version: 2.9.4
|
---|
11 | Release: 2%{?dist}
|
---|
12 | License: MIT
|
---|
13 | Group: Development/Libraries
|
---|
14 | URL: http://xmlsoft.org/
|
---|
15 | Vendor: bww bitwise works GmbH
|
---|
16 |
|
---|
17 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
|
---|
18 |
|
---|
19 | # DEF files to create forwarders for the legacy package
|
---|
20 | Source10: libxml2.def
|
---|
21 |
|
---|
22 | BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
---|
23 | BuildRequires: python-devel
|
---|
24 | %if 0%{?with_python3}
|
---|
25 | BuildRequires: python3-devel
|
---|
26 | %endif # with_python3
|
---|
27 | BuildRequires: zlib-devel
|
---|
28 | BuildRequires: pkgconfig
|
---|
29 | #BuildRequires: xz-devel
|
---|
30 | Requires: libcx >= 0.4
|
---|
31 |
|
---|
32 | %description
|
---|
33 | This library allows to manipulate XML files. It includes support
|
---|
34 | to read, modify and write XML and HTML files. There is DTDs support
|
---|
35 | this includes parsing and validation even with complex DtDs, either
|
---|
36 | at parse time or later once the document has been modified. The output
|
---|
37 | can be a simple SAX stream or and in-memory DOM like representations.
|
---|
38 | In this case one can use the built-in XPath and XPointer implementation
|
---|
39 | to select subnodes or ranges. A flexible Input/Output mechanism is
|
---|
40 | available, with existing HTTP and FTP modules and combined to an
|
---|
41 | URI library.
|
---|
42 |
|
---|
43 | %package devel
|
---|
44 | Summary: Libraries, includes, etc. to develop XML and HTML applications
|
---|
45 | Group: Development/Libraries
|
---|
46 | Requires: libxml2 = %{version}-%{release}
|
---|
47 | Requires: zlib-devel
|
---|
48 | #Requires: xz-devel
|
---|
49 | Requires: pkgconfig
|
---|
50 |
|
---|
51 | %description devel
|
---|
52 | Libraries, include files, etc you can use to develop XML applications.
|
---|
53 | This library allows to manipulate XML files. It includes support
|
---|
54 | to read, modify and write XML and HTML files. There is DTDs support
|
---|
55 | this includes parsing and validation even with complex DtDs, either
|
---|
56 | at parse time or later once the document has been modified. The output
|
---|
57 | can be a simple SAX stream or and in-memory DOM like representations.
|
---|
58 | In this case one can use the built-in XPath and XPointer implementation
|
---|
59 | to select subnodes or ranges. A flexible Input/Output mechanism is
|
---|
60 | available, with existing HTTP and FTP modules and combined to an
|
---|
61 | URI library.
|
---|
62 |
|
---|
63 | %package static
|
---|
64 | Summary: Static library for libxml2
|
---|
65 | Group: Development/Libraries
|
---|
66 | Requires: libxml2 = %{version}-%{release}
|
---|
67 |
|
---|
68 | %description static
|
---|
69 | Static library for libxml2 provided for specific uses or shaving a few
|
---|
70 | microseconds when parsing, do not link to them for generic purpose packages.
|
---|
71 |
|
---|
72 | %package -n python-%{name}
|
---|
73 | Summary: Python bindings for the libxml2 library
|
---|
74 | Group: Development/Libraries
|
---|
75 | Requires: libxml2 = %{version}-%{release}
|
---|
76 | Obsoletes: %{name}-python < %{version}-%{release}
|
---|
77 | Provides: %{name}-python = %{version}-%{release}
|
---|
78 |
|
---|
79 | %description -n python-%{name}
|
---|
80 | The libxml2-python package contains a Python 2 module that permits applications
|
---|
81 | written in the Python programming language, version 2, to use the interface
|
---|
82 | supplied by the libxml2 library to manipulate XML files.
|
---|
83 |
|
---|
84 | This library allows to manipulate XML files. It includes support
|
---|
85 | to read, modify and write XML and HTML files. There is DTDs support
|
---|
86 | this includes parsing and validation even with complex DTDs, either
|
---|
87 | at parse time or later once the document has been modified.
|
---|
88 |
|
---|
89 | %if 0%{?with_python3}
|
---|
90 | %package -n python3-%{name}
|
---|
91 | Summary: Python 3 bindings for the libxml2 library
|
---|
92 | Group: Development/Libraries
|
---|
93 | Requires: libxml2 = %{version}-%{release}
|
---|
94 | Obsoletes: %{name}-python3 < %{version}-%{release}
|
---|
95 | Provides: %{name}-python3 = %{version}-%{release}
|
---|
96 |
|
---|
97 | %description -n python3-%{name}
|
---|
98 | The libxml2-python3 package contains a Python 3 module that permits
|
---|
99 | applications written in the Python programming language, version 3, to use the
|
---|
100 | interface supplied by the libxml2 library to manipulate XML files.
|
---|
101 |
|
---|
102 | This library allows to manipulate XML files. It includes support
|
---|
103 | to read, modify and write XML and HTML files. There is DTDs support
|
---|
104 | this includes parsing and validation even with complex DTDs, either
|
---|
105 | at parse time or later once the document has been modified.
|
---|
106 | %endif # with_python3
|
---|
107 |
|
---|
108 | %debug_package
|
---|
109 |
|
---|
110 | %prep
|
---|
111 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{?!svn_rev):0}
|
---|
112 | %setup -q
|
---|
113 | %else
|
---|
114 | %setup -n "%{name}-%{version}" -Tc
|
---|
115 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
|
---|
116 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
|
---|
117 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
|
---|
118 | %endif
|
---|
119 |
|
---|
120 | # Prepare forwarder DLLs.
|
---|
121 | for m in %{SOURCE10}; do
|
---|
122 | cp ${m} .
|
---|
123 | done
|
---|
124 |
|
---|
125 | %if 0%{?with_python3}
|
---|
126 | mkdir py3doc
|
---|
127 | cp doc/*.py py3doc
|
---|
128 | sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py
|
---|
129 | %endif
|
---|
130 |
|
---|
131 | export NOCONFIGURE=1
|
---|
132 | autogen.sh
|
---|
133 |
|
---|
134 | %build
|
---|
135 | export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
---|
136 | export LIBS="-lcx"
|
---|
137 | export VENDOR="%{vendor}"
|
---|
138 | %configure
|
---|
139 |
|
---|
140 | make %{?smp_mflags}
|
---|
141 |
|
---|
142 |
|
---|
143 | %install
|
---|
144 | rm -fr %{buildroot}
|
---|
145 |
|
---|
146 | make install DESTDIR=%{buildroot}
|
---|
147 |
|
---|
148 | %if 0%{?with_python3}
|
---|
149 | make clean
|
---|
150 | %configure --with-python=%{__python3}
|
---|
151 | make install DESTDIR=%{buildroot}
|
---|
152 | %endif # with_python3
|
---|
153 |
|
---|
154 | # multiarch crazyness on timestamp differences or Makefile/binaries for examples
|
---|
155 | touch -m --reference=$RPM_BUILD_ROOT/%{_includedir}/libxml2/libxml/parser.h $RPM_BUILD_ROOT/%{_bindir}/xml2-config
|
---|
156 |
|
---|
157 | rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
---|
158 | rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
|
---|
159 | rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
|
---|
160 | rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/*
|
---|
161 | rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/*
|
---|
162 | (cd doc/examples ; make clean ; rm -rf .deps Makefile)
|
---|
163 | gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
|
---|
164 |
|
---|
165 | # Generate & install forwarder DLLs.
|
---|
166 | gcc -Zomf -Zdll -nostdlib libxml2.def -l$RPM_BUILD_ROOT/%{_libdir}/xml22.dll -lend -o $RPM_BUILD_ROOT/%{_libdir}/libxml2.dll
|
---|
167 |
|
---|
168 | # create a symlink for the python binding, as the dll itself is named xml2mod.dll
|
---|
169 | ln -s %{_libdir}/python2.7/site-packages/xml2mod.dll $RPM_BUILD_ROOT%{_libdir}/python2.7/site-packages/libxml2mod.pyd
|
---|
170 |
|
---|
171 | %check
|
---|
172 | #make runtests
|
---|
173 |
|
---|
174 | %clean
|
---|
175 | rm -fr %{buildroot}
|
---|
176 |
|
---|
177 | #%post -p /sbin/ldconfig
|
---|
178 |
|
---|
179 | #%postun -p /sbin/ldconfig
|
---|
180 |
|
---|
181 | %files
|
---|
182 | %defattr(-, root, root)
|
---|
183 |
|
---|
184 | %{!?_licensedir:%global license %%doc}
|
---|
185 | %license Copyright
|
---|
186 | %doc AUTHORS NEWS README TODO
|
---|
187 | %doc %{_mandir}/man1/xmllint.1*
|
---|
188 | %doc %{_mandir}/man1/xmlcatalog.1*
|
---|
189 | %doc %{_mandir}/man3/libxml.3*
|
---|
190 |
|
---|
191 | %{_libdir}/xml2*.dll
|
---|
192 | %{_bindir}/xmllint.exe
|
---|
193 | %{_bindir}/xmlcatalog.exe
|
---|
194 | #forwarder dll
|
---|
195 | %{_libdir}/libxml2.dll
|
---|
196 |
|
---|
197 | %files devel
|
---|
198 | %defattr(-, root, root)
|
---|
199 |
|
---|
200 | %doc %{_mandir}/man1/xml2-config.1*
|
---|
201 | %doc AUTHORS NEWS README Copyright
|
---|
202 | %doc doc/*.html doc/html doc/*.gif doc/*.png
|
---|
203 | %doc doc/tutorial doc/libxml2-api.xml.gz
|
---|
204 | %doc doc/examples
|
---|
205 | %doc %dir %{_datadir}/gtk-doc/html/libxml2
|
---|
206 | %doc %{_datadir}/gtk-doc/html/libxml2/*.devhelp
|
---|
207 | %doc %{_datadir}/gtk-doc/html/libxml2/*.html
|
---|
208 | %doc %{_datadir}/gtk-doc/html/libxml2/*.png
|
---|
209 | %doc %{_datadir}/gtk-doc/html/libxml2/*.css
|
---|
210 |
|
---|
211 | %{_libdir}/xml2*_dll.a
|
---|
212 | %{_libdir}/*.sh
|
---|
213 | %{_includedir}/*
|
---|
214 | %{_bindir}/xml2-config
|
---|
215 | %{_datadir}/aclocal/libxml.m4
|
---|
216 | %{_libdir}/pkgconfig/libxml-2.0.pc
|
---|
217 | %{_libdir}/cmake/libxml2/libxml2-config.cmake
|
---|
218 |
|
---|
219 | %files static
|
---|
220 | %defattr(-, root, root)
|
---|
221 |
|
---|
222 | %{_libdir}/xml2.a
|
---|
223 |
|
---|
224 | %files -n python-%{name}
|
---|
225 | %defattr(-, root, root)
|
---|
226 |
|
---|
227 | %{_libdir}/python2*/site-packages/libxml2.py*
|
---|
228 | %{_libdir}/python2*/site-packages/drv_libxml2.py*
|
---|
229 | %{_libdir}/python2*/site-packages/libxml2mod*
|
---|
230 | %{_libdir}/python2*/site-packages/xml2mod.dll
|
---|
231 | %doc python/TODO
|
---|
232 | %doc python/libxml2class.txt
|
---|
233 | %doc doc/*.py
|
---|
234 | %doc doc/python.html
|
---|
235 |
|
---|
236 | %if 0%{?with_python3}
|
---|
237 | %files -n python3-%{name}
|
---|
238 | %defattr(-, root, root)
|
---|
239 |
|
---|
240 | %{_libdir}/python3*/site-packages/libxml2.py*
|
---|
241 | %{_libdir}/python3*/site-packages/drv_libxml2.py*
|
---|
242 | %{_libdir}/python3*/site-packages/__pycache__/*py*
|
---|
243 | %{_libdir}/python3*/site-packages/libxml2mod*
|
---|
244 | %doc python/TODO
|
---|
245 | %doc python/libxml2class.txt
|
---|
246 | %doc py3doc/*.py
|
---|
247 | %doc doc/python.html
|
---|
248 | %endif # with_python3
|
---|
249 |
|
---|
250 | %changelog
|
---|
251 | * Wed Nov 30 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 2.9.4-2
|
---|
252 | - add -nostdlib to forwarders, to need less heap
|
---|
253 |
|
---|
254 | * Fri Nov 25 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 2.9.4-1
|
---|
255 | - update to version 2.9.4
|
---|
256 | - adjust to the current toolchain
|
---|
257 | - build and install the python binding within this spec as well
|
---|
258 |
|
---|
259 | * Mon Apr 07 2014 yd
|
---|
260 | - build for python 2.7.
|
---|
261 | - added debug package with symbolic info for exceptq.
|
---|
262 |
|
---|
263 | * Mon Jan 16 2012 yd
|
---|
264 | - rebuild with libc 0.6.4 runtime.
|
---|