%define with_python2 1 %define with_python3 1 Name: libcomps Version: 0.1.8 Release: 21 Summary: Comps XML file manipulation library License: GPLv2+ URL: https://github.com/rpm-software-management/libcomps Source0: %{url}/archive/%{name}-%{version}/%{name}-%{version}.tar.gz Patch0000: CVE-2019-3817-Fix-UAF-in-comps_objmrtree_unite-function.patch Patch0001: Fix-Python-method-descriptors-for-Python-3.8.patch BuildRequires: gcc cmake zlib-devel libxml2-devel check-devel expat-devel %description Libcomps is library for structure-like manipulation with content of comps XML files. Supports read/write XML file, structure(s) modification. %package devel Summary: Development files for libcomps library Requires: %{name} = %{version}-%{release} %description devel Development files for libcomps library. %package help Summary: Documentation files for libcomps library Requires: %{name} = %{version}-%{release} BuildArch: noarch BuildRequires: python3-sphinx BuildRequires: doxygen %description help Documentation files for libcomps library and python bindings libcomps library. %if %{with_python2} %package -n python2-%{name} Summary: Python 2 bindings for libcomps library %{?python_provide:%python_provide python2-%{name}} BuildRequires: python2-devel Requires: %{name} = %{version}-%{release} %description -n python2-%{name} Python 2 bindings for libcomps library. %endif %if %{with_python3} %package -n python3-%{name} Summary: Python 3 bindings for libcomps library BuildRequires: python3-devel %{?python_provide:%python_provide python3-%{name}} Requires: %{name} = %{version}-%{release} Obsoletes: platform-python-%{name} < %{version}-%{release} %description -n python3-%{name} Python3 bindings for libcomps library. %endif %prep %autosetup -n %{name}-%{name}-%{version} -p1 %build %if %{with_python2} mkdir build-py2 pushd build-py2 %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=2 %make_build popd %endif %if %{with_python2} mkdir build-py3 pushd build-py3 %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=3 %make_build popd %endif mkdir build-doc pushd build-doc %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=3 make %{?_smp_mflags} docs make %{?_smp_mflags} pydocs popd %install %if %{with_python2} pushd build-py2 %make_install popd %endif %if %{with_python3} pushd build-py3 %make_install popd %endif %check %if %{with_python2} pushd build-py2 make test make pytest popd %endif %if %{with_python3} pushd build-py3 make test make pytest popd %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license COPYING %doc README.md %{_libdir}/%{name}.so.* %files devel %{_libdir}/%{name}.so %{_includedir}/%{name}/ %files help %doc build-doc/docs/libcomps-doc/html %doc build-doc/src/python/docs/html %if %{with_python2} %files -n python2-%{name} %{python2_sitearch}/%{name}/ %endif %if %{with_python3} %files -n python3-%{name} %{python3_sitearch}/%{name}/ %endif %changelog * Mon Jun 22 2020 chenditang - 0.1.8-21 - Type:enhancement - ID:NA - SUG:NA - DESC:Fix Python method descriptors for Python-3.8. * Thu Feb 20 2020 chengquan - 0.1.8-20 - Type:enhancement - ID:NA - SUG:NA - DESC:Update python-sphinx support to python3 * Wed Sep 26 2019 openEuler Buildteam - 0.1.8-19 - del requires * Tue Sep 24 2019 shenyangyang - 0.1.8-18 - Type:enhancement - ID:NA - SUG:NA - DESC:revise help package * Thu Aug 22 2019 openEuler Buildteam - 0.1.8-17 - Type:NA - ID:NA - SUG:NA - DESC:rewrite spec file * Wed Aug 21 2019 Zhipeng Xie - 0.1.8-16 - Type:enhancement - ID:NA - SUG:NA - DESC:modify patch name * Mon Jun 3 2019 gaoyi - 0.1.8-15 - Type:bugfix - ID:NA - SUG:NA - DESC:CVE for libcomps https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046 * Fri Jul 13 2018 openEuler Buildteam - 0.1.8-14 - Package init