7fa7cfb4903b067909d722a1c134681dbd9ffdb8
[platform/upstream/libxml2.git] / libxml2.spec
1 %global with_python3 1
2
3 Summary: Library providing XML and HTML support
4 Name: libxml2
5 Version: 2.9.5
6 Release: 0rc1%{?dist}%{?extra_release}
7 License: MIT
8 Group: Development/Libraries
9 Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}-rc1.tar.gz
10 BuildRoot: %{_tmppath}/%{name}-%{version}-root
11 BuildRequires: python-devel
12 %if 0%{?with_python3}
13 BuildRequires: python3-devel
14 %endif # with_python3
15 BuildRequires: zlib-devel
16 BuildRequires: pkgconfig
17 BuildRequires: xz-devel
18 URL: http://xmlsoft.org/
19
20 %description
21 This library allows to manipulate XML files. It includes support
22 to read, modify and write XML and HTML files. There is DTDs support
23 this includes parsing and validation even with complex DtDs, either
24 at parse time or later once the document has been modified. The output
25 can be a simple SAX stream or and in-memory DOM like representations.
26 In this case one can use the built-in XPath and XPointer implementation
27 to select sub nodes or ranges. A flexible Input/Output mechanism is
28 available, with existing HTTP and FTP modules and combined to an
29 URI library.
30
31 %package devel
32 Summary: Libraries, includes, etc. to develop XML and HTML applications
33 Group: Development/Libraries
34 Requires: libxml2 = %{version}-%{release}
35 Requires: zlib-devel
36 Requires: xz-devel
37 Requires: pkgconfig
38
39 %description devel
40 Libraries, include files, etc you can use to develop XML applications.
41 This library allows to manipulate XML files. It includes support
42 to read, modify and write XML and HTML files. There is DTDs support
43 this includes parsing and validation even with complex DtDs, either
44 at parse time or later once the document has been modified. The output
45 can be a simple SAX stream or and in-memory DOM like representations.
46 In this case one can use the built-in XPath and XPointer implementation
47 to select sub nodes or ranges. A flexible Input/Output mechanism is
48 available, with existing HTTP and FTP modules and combined to an
49 URI library.
50
51 %package static
52 Summary: Static library for libxml2
53 Group: Development/Libraries
54 Requires: libxml2 = %{version}-%{release}
55
56 %description static
57 Static library for libxml2 provided for specific uses or shaving a few
58 microseconds when parsing, do not link to them for generic purpose packages.
59
60 %package -n python-%{name}
61 %{?python_provide:%python_provide python-%{name}}
62 Summary: Python bindings for the libxml2 library
63 Group: Development/Libraries
64 Requires: libxml2 = %{version}-%{release}
65 Obsoletes: %{name}-python < %{version}-%{release}
66 Provides: %{name}-python = %{version}-%{release}
67
68 %description -n python-%{name}
69 The libxml2-python package contains a Python 2 module that permits applications
70 written in the Python programming language, version 2, to use the interface
71 supplied by the libxml2 library to manipulate XML files.
72
73 This library allows to manipulate XML files. It includes support
74 to read, modify and write XML and HTML files. There is DTDs support
75 this includes parsing and validation even with complex DTDs, either
76 at parse time or later once the document has been modified.
77
78 %if 0%{?with_python3}
79 %package -n python3-%{name}
80 Summary: Python 3 bindings for the libxml2 library
81 Group: Development/Libraries
82 Requires: libxml2 = %{version}-%{release}
83 Obsoletes: %{name}-python3 < %{version}-%{release}
84 Provides: %{name}-python3 = %{version}-%{release}
85
86 %description -n python3-%{name}
87 The libxml2-python3 package contains a Python 3 module that permits
88 applications written in the Python programming language, version 3, to use the
89 interface supplied by the libxml2 library to manipulate XML files.
90
91 This library allows to manipulate XML files. It includes support
92 to read, modify and write XML and HTML files. There is DTDs support
93 this includes parsing and validation even with complex DTDs, either
94 at parse time or later once the document has been modified.
95 %endif # with_python3
96
97 %prep
98 %setup -q
99
100 mkdir py3doc
101 cp doc/*.py py3doc
102 sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py
103
104 %build
105 %configure
106 make %{_smp_mflags}
107
108 find doc -type f -exec chmod 0644 \{\} \;
109
110 %install
111 rm -fr %{buildroot}
112
113 make install DESTDIR=%{buildroot}
114
115 %if 0%{?with_python3}
116 make clean
117 %configure --with-python=%{__python3}
118 make install DESTDIR=%{buildroot}
119 %endif # with_python3
120
121
122 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
123 rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
124 rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
125 rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/*
126 rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/*
127 (cd doc/examples ; make clean ; rm -rf .deps Makefile)
128 gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
129
130 %check
131 make runtests
132
133 %clean
134 rm -fr %{buildroot}
135
136 %post -p /sbin/ldconfig
137
138 %postun -p /sbin/ldconfig
139
140 %files
141 %defattr(-, root, root)
142
143 %doc AUTHORS NEWS README Copyright TODO
144 %doc %{_mandir}/man1/xmllint.1*
145 %doc %{_mandir}/man1/xmlcatalog.1*
146 %doc %{_mandir}/man3/libxml.3*
147
148 %{_libdir}/lib*.so.*
149 %{_bindir}/xmllint
150 %{_bindir}/xmlcatalog
151
152 %files devel
153 %defattr(-, root, root)
154
155 %doc %{_mandir}/man1/xml2-config.1*
156 %doc AUTHORS NEWS README Copyright
157 %doc doc/*.html doc/html doc/*.gif doc/*.png
158 %doc doc/tutorial doc/libxml2-api.xml.gz
159 %doc doc/examples
160 %doc %dir %{_datadir}/gtk-doc/html/libxml2
161 %doc %{_datadir}/gtk-doc/html/libxml2/*.devhelp
162 %doc %{_datadir}/gtk-doc/html/libxml2/*.html
163 %doc %{_datadir}/gtk-doc/html/libxml2/*.png
164 %doc %{_datadir}/gtk-doc/html/libxml2/*.css
165
166 %{_libdir}/lib*.so
167 %{_libdir}/*.sh
168 %{_includedir}/*
169 %{_bindir}/xml2-config
170 %{_datadir}/aclocal/libxml.m4
171 %{_libdir}/pkgconfig/libxml-2.0.pc
172 %{_libdir}/cmake/libxml2/libxml2-config.cmake
173
174 %files static
175 %defattr(-, root, root)
176
177 %{_libdir}/*a
178
179 %files -n python-%{name}
180 %defattr(-, root, root)
181
182 %{_libdir}/python2*/site-packages/libxml2.py*
183 %{_libdir}/python2*/site-packages/drv_libxml2.py*
184 %{_libdir}/python2*/site-packages/libxml2mod*
185 %doc python/TODO
186 %doc python/libxml2class.txt
187 %doc python/tests/*.py
188 %doc doc/*.py
189 %doc doc/python.html
190
191 %if 0%{?with_python3}
192 %files -n python3-%{name}
193 %defattr(-, root, root)
194
195 %{_libdir}/python3*/site-packages/libxml2.py*
196 %{_libdir}/python3*/site-packages/drv_libxml2.py*
197 %{_libdir}/python3*/site-packages/__pycache__/*py*
198 %{_libdir}/python3*/site-packages/libxml2mod*
199 %doc python/TODO
200 %doc python/libxml2class.txt
201 %doc py3doc/*.py
202 %doc doc/python.html
203 %endif # with_python3
204
205 %changelog
206 * Tue Aug 29 2017 Daniel Veillard <veillard@redhat.com>
207 - upstream release 2.9.5 see http://xmlsoft.org/news.html
208