richardphibel / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone
a2b0c8
%global libsolv_version 0.6.21-1
a2b0c8
%global dnf_conflict 2.7.2
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
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
a2b0c8
Version:        0.11.1
77214e
Release:        4%{?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
77214e
Patch0001:      0001-Use-arch-from-spec-in-hy_subject_get_best_selector-RhBug1542307.patch
a2b0c8
a2b0c8
BuildRequires:  cmake
a2b0c8
BuildRequires:  gcc
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:  pkgconfig(gobject-introspection-1.0)
a2b0c8
BuildRequires:  rpm-devel >= 4.11.0
a2b0c8
%if %{with rhsm}
a2b0c8
BuildRequires:  pkgconfig(librhsm)
a2b0c8
%endif
a2b0c8
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
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}
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.
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}
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}
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
a2b0c8
mkdir build-py2
a2b0c8
%if %{with python3}
a2b0c8
mkdir build-py3
a2b0c8
%endif
a2b0c8
a2b0c8
%build
a2b0c8
pushd build-py2
a2b0c8
  %cmake -DWITH_MAN=OFF ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts}
a2b0c8
  %make_build
a2b0c8
popd
a2b0c8
a2b0c8
%if %{with python3}
a2b0c8
pushd build-py3
a2b0c8
  %cmake -DPYTHON_DESIRED:str=3 -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
a2b0c8
pushd build-py2
a2b0c8
  make ARGS="-V" test
a2b0c8
popd
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
a2b0c8
pushd build-py2
a2b0c8
  %make_install
a2b0c8
popd
a2b0c8
%if %{with python3}
a2b0c8
pushd build-py3
a2b0c8
  %make_install
a2b0c8
popd
a2b0c8
%endif
a2b0c8
a2b0c8
%post -p /sbin/ldconfig
a2b0c8
%postun -p /sbin/ldconfig
a2b0c8
a2b0c8
%files
a2b0c8
%license COPYING
a2b0c8
%doc README.md AUTHORS NEWS
a2b0c8
%{_libdir}/%{name}.so.*
a2b0c8
%{_libdir}/girepository-1.0/Dnf-*.typelib
a2b0c8
a2b0c8
%files devel
a2b0c8
%doc %{_datadir}/gtk-doc/html/%{name}/
a2b0c8
%{_libdir}/%{name}.so
a2b0c8
%{_libdir}/pkgconfig/%{name}.pc
a2b0c8
%{_includedir}/%{name}/
a2b0c8
%{_datadir}/gir-1.0/Dnf-*.gir
a2b0c8
a2b0c8
%files -n python2-hawkey
a2b0c8
%{python2_sitearch}/hawkey/
a2b0c8
a2b0c8
%if %{with python3}
a2b0c8
%files -n python3-hawkey
a2b0c8
%{python3_sitearch}/hawkey/
a2b0c8
%endif
a2b0c8
a2b0c8
%changelog
77214e
* Thu Nov 08 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.11.1-4
77214e
- Backport patch for RHBZ#1542307 from upstream libdnf-0.11.1
77214e
a2b0c8
* Tue Nov 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.11.1-3
a2b0c8
- Use better Obsoletes for platform-python
a2b0c8
a2b0c8
* Fri Nov 03 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.11.1-2
a2b0c8
- Remove platform-python subpackage
a2b0c8
a2b0c8
* Mon Oct 16 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.11.1-1
a2b0c8
- Rerelease of 0.11.1-1
a2b0c8
- Improvement query performance
a2b0c8
- Run file query in hy_subject_get_best_solution only for files (arguments that start with ``/`` or
a2b0c8
  ``*/``)
a2b0c8
- Resolves: rhbz#1498207 - DNF crash during upgrade installation F26 -> F27
a2b0c8
a2b0c8
* Tue Oct 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.11.0-1
a2b0c8
- Update to 0.11.0
a2b0c8
a2b0c8
* Mon Oct 02 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.10.1-2
a2b0c8
- Rerelease of 0.10.1-1
a2b0c8
a2b0c8
* Wed Sep 27 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.10.1-1
a2b0c8
- Update to 0.10.1
a2b0c8
- It improves query performance with name and arch filters. Also nevra filter will now
a2b0c8
  handle string with or without epoch.
a2b0c8
- Additionally for python bindings it renames NEVRA._has_just_name() to NEVRA.has_just_name() due
a2b0c8
  to movement of code into c part of library.
a2b0c8
- Resolves: rhbz#1260242 - --exclude does not affect dnf remove's removal of requirements
a2b0c8
- Resolves: rhbz#1485881 - DNF claims it cannot install package, which have been already installed
a2b0c8
- Resolves: rhbz#1361187 - [abrt] python-ipython-console: filter_updown(): python3.5 killed by SIGABRT
a2b0c8
a2b0c8
* Fri Sep 15 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-8
a2b0c8
- Disable platform python on old releases
a2b0c8
a2b0c8
* Tue Aug 15 2017 Lumír Balhar <lbalhar@redhat.com> - 0.9.3-7
a2b0c8
- Add platform-python subpackage
a2b0c8
a2b0c8
* Fri Aug 11 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-6
a2b0c8
- Rebuilt after RPM update (№ 3)
a2b0c8
a2b0c8
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-5
a2b0c8
- Rebuilt for RPM soname bump
a2b0c8
a2b0c8
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.3-4
a2b0c8
- Rebuilt for RPM soname bump
a2b0c8
a2b0c8
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-3
a2b0c8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
a2b0c8
a2b0c8
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-2
a2b0c8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a2b0c8
a2b0c8
* Mon Jul 24 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.3-1
a2b0c8
- Update to 0.9.3
a2b0c8
a2b0c8
* Sat Jul 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.2-1
a2b0c8
- Update to 0.9.2
a2b0c8
a2b0c8
* Mon Jun 12 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.1-1
a2b0c8
- Update to 0.9.1
a2b0c8
a2b0c8
* Mon May 22 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.9.0-1
a2b0c8
- Update to 0.9.0
a2b0c8
a2b0c8
* Tue May 02 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.8.2-1
a2b0c8
- Update to 0.8.2
a2b0c8
a2b0c8
* Fri Mar 24 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.8.1-1
a2b0c8
- Update to 0.8.1
a2b0c8
a2b0c8
* Tue Mar 21 2017 Jaroslav Mracek <jmracek@redhat.com> - 0.8.0-1
a2b0c8
- Update to 0.8.0
a2b0c8
a2b0c8
* Mon Feb 20 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.4-1
a2b0c8
- Update to 0.7.4
a2b0c8
a2b0c8
* Fri Feb 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.3-1
a2b0c8
- Update to 0.7.3
a2b0c8
a2b0c8
* Wed Feb 08 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.7.2-1
a2b0c8
- 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