source: spec/trunk/SPECS/libxml2.spec@ 1010

Last change on this file since 1010 was 915, checked in by Silvan Scherrer, 9 years ago

spec: libxml2: Release version 2.9.4-2.

  • Property svn:eol-style set to native
File size: 8.2 KB
Line 
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
8Summary: Library providing XML and HTML support
9Name: libxml2
10Version: 2.9.4
11Release: 2%{?dist}
12License: MIT
13Group: Development/Libraries
14URL: http://xmlsoft.org/
15Vendor: bww bitwise works GmbH
16
17Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
18
19# DEF files to create forwarders for the legacy package
20Source10: libxml2.def
21
22BuildRoot: %{_tmppath}/%{name}-%{version}-root
23BuildRequires: python-devel
24%if 0%{?with_python3}
25BuildRequires: python3-devel
26%endif # with_python3
27BuildRequires: zlib-devel
28BuildRequires: pkgconfig
29#BuildRequires: xz-devel
30Requires: libcx >= 0.4
31
32%description
33This library allows to manipulate XML files. It includes support
34to read, modify and write XML and HTML files. There is DTDs support
35this includes parsing and validation even with complex DtDs, either
36at parse time or later once the document has been modified. The output
37can be a simple SAX stream or and in-memory DOM like representations.
38In this case one can use the built-in XPath and XPointer implementation
39to select subnodes or ranges. A flexible Input/Output mechanism is
40available, with existing HTTP and FTP modules and combined to an
41URI library.
42
43%package devel
44Summary: Libraries, includes, etc. to develop XML and HTML applications
45Group: Development/Libraries
46Requires: libxml2 = %{version}-%{release}
47Requires: zlib-devel
48#Requires: xz-devel
49Requires: pkgconfig
50
51%description devel
52Libraries, include files, etc you can use to develop XML applications.
53This library allows to manipulate XML files. It includes support
54to read, modify and write XML and HTML files. There is DTDs support
55this includes parsing and validation even with complex DtDs, either
56at parse time or later once the document has been modified. The output
57can be a simple SAX stream or and in-memory DOM like representations.
58In this case one can use the built-in XPath and XPointer implementation
59to select subnodes or ranges. A flexible Input/Output mechanism is
60available, with existing HTTP and FTP modules and combined to an
61URI library.
62
63%package static
64Summary: Static library for libxml2
65Group: Development/Libraries
66Requires: libxml2 = %{version}-%{release}
67
68%description static
69Static library for libxml2 provided for specific uses or shaving a few
70microseconds when parsing, do not link to them for generic purpose packages.
71
72%package -n python-%{name}
73Summary: Python bindings for the libxml2 library
74Group: Development/Libraries
75Requires: libxml2 = %{version}-%{release}
76Obsoletes: %{name}-python < %{version}-%{release}
77Provides: %{name}-python = %{version}-%{release}
78
79%description -n python-%{name}
80The libxml2-python package contains a Python 2 module that permits applications
81written in the Python programming language, version 2, to use the interface
82supplied by the libxml2 library to manipulate XML files.
83
84This library allows to manipulate XML files. It includes support
85to read, modify and write XML and HTML files. There is DTDs support
86this includes parsing and validation even with complex DTDs, either
87at parse time or later once the document has been modified.
88
89%if 0%{?with_python3}
90%package -n python3-%{name}
91Summary: Python 3 bindings for the libxml2 library
92Group: Development/Libraries
93Requires: libxml2 = %{version}-%{release}
94Obsoletes: %{name}-python3 < %{version}-%{release}
95Provides: %{name}-python3 = %{version}-%{release}
96
97%description -n python3-%{name}
98The libxml2-python3 package contains a Python 3 module that permits
99applications written in the Python programming language, version 3, to use the
100interface supplied by the libxml2 library to manipulate XML files.
101
102This library allows to manipulate XML files. It includes support
103to read, modify and write XML and HTML files. There is DTDs support
104this includes parsing and validation even with complex DTDs, either
105at 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
115svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
116rm -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.
121for m in %{SOURCE10}; do
122 cp ${m} .
123done
124
125%if 0%{?with_python3}
126mkdir py3doc
127cp doc/*.py py3doc
128sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py
129%endif
130
131export NOCONFIGURE=1
132autogen.sh
133
134%build
135export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
136export LIBS="-lcx"
137export VENDOR="%{vendor}"
138%configure
139
140make %{?smp_mflags}
141
142
143%install
144rm -fr %{buildroot}
145
146make install DESTDIR=%{buildroot}
147
148%if 0%{?with_python3}
149make clean
150%configure --with-python=%{__python3}
151make install DESTDIR=%{buildroot}
152%endif # with_python3
153
154# multiarch crazyness on timestamp differences or Makefile/binaries for examples
155touch -m --reference=$RPM_BUILD_ROOT/%{_includedir}/libxml2/libxml/parser.h $RPM_BUILD_ROOT/%{_bindir}/xml2-config
156
157rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
158rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
159rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
160rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/*
161rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/*
162(cd doc/examples ; make clean ; rm -rf .deps Makefile)
163gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
164
165# Generate & install forwarder DLLs.
166gcc -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
169ln -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
175rm -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.
Note: See TracBrowser for help on using the repository browser.