dcavalca / rpms / libdnf

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