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