# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define _libdir64 %{_prefix}/lib64 Summary: Library providing XML and HTML support Name: libxml2 Version: 2.10.3 Release:1 License: MIT Group: Development/Libraries URL: http://xmlsoft.org/ Source0: ftp://xmlsoft.org/%{name}-%{version}.tar.xz Patch0: %{name}-2.10.2-iconv.patch BuildRequires: libiconv >= 1.16 BuildRequires: python3-devel >= 3.7.9 BuildRequires: xz-devel >= 5.2.4 BuildRequires: zlib-devel >= 1.2.11 Requires: libiconv >= 1.16 Requires: xz-libs >= 5.2.4 Requires: zlib >= 1.2.11 Requires: libgcc >= 10.3.0 %description This library allows to manipulate XML files. It includes support to read, modify and write XML and HTML files. There is DTDs support this includes parsing and validation even with complex DtDs, either at parse time or later once the document has been modified. The output can be a simple SAX stream or and in-memory DOM like representations. In this case one can use the built-in XPath and XPointer implementation to select subnodes or ranges. A flexible Input/Output mechanism is available, with existing HTTP and FTP modules and combined to an URI library. The library is available as 32-bit and 64-bit. %package devel Summary: Libraries, includes, etc. to develop XML and HTML applications Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: xz-devel >= 5.2.4 #Requires: zlib-devel Requires: pkg-config %description devel Libraries, include files, etc you can use to develop XML applications. This library allows to manipulate XML files. It includes support to read, modify and write XML and HTML files. There is DTDs support this includes parsing and validation even with complex DtDs, either at parse time or later once the document has been modified. The output can be a simple SAX stream or and in-memory DOM like representations. In this case one can use the built-in XPath and XPointer implementation to select subnodes or ranges. A flexible Input/Output mechanism is available, with existing HTTP and FTP modules and combined to an URI library. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "xlc -q64" or "gcc -maix64". %package python3 Summary: Python bindings for the libxml2 library Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: python3 >= 3.7.12 Requires: libgcc >= 10.3.0 Obsoletes: libxml2-python <= 2.9.14 %description python3 The libxml2-python3 package contains a module that permits applications written in the Python programming language to use the interface supplied by the libxml2 library to manipulate XML files. This library allows to manipulate XML files. It includes support to read, modify and write XML and HTML files. There is DTDs support this includes parsing and validation even with complex DTDs, either at parse time or later once the document has been modified. %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit tar cf - . | (cd ../64bit ; tar xpf -) %build export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh export CC="gcc" export CXX="g++ -D_LARGE_FILES=1" cd 64bit # first build the 64-bit version export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib " export OBJECT_MODE=64 export CFLAGS="-maix64" export PYTHON=/opt/freeware/bin/python3 ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --with-python=python3_64 \ --with-lzma=/opt/freeware \ --with-iconv=/opt/freeware make %{?_smp_mflags} if [ "%{dotests}" == 1 ] then gmake -k check LDFLAGS="-L%{_builddir}/%{name}-%{version}/64bit/.libs $LDFLAGS" LIBPATH="%{_builddir}/%{name}-%{version}/64bit/python3/.libs" || true fi cd ../32bit # now build the 32-bit version unset CFLAGS export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export OBJECT_MODE=32 export PYTHON=/opt/freeware/bin/python3_32 ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --with-lzma=/opt/freeware \ --enable-shared --disable-static \ --with-python=%{_bindir}/python2_32 \ --with-iconv=/opt/freeware make %{?_smp_mflags} if [ "%{dotests}" == 1 ] then gmake -k check LDFLAGS="-L%{_builddir}/%{name}-%{version}/32bit/.libs $LDFLAGS" LIBPATH="%{_builddir}/%{name}-%{version}/32bit/python3/.libs" || true cd .. fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 make install DESTDIR=${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 make install DESTDIR=${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in xmlcatalog xmllint do mv ${f} ${f}_32 done ) # Make 64bit executable as default ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in xmlcatalog xmllint do ln -sf ${f}_64 ${f} done ) /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) ( cd ${RPM_BUILD_ROOT}%{_libdir}/python3*/site-packages /usr/bin/ar -X32 -x libxml2mod.a cd ${RPM_BUILD_ROOT}%{_libdir64}/python3*/site-packages /usr/bin/ar -X64 -x libxml2mod.a ) (cd doc/examples ; make clean ; rm -rf .deps) rm -f doc/examples/index.py gzip --best doc/%{name}-api.xml # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.so* #%post python #echo "" #echo "NOTE: Python alwyas tries to link to the system provided libxml2.a /usr/lib/libxml2.a due to its libpath." #echo "But python-libxml2 uses the /opt/freeware/lib/libxml2.a which comes with python-libxml2." #echo "So one who needs to use python-libxml2, need to set the LIBPATH as /opt/freeware/lib:/usr/lib:/lib," #echo "as import libxml2 mayn't work without LIBPATH setup" #echo "" #echo "creatrepo mayn't work properly if we don't the LIBPATH as mentioned above." #echo "So we can use createrepo as \"LIBPATH=/opt/freeware/lib:/usr/lib:/lib createrepo \"" #echo "" #echo "We will keep looking for permanent solution instead of setting LIBPATH" %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc 32bit/NEWS %doc 32bit/README.md 32bit/Copyright 32bit/TODO %{_bindir}/xmlcatalog* %{_bindir}/xmllint* %{_libdir}/lib*.a %{_libdir}/lib*.so* %{_libdir64}/lib*.so* %{_mandir}/man1/xmllint.1 %{_mandir}/man1/xmlcatalog.1 %files devel %defattr(-,root,system) %doc 32bit/NEWS %doc 32bit/README.md 32bit/Copyright 32bit/TODO %doc 32bit/doc/*.html %doc 32bit/doc/tutorial 32bit/doc/%{name}-api.xml.gz %doc 32bit/doc/examples %doc %{_datadir}/gtk-doc/html/%{name}/*.devhelp2 %doc %{_datadir}/gtk-doc/html/%{name}/*.html %doc %{_datadir}/gtk-doc/html/%{name}/*.png %doc %{_datadir}/gtk-doc/html/%{name}/*.css %{_bindir}/xml2-config* %{_includedir}/* %{_libdir}/pkgconfig/* %{_libdir64}/pkgconfig/* %{_mandir}/man1/xml2-config.1 %{_datadir}/aclocal/libxml.m4 %files python3 %defattr(-,root,system) %doc 32bit/python/TODO %doc 32bit/python/libxml2class.txt %doc 64bit/python/tests/*.py %doc 64bit/doc/*.py %{_libdir}/python3*/site-packages/libxml2.py* %{_libdir}/python3*/site-packages/drv_libxml2.py* %{_libdir}/python3*/site-packages/libxml2mod.a* %{_libdir}/python3*/site-packages/libxml2mod.so* %{_libdir64}/python3*/site-packages/libxml2mod.a* %{_libdir64}/python3*/site-packages/libxml2mod.so* %changelog * Mon Dec 26 2022 Reshma V Kumar - 2.10.3-1 - Update to fix CVE-2022-40304,CVE-2022-40303 * Mon Oct 03 2022 Reshma V Kumar - 2.10.2-1 - Update to fix CVE-2022-2309 - Drop python2 support * Wed May 11 2022 Reshma V Kumar - 2.9.14-1 - Update to fix CVE-2022-23308 * Tue Jul 13 2021 Sushree Das - 2.9.11-1 - Updated to 2.9.11 Version to solve CVE-2021-3516, CVE-2021-3537 and CVE-2021-3518 * Mon Oct 05 2020 Baanu Tumma - 2.9.10-1 - Update to 2.9.10 version to solve CVE-2020-24977 - Built using python3 - No longer shipping files from /usr directory * Fri Mar 15 2019 Baanu Tumma 2.9.9 - Updated to Latest Version * Thu Aug 2 2018 Harshita jain 2.9.7-1 - Update to latest version * Thu Oct 6 2016 Sangamesh Mallayya 2.9.4-1 - Update to have many reported security vulnerability fixes. * Mon Dec 28 2015 Michael Perzl - 2.9.3-1 - updated to version 2.9.3 * Tue Nov 18 2014 Michael Perzl - 2.9.2-1 - updated to version 2.9.2 * Fri May 03 2013 Michael Perzl - 2.9.1-1 - updated to version 2.9.1 * Tue Oct 16 2012 Michael Perzl - 2.9.0-1 - updated to version 2.9.0 * Tue Oct 16 2012 Michael Perzl - 2.8.0-3 - fixed the collision with libxml2.a provided by bos.rte.control for AIX 6.1 and higher, thus removed the symlinks in /usr/lib * Tue Jul 31 2012 Michael Perzl - 2.8.0-2 - added missing dependency on xz since version 2.8.0 * Tue May 29 2012 Michael Perzl - 2.8.0-1 - updated to version 2.8.0 * Fri Nov 11 2011 Michael Perzl - 2.7.8-2 - added RTL-style shared libraries and python package * Mon Dec 06 2010 Michael Perzl - 2.7.8-1 - updated to version 2.7.8 * Thu Apr 08 2010 Michael Perzl - 2.7.7-1 - updated to version 2.7.7 * Thu Nov 19 2009 Michael Perzl - 2.7.6-1 - updated to version 2.7.6 * Wed Jul 08 2009 Michael Perzl - 2.7.3-1 - updated to version 2.7.3 and removed the dependency on python * Wed Apr 23 2008 Michael Perzl - 2.6.32-1 - updated to version 2.6.32 * Wed Apr 23 2008 Michael Perzl - 2.6.31-2 - some minor spec file fixes * Tue Jan 15 2008 Michael Perzl - 2.6.31-1 - first version for AIX V5.1 and higher