dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone
18f9c1
%global libsolv_version 0.6.34-1
18f9c1
%global libmodulemd_version 1.6.1
18f9c1
%global dnf_conflict 4.0.9.2
18f9c1
%global swig_version 3.0.12
a2b0c8
a2b0c8
%bcond_with valgrind
a2b0c8
a2b0c8
# Do not build bindings for python3 for RHEL <= 7
a2b0c8
%if 0%{?rhel} && 0%{?rhel} <= 7
a2b0c8
%bcond_with python3
a2b0c8
%else
a2b0c8
%bcond_without python3
a2b0c8
%endif
a2b0c8
18f9c1
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
18f9c1
# Disable python2 build by default
18f9c1
%bcond_with python2
18f9c1
%else
18f9c1
%bcond_without python2
18f9c1
%endif
18f9c1
a2b0c8
%if 0%{?rhel} && ! 0%{?centos}
a2b0c8
%bcond_without rhsm
a2b0c8
%else
a2b0c8
%bcond_with rhsm
a2b0c8
%endif
a2b0c8
a2b0c8
%global _cmake_opts \\\
a2b0c8
    -DENABLE_RHSM_SUPPORT=%{?with_rhsm:ON}%{!?with_rhsm:OFF} \\\
a2b0c8
    %{nil}
a2b0c8
a2b0c8
Name:           libdnf
18f9c1
Version:        0.22.5
0718c1
Release:        2%{?dist}
a2b0c8
Summary:        Library providing simplified C and Python API to libsolv
a2b0c8
License:        LGPLv2+
a2b0c8
URL:            https://github.com/rpm-software-management/libdnf
a2b0c8
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
0718c1
Patch0:         0001-queue_init_clone-const_cast.patch
0718c1
Patch1:         0002-Fix-leaking-log-handlers-in-Sack-RhBug-1758737.patch
a2b0c8
a2b0c8
BuildRequires:  cmake
a2b0c8
BuildRequires:  gcc
18f9c1
BuildRequires:  gcc-c++
a2b0c8
BuildRequires:  libsolv-devel >= %{libsolv_version}
a2b0c8
BuildRequires:  pkgconfig(librepo)
a2b0c8
BuildRequires:  pkgconfig(check)
a2b0c8
%if %{with valgrind}
a2b0c8
BuildRequires:  valgrind
a2b0c8
%endif
a2b0c8
BuildRequires:  pkgconfig(gio-unix-2.0) >= 2.46.0
a2b0c8
BuildRequires:  pkgconfig(gtk-doc)
a2b0c8
BuildRequires:  rpm-devel >= 4.11.0
a2b0c8
%if %{with rhsm}
18f9c1
BuildRequires:  pkgconfig(librhsm) >= 0.0.3
a2b0c8
%endif
18f9c1
BuildRequires:  pkgconfig(sqlite3)
18f9c1
BuildRequires:  pkgconfig(json-c)
18f9c1
BuildRequires:  pkgconfig(cppunit)
18f9c1
BuildRequires:  pkgconfig(libcrypto)
18f9c1
BuildRequires:  pkgconfig(modulemd) >= %{libmodulemd_version}
18f9c1
BuildRequires:  pkgconfig(smartcols)
18f9c1
BuildRequires:  gettext
18f9c1
BuildRequires:  gpgme-devel
18f9c1
18f9c1
Requires:       libmodulemd%{?_isa} >= %{libmodulemd_version}
a2b0c8
Requires:       libsolv%{?_isa} >= %{libsolv_version}
a2b0c8
a2b0c8
%description
a2b0c8
A Library providing simplified C and Python API to libsolv.
a2b0c8
a2b0c8
%package devel
a2b0c8
Summary:        Development files for %{name}
a2b0c8
Requires:       %{name}%{?_isa} = %{version}-%{release}
a2b0c8
Requires:       libsolv-devel%{?_isa} >= %{libsolv_version}
a2b0c8
a2b0c8
%description devel
a2b0c8
Development files for %{name}.
a2b0c8
18f9c1
%if %{with python2}
18f9c1
%package -n python2-%{name}
18f9c1
%{?python_provide:%python_provide python2-%{name}}
18f9c1
Summary:        Python 2 bindings for the libdnf library.
18f9c1
Requires:       %{name}%{?_isa} = %{version}-%{release}
18f9c1
BuildRequires:  python2-devel
18f9c1
%if 0%{?rhel} == 7
18f9c1
BuildRequires:  python-sphinx
18f9c1
BuildRequires:  swig3 >= %{swig_version}
18f9c1
%else
18f9c1
BuildRequires:  python2-sphinx
18f9c1
BuildRequires:  swig >= %{swig_version}
18f9c1
%endif
18f9c1
18f9c1
%description -n python2-%{name}
18f9c1
Python 2 bindings for the libdnf library.
18f9c1
%endif # with python2
18f9c1
18f9c1
%if %{with python3}
18f9c1
%package -n python3-%{name}
18f9c1
%{?python_provide:%python_provide python3-%{name}}
18f9c1
Summary:        Python 3 bindings for the libdnf library.
18f9c1
Requires:       %{name}%{?_isa} = %{version}-%{release}
18f9c1
BuildRequires:  python3-devel
18f9c1
BuildRequires:  python3-sphinx
18f9c1
BuildRequires:  swig >= %{swig_version}
18f9c1
18f9c1
%description -n python3-%{name}
18f9c1
Python 3 bindings for the libdnf library.
18f9c1
%endif
18f9c1
18f9c1
%if %{with python2}
a2b0c8
%package -n python2-hawkey
a2b0c8
Summary:        Python 2 bindings for the hawkey library
a2b0c8
%{?python_provide:%python_provide python2-hawkey}
a2b0c8
BuildRequires:  python2-devel
a2b0c8
%if 0%{?rhel} && 0%{?rhel} <= 7
a2b0c8
BuildRequires:  python-nose
a2b0c8
%else
a2b0c8
BuildRequires:  python2-nose
a2b0c8
%endif
a2b0c8
Requires:       %{name}%{?_isa} = %{version}-%{release}
18f9c1
Requires:       python2-%{name} = %{version}-%{release}
a2b0c8
# Fix problem with hawkey - dnf version incompatibility
a2b0c8
# Can be deleted for distros where only python2-dnf >= 2.0.0
a2b0c8
Conflicts:      python2-dnf < %{dnf_conflict}
a2b0c8
Conflicts:      python-dnf < %{dnf_conflict}
a2b0c8
a2b0c8
%description -n python2-hawkey
a2b0c8
Python 2 bindings for the hawkey library.
18f9c1
%endif # with python2
a2b0c8
a2b0c8
%if %{with python3}
a2b0c8
%package -n python3-hawkey
a2b0c8
Summary:        Python 3 bindings for the hawkey library
a2b0c8
%{?python_provide:%python_provide python3-hawkey}
a2b0c8
BuildRequires:  python3-devel
a2b0c8
BuildRequires:  python3-nose
a2b0c8
Requires:       %{name}%{?_isa} = %{version}-%{release}
18f9c1
Requires:       python3-%{name} = %{version}-%{release}
a2b0c8
# Fix problem with hawkey - dnf version incompatibility
a2b0c8
# Can be deleted for distros where only python3-dnf >= 2.0.0
a2b0c8
Conflicts:      python3-dnf < %{dnf_conflict}
18f9c1
# Obsoletes F27 packages
a2b0c8
Obsoletes:      platform-python-hawkey < %{version}-%{release}
a2b0c8
a2b0c8
%description -n python3-hawkey
a2b0c8
Python 3 bindings for the hawkey library.
a2b0c8
%endif
a2b0c8
a2b0c8
%prep
77214e
%autosetup -p1
18f9c1
%if %{with python2}
a2b0c8
mkdir build-py2
18f9c1
%endif # with python2
a2b0c8
%if %{with python3}
a2b0c8
mkdir build-py3
a2b0c8
%endif
a2b0c8
a2b0c8
%build
18f9c1
%if %{with python2}
a2b0c8
pushd build-py2
18f9c1
  %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts}
a2b0c8
  %make_build
a2b0c8
popd
18f9c1
%endif # with python2
a2b0c8
a2b0c8
%if %{with python3}
a2b0c8
pushd build-py3
18f9c1
  %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts}
a2b0c8
  %make_build
a2b0c8
popd
a2b0c8
%endif
a2b0c8
a2b0c8
%check
a2b0c8
if [ "$(id -u)" == "0" ] ; then
a2b0c8
        cat <<ERROR 1>&2
a2b0c8
Package tests cannot be run under superuser account.
a2b0c8
Please build the package as non-root user.
a2b0c8
ERROR
a2b0c8
        exit 1
a2b0c8
fi
18f9c1
18f9c1
%if %{with python2}
a2b0c8
pushd build-py2
a2b0c8
  make ARGS="-V" test
a2b0c8
popd
18f9c1
%endif # with python2
a2b0c8
%if %{with python3}
a2b0c8
# Run just the Python tests, not all of them, since
a2b0c8
# we have coverage of the core from the first build
a2b0c8
pushd build-py3/python/hawkey/tests
a2b0c8
  make ARGS="-V" test
a2b0c8
popd
a2b0c8
%endif
a2b0c8
a2b0c8
%install
18f9c1
%if %{with python2}
a2b0c8
pushd build-py2
a2b0c8
  %make_install
a2b0c8
popd
18f9c1
%endif # with python2
a2b0c8
%if %{with python3}
a2b0c8
pushd build-py3
a2b0c8
  %make_install
a2b0c8
popd
a2b0c8
%endif
a2b0c8
18f9c1
%find_lang %{name}
18f9c1
18f9c1
%if 0%{?rhel} && 0%{?rhel} <= 7
a2b0c8
%post -p /sbin/ldconfig
a2b0c8
%postun -p /sbin/ldconfig
18f9c1
%else
18f9c1
%ldconfig_scriptlets
18f9c1
%endif
a2b0c8
18f9c1
%files -f %{name}.lang
a2b0c8
%license COPYING
18f9c1
%doc README.md AUTHORS
a2b0c8
%{_libdir}/%{name}.so.*
18f9c1
%{_libdir}/libdnf/plugins/README
a2b0c8
a2b0c8
%files devel
a2b0c8
%doc %{_datadir}/gtk-doc/html/%{name}/
a2b0c8
%{_libdir}/%{name}.so
a2b0c8
%{_libdir}/pkgconfig/%{name}.pc
a2b0c8
%{_includedir}/%{name}/
a2b0c8
18f9c1
%if %{with python2}
18f9c1
%files -n python2-%{name}
18f9c1
%{python2_sitearch}/%{name}/
18f9c1
%endif # with python2
18f9c1
18f9c1
%if %{with python3}
18f9c1
%files -n python3-%{name}
18f9c1
%{python3_sitearch}/%{name}/
18f9c1
%endif
18f9c1
18f9c1
%if %{with python2}
a2b0c8
%files -n python2-hawkey
a2b0c8
%{python2_sitearch}/hawkey/
18f9c1
%endif # with python2
a2b0c8
a2b0c8
%if %{with python3}
a2b0c8
%files -n python3-hawkey
a2b0c8
%{python3_sitearch}/hawkey/
a2b0c8
%endif
a2b0c8
a2b0c8
%changelog
0718c1
* Mon Apr 06 2020 Marek Blaha <mblaha@redhat.com> - 0.22.5-2
0718c1
- Backport patch for BZ#1781364
0718c1
18f9c1
* Tue Jan 08 2019 Daniel Mach <dmach@redhat.com> - 0.22.5-1
18f9c1
- Update to 0.22.5
18f9c1
- queue_init_clone src argument const_cast for libsolv 0.6.34 compatibility
a2b0c8
0718c1
* Thu Nov 08 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.11.1-4
0718c1
- Backport patch for RHBZ#1542307 from upstream libdnf-0.11.1
0718c1
0718c1
* Tue Nov 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.11.1-3
0718c1
- Use better Obsoletes for platform-python
0718c1
0718c1
* Fri Nov 03 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.11.1-2
0718c1
- Remove platform-python subpackage
0718c1
0718c1
* Mon Oct 16 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.11.1-1
0718c1
- Rerelease of 0.11.1-1
0718c1
- Improvement query performance
0718c1
- Run file query in hy_subject_get_best_solution only for files (arguments that start with ``/`` or
0718c1
  ``*/``)
0718c1
- Resolves: rhbz#1498207 - DNF crash during upgrade installation F26 -> F27
0718c1
0718c1
* Tue Oct 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.11.0-1
0718c1
- Update to 0.11.0
0718c1
0718c1
* Mon Oct 02 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.10.1-2
0718c1
- Rerelease of 0.10.1-1
0718c1
0718c1
* Wed Sep 27 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.10.1-1
0718c1
- Update to 0.10.1
0718c1
- It improves query performance with name and arch filters. Also nevra filter will now
0718c1
  handle string with or without epoch.
0718c1
- Additionally for python bindings it renames NEVRA._has_just_name() to NEVRA.has_just_name() due
0718c1
  to movement of code into c part of library.
0718c1
- Resolves: rhbz#1260242 - --exclude does not affect dnf remove's removal of requirements
0718c1
- Resolves: rhbz#1485881 - DNF claims it cannot install package, which have been already installed
0718c1
- Resolves: rhbz#1361187 - [abrt] python-ipython-console: filter_updown(): python3.5 killed by SIGABRT
0718c1
0718c1
* Fri Sep 15 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-8
0718c1
- Disable platform python on old releases
0718c1
0718c1
* Tue Aug 15 2017 Lumír Balhar <lbalhar@redhat.com> - 0.9.3-7
0718c1
- Add platform-python subpackage
0718c1
0718c1
* Fri Aug 11 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-6
0718c1
- Rebuilt after RPM update (№ 3)
0718c1
0718c1
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-5
0718c1
- Rebuilt for RPM soname bump
0718c1
0718c1
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-4
0718c1
- Rebuilt for RPM soname bump
0718c1
0718c1
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-3
0718c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
0718c1
0718c1
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-2
0718c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0718c1
0718c1
* Mon Jul 24 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.3-1
0718c1
- Update to 0.9.3
0718c1
0718c1
* Sat Jul 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.2-1
0718c1
- Update to 0.9.2
0718c1
0718c1
* Mon Jun 12 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.1-1
0718c1
- Update to 0.9.1
0718c1
0718c1
* Mon May 22 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.0-1
0718c1
- Update to 0.9.0
0718c1
0718c1
* Tue May 02 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.8.2-1
0718c1
- Update to 0.8.2
0718c1
0718c1
* Fri Mar 24 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.8.1-1
0718c1
- Update to 0.8.1
0718c1
0718c1
* Tue Mar 21 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.8.0-1
0718c1
- Update to 0.8.0
a2b0c8
0718c1
* Mon Feb 20 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.4-1
0718c1
- Update to 0.7.4
a2b0c8
0718c1
* Fri Feb 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.3-1
0718c1
- Update to 0.7.3
a2b0c8
0718c1
* Wed Feb 08 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.2-1
0718c1
- 0.7.2
a2b0c8
a2b0c8
* Fri Jan 06 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.1-1
a2b0c8
- 0.7.1
a2b0c8
a2b0c8
* Wed Dec 21 2016 Peter Robinson <pbrobinson@fedoraproject.org> 0.7.0-0.7gitf9b798c
a2b0c8
- Rebuild for Python 3.6
a2b0c8
a2b0c8
* Mon Dec 19 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.7.0-0.6gitf9b798c
a2b0c8
- Use new upstream URL
a2b0c8
a2b0c8
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 0.7.0-0.5gitf9b798c
a2b0c8
- Rebuild for Python 3.6
a2b0c8
a2b0c8
* Tue Dec 06 2016 Martin Hatina <mhatina@redhat.com> - 0.7.0-0.4gitf9b798c
a2b0c8
- Increase conflict version of dnf
a2b0c8
a2b0c8
* Thu Dec 01 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.7.0-0.3gitf9b798c
a2b0c8
- Update to latest snapshot
a2b0c8
a2b0c8
* Fri Nov 04 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.7.0-0.2git8bd77f8
a2b0c8
- Update to latest snapshot
a2b0c8
a2b0c8
* Thu Sep 29 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.7.0-0.1git179c0a6
a2b0c8
- Initial package