libxml2.spec 6.3 KB

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