Blame SPECS/libcomps.spec

f83577
# Do not build python3 bindings for RHEL <= 7
f83577
%if 0%{?rhel} && 0%{?rhel} <= 7
f83577
%bcond_with python3
f83577
%else
f83577
%bcond_without python3
f83577
%endif
f83577
f83577
# Do not build python2 bindings for RHEL > 7 and Fedora > 29
f83577
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
f83577
%bcond_with python2
f83577
%else
f83577
%bcond_without python2
f83577
%endif
f83577
f83577
Name:           libcomps
f83577
Version:        0.1.11
0492d2
Release:        3%{?dist}
f83577
Summary:        Comps XML file manipulation library
f83577
f83577
License:        GPLv2+
f83577
URL:            https://github.com/rpm-software-management/libcomps
f83577
Source0:        %{url}/archive/%{name}-%{version}/%{name}-%{version}.tar.gz
0492d2
Patch0:         0001-Fix-order-of-asserts-in-unit-test-RhBug1713220.patch
0492d2
Patch1:         0002-Empty-dict-created-by-_by_lang-in-python-api-causes-segfault.patch
f83577
f83577
BuildRequires:  gcc-c++
f83577
BuildRequires:  cmake
f83577
BuildRequires:  gcc
f83577
BuildRequires:  libxml2-devel
f83577
BuildRequires:  check-devel
f83577
BuildRequires:  expat-devel
f83577
BuildRequires:  zlib-devel
f83577
f83577
%description
f83577
Libcomps is library for structure-like manipulation with content of
f83577
comps XML files. Supports read/write XML file, structure(s) modification.
f83577
f83577
%package devel
f83577
Summary:        Development files for libcomps library
f83577
Requires:       %{name}%{?_isa} = %{version}-%{release}
f83577
f83577
%description devel
f83577
Development files for libcomps library.
f83577
f83577
%package doc
f83577
Summary:        Documentation files for libcomps library
f83577
Requires:       %{name} = %{version}-%{release}
f83577
BuildArch:      noarch
f83577
BuildRequires:  doxygen
f83577
f83577
%description doc
f83577
Documentation files for libcomps library.
f83577
f83577
%package -n python-%{name}-doc
f83577
Summary:        Documentation files for python bindings libcomps library
f83577
Requires:       %{name} = %{version}-%{release}
f83577
BuildArch:      noarch
f83577
%if %{with python3}
f83577
BuildRequires:  python3-sphinx
f83577
%endif
f83577
%if %{with python2}
f83577
%if 0%{?rhel} && 0%{?rhel} <= 7
f83577
BuildRequires:  python-sphinx
f83577
%else
f83577
BuildRequires:  python2-sphinx
f83577
%endif
f83577
%endif
f83577
f83577
%description -n python-%{name}-doc
f83577
Documentation files for python bindings libcomps library.
f83577
f83577
%if %{with python2}
f83577
%package -n python2-%{name}
f83577
Summary:        Python 2 bindings for libcomps library
f83577
%{?python_provide:%python_provide python2-%{name}}
f83577
BuildRequires:  python2-devel
f83577
Requires:       %{name}%{?_isa} = %{version}-%{release}
f83577
f83577
%description -n python2-%{name}
f83577
Python 2 bindings for libcomps library.
f83577
%endif
f83577
f83577
%if %{with python3}
f83577
%package -n python3-%{name}
f83577
Summary:        Python 3 bindings for libcomps library
f83577
BuildRequires:  python3-devel
f83577
%{?python_provide:%python_provide python3-%{name}}
f83577
Requires:       %{name}%{?_isa} = %{version}-%{release}
f83577
Obsoletes:      platform-python-%{name} < %{version}-%{release}
f83577
f83577
%description -n python3-%{name}
f83577
Python3 bindings for libcomps library.
f83577
%endif
f83577
f83577
%prep
f83577
%autosetup -n %{name}-%{name}-%{version} -p1
f83577
f83577
%if %{with python2}
f83577
mkdir build-py2
f83577
%endif
f83577
%if %{with python3}
f83577
mkdir build-py3
f83577
%endif
f83577
mkdir build-doc
f83577
f83577
%build
f83577
%if %{with python2}
f83577
pushd build-py2
f83577
  %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=2
f83577
  %make_build
f83577
popd
f83577
%endif
f83577
f83577
%if %{with python3}
f83577
pushd build-py3
f83577
  %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=3
f83577
  %make_build
f83577
popd
f83577
%endif
f83577
f83577
pushd build-doc
f83577
%if %{with python2}
f83577
  %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=2
f83577
%else
f83577
%if %{with python3}
f83577
  %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=3
f83577
%endif
f83577
%endif
f83577
  make %{?_smp_mflags} docs
f83577
  make %{?_smp_mflags} pydocs
f83577
popd
f83577
f83577
%install
f83577
%if %{with python2}
f83577
pushd build-py2
f83577
  %make_install
f83577
popd
f83577
%endif
f83577
f83577
%if %{with python3}
f83577
pushd build-py3
f83577
  %make_install
f83577
popd
f83577
%endif
f83577
f83577
%check
f83577
%if %{with python2}
f83577
pushd build-py2
f83577
  make test
f83577
  make pytest
f83577
popd
f83577
%endif
f83577
f83577
%if %{with python3}
f83577
pushd build-py3
f83577
  make test
f83577
  make pytest
f83577
popd
f83577
%endif
f83577
f83577
%if %{undefined ldconfig_scriptlets}
f83577
%post -p /sbin/ldconfig
f83577
%postun -p /sbin/ldconfig
f83577
%else
f83577
%ldconfig_scriptlets
f83577
%endif
f83577
f83577
%files
f83577
%license COPYING
f83577
%doc README.md
f83577
%{_libdir}/%{name}.so.*
f83577
f83577
%files devel
f83577
%{_libdir}/%{name}.so
f83577
%{_includedir}/%{name}/
f83577
f83577
%files doc
f83577
%doc build-doc/docs/libcomps-doc/html
f83577
f83577
%files -n python-%{name}-doc
f83577
%doc build-doc/src/python/docs/html
f83577
f83577
%if %{with python2}
f83577
%files -n python2-%{name}
f83577
%{python2_sitearch}/%{name}/
f83577
%endif
f83577
f83577
%if %{with python3}
f83577
%files -n python3-%{name}
f83577
%{python3_sitearch}/%{name}/
f83577
%endif
f83577
f83577
%changelog
0492d2
* Wed Nov 13 2019 Ales Matej <amatej@redhat.com> - 0.1.11-3
0492d2
- Fix segfault caused by empty dict created by *_by_lang in python api (RhBug:1757959)
0492d2
0492d2
* Thu Aug 01 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.1.11-2
0492d2
- Backport patch: Fix order of asserts in unit test (RhBug:1713220)
0492d2
f83577
* Mon May 13 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.1.11-1
f83577
- Update to 0.1.11
f83577
f83577
* Thu Dec 13 2018 Daniel Mach <dmach@redhat.com> - 0.1.8-13
f83577
- Fix resource leaks, double free, unused code, optimize
f83577
- Resolves: rhbz#1606974
f83577
f83577
* Mon Jun 25 2018 Lumír Balhar <lbalhar@redhat.com> - 0.1.8-12
f83577
- Disable Python 2 subpackage (and dependent) by default
f83577
f83577
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-11
f83577
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f83577
f83577
* Wed Jan 31 2018 Igor Gnatenko <ignatenko@redhat.com> - 0.1.8-10
f83577
- Switch to %%ldconfig_scriptlets
f83577
f83577
* Tue Nov 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.1.8-9
f83577
- Use better Obsoletes for platform-python
f83577
f83577
* Fri Nov 03 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.1.8-8
f83577
- Remove platform-python subpackage
f83577
f83577
* Fri Sep 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.1.8-7
f83577
- Disable platform python on old releases
f83577
f83577
* Thu Aug 10 2017 Lumír Balhar <lbalhar@redhat.com> - 0.1.8-6
f83577
- Add Platform Python subpackage (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack)
f83577
f83577
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-5
f83577
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
f83577
f83577
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-4
f83577
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f83577
f83577
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-3
f83577
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f83577
f83577
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 0.1.8-2
f83577
- Rebuild for Python 3.6
f83577
f83577
* Thu Sep 22 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.1.8-1
f83577
- Update to 0.1.8
f83577
f83577
* Tue Aug 09 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.1.7-6
f83577
- Add %%{?system_python_abi}
f83577
f83577
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-5
f83577
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
f83577
f83577
* Tue Apr 12 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.1.7-4
f83577
- Adopt to new packaging guidelines
f83577
- Use %%license macro
f83577
- Fix file ownerships
f83577
f83577
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-3
f83577
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f83577
f83577
* Wed Oct 14 2015 Robert Kuska <rkuska@redhat.com> - 0.1.7-2
f83577
- Rebuilt for Python3.5 rebuild
f83577
f83577
* Thu Jul 02 2015 Jindrich Luza <jluza@redhat.com> 0.1.7
f83577
- added langpacks to union process
f83577
- comps DOCTYPE read-write-read fix
f83577
- support biarchonly attribute
f83577
- fixed rhbz#1073885 rhbz#1073890 rhbz#1073907 rhbz#1073979
f83577
- fix rhbz#1073079
f83577
- comps_*_match() now support fnmatching
f83577
- added libpycomps.MATCH_IGNORECASE as matching flag
f83577
- added group.packages_match
f83577
- added comps.groups_match, comps.categories_match, comps.entironments_match
f83577
- PyCOMPS_Package hash
f83577
- cmake-2.6, python-2.6, RHEL-6 compatible
f83577
- '_arch' attribute change to 'arch'
f83577
- empty 'arch' attribute will be ommited from output from now
f83577
f83577
* Wed Jan 29 2014 Jindrich Luza <jluza@redhat.com> 0.1.6
f83577
- version bumped
f83577
- added libcomps.MDict.keys()
f83577
-         libcomps.MDict.values()
f83577
-         libcomps.MDict.items()
f83577
-         libcomps.MDict.clear()
f83577
-         libcomps.MDict.update()
f83577
-         libcomps.MDict.copy()
f83577
- COMPS_List replaced with COMPS_HSList
f83577
- added missing basearchonly to DocGroupPackage
f83577
- python3/CMakeLists.txt fixed
f83577
- added explicit attributes support for xml options
f83577
- added arch_filter test for python
f83577
- insert method in libcomps.Sequence
f83577
- Unioning is now accomplished with replace x append policy
f83577
- Weaker package equality check (comparing only name now)
f83577
- Fixed leeks in unioning
f83577
- modified test_merge_comps test_libcomps
f83577
- dictionaries are now storing keys in alphabetical order
f83577
- comps parser redesigned
f83577
- change python/tests directory composition
f83577
- added elem attributes check in parser
f83577
- xml output '_arch' attribute support
f83577
- parser and xml output defaults options for specify defaults values
f83577
- comps object validation in python
f83577
- added validity checker before append/set object to list (python only)
f83577
- .validate() method
f83577
- added libcomps.Dict.keys
f83577
-         libcomps.Dict.values
f83577
-         libcomps.Dict.items
f83577
-         libcomps.Dict.clear
f83577
-         libcomps.Dict.update
f83577
-         libcomps.Dict.copy
f83577
- added xml output options (comps.xml_str([options = {}]), comps.xml_f(options = {}))
f83577
f83577
* Wed Oct 23 2013 Jindrich Luza <jluza@redhat.com> 0.1.4-4
f83577
- group.uservisible is true by default now.
f83577
- fixed comps_mobjradix parent node problem
f83577
- implemented bindings for blacklist, whiteout and langpacks
f83577
- COMPS_Logger redesigned
f83577
f83577
* Tue Oct 08 2013 Jindrich Luza <jluza@redhat.com> 0.1.5
f83577
- version bump
f83577
- PyCOMPS_Sequence.__getitem__["objectid"] implemented for libcomps.GroupList, libcomps.CategoryList, libcomps.EnvList
f83577
- added missing files
f83577
- missing display_order fix for libcomps.Environment
f83577
f83577
* Tue Oct 01 2013 Jindrich Luza <jluza@redhat.com> 0.1.4
f83577
- added missing files
f83577
- architectural redesign finished
f83577
- fixed #1003986 by Gustavo Luiz Duarte guidelines (but not tested on ppc)
f83577
- fixed bug #1000449
f83577
- fixed bug #1000442
f83577
- added GroupId.default test
f83577
- some minor unreported bugs discovered during testing fixed
f83577
- finished default attribute support in groupid object
f83577
- Comps.get_last_parse_errors and Comps.get_last_parse_log has been renamed
f83577
-   as Comps.get_last_errors and Comps.get_last_log
f83577
- version bumped. Python bindings is now easier.
f83577
- added missing files
f83577
f83577
* Tue Aug 20 2013 Jindrich Luza <jluza@redhat.com> 0.1.3
f83577
- finished default attribute support in groupid object
f83577
- Comps.get_last_parse_errors and Comps.get_last_parse_log has been renamed
f83577
-   as Comps.get_last_errors and Comps.get_last_log
f83577
- finished default attribute support in groupid object
f83577
- Comps.get_last_parse_errors and Comps.get_last_parse_log has been renamed
f83577
-   as Comps.get_last_errors and Comps.get_last_log
f83577
f83577
* Thu Jul 18 2013 Jindrich Luza <jluza@redhat.com> 0.1.2
f83577
- automatic changelog system
f83577
- fixed issue #14
f83577
- libcomps.Dict is now behave more like python dict. Implemented iter(libcomps.Dict)
f83577
- libcomps.iteritems() and libcomps.itervalues()
f83577
- remaked error reporting system.
f83577
-     libcomps.Comps.fromxml_f and libcomps.Comps.fromxml_str now return
f83577
-     -1, 0 or 1. 0 means parse procedure completed without any problem,
f83577
-     1 means there's some errors or warnings but not fatal. -1 indicates
f83577
-     fatal error problem (some results maybe given, but probably incomplete
f83577
-     and invalid)
f83577
- errors catched during parsing can be obtained by calling
f83577
-     libcomps.Comps.get_last_parse_errors
f83577
- all log is given by
f83577
-     libcomps.Comps.get_last_parse_log
f83577
- prop system complete
f83577
- fixed issue 1
f83577
- fixed issue 3
f83577
- added <packagereq requires=...> support
f83577
- new prop system in progress....
f83577
- separated doc package
f83577
- some minor fixes in CMakeFiles
f83577
- improved integrated tests
f83577
f83577
* Tue Jun 25 2013 Jindrich Luza <jluza@redhat.com> 0.1.1-1
f83577
- Automatic commit of package [libcomps] release [0.1.1-1].
f83577