libdnf/libdnf.spec

265 lines
7.8 KiB
RPMSpec
Raw Permalink Normal View History

2020-01-08 20:11:37 +08:00
%global libsolv_version 0.7.7
%global libmodulemd_version 2.5.0
%global librepo_version 1.12.0
%global dnf_conflict 4.2.23-5
2019-09-30 10:55:46 -04:00
%global swig_version 3.0.12
2020-01-08 20:11:37 +08:00
%global requires_python2_sphinx python2-sphinx
%global requires_python3_sphinx python3-sphinx
2019-09-30 10:55:46 -04:00
%bcond_with valgrind
%bcond_without python3
2020-01-08 20:11:37 +08:00
%bcond_with python2
%bcond_with rhsm
%bcond_with zchunk
%bcond_with sanitizers
2019-09-30 10:55:46 -04:00
%global _cmake_opts \\\
-DENABLE_RHSM_SUPPORT=%{?with_rhsm:ON}%{!?with_rhsm:OFF} \\\
%{nil}
2020-01-08 20:11:37 +08:00
Name: libdnf
Version: 0.48.0
Release: 8
2020-01-08 20:11:37 +08:00
Summary: Library providing simplified C and Python API to libsolv
License: LGPLv2+
URL: https://github.com/rpm-software-management/libdnf
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch0: fix-python2-no-format-arguments-error.patch
Patch1: CVE-2021-3445.patch
%if %{?openEuler:1}0
Patch2: fix-to-avoid-add-duplicates-via-different-action.patch
%endif
%ifarch loongarch64
Patch3: add-loongarch-support-for-libdnf.patch
%endif
%ifarch sw_64
Patch4: add-sw_64-support-for-libdnf.patch
%endif
Patch6001: backport-Fix-countme-bucket-calculation.patch
Patch6002: backport-Fix-up-some-comments-in-addCountmeFlag.patch
Patch6003: backport-subject-py-Fix-memory-leak.patch
Patch6004: backport-Fix-a-memory-leak-in-glob_for_cachedir.patch
2020-01-08 20:11:37 +08:00
BuildRequires: cmake gcc gcc-c++ libsolv-devel >= %{libsolv_version} gettext
BuildRequires: pkgconfig(librepo) >= %{librepo_version} pkgconfig(check)
BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0 pkgconfig(gtk-doc) gpgme-devel
BuildRequires: rpm-devel >= 4.11.0 pkgconfig(sqlite3) pkgconfig(smartcols)
BuildRequires: pkgconfig(json-c) pkgconfig(cppunit) pkgconfig(libcrypto)
BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version}
%if %{with sanitizers}
BuildRequires: libasan-static
BuildRequires: liblsan-static
BuildRequires: libubsan-static
%endif
2020-01-08 20:11:37 +08:00
Requires: libmodulemd >= %{libmodulemd_version}
Requires: libsolv >= %{libsolv_version}
Requires: librepo >= %{librepo_version}
%if %{without python2}
Obsoletes: python2-%{name} < %{version}-%{release}
Obsoletes: python2-hawkey < %{version}-%{release}
Obsoletes: python2-hawkey-debuginfo < %{version}-%{release}
Obsoletes: python2-libdnf-debuginfo < %{version}-%{release}
%endif
2019-09-30 10:55:46 -04:00
%description
A Library providing simplified C and Python API to libsolv.
2020-01-08 20:11:37 +08:00
%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
Requires: libsolv-devel >= %{libsolv_version}
2019-09-30 10:55:46 -04:00
%description devel
Development files for %{name}.
%if %{with python2}
2020-01-08 20:11:37 +08:00
%package -n python2-%{name}
2019-09-30 10:55:46 -04:00
%{?python_provide:%python_provide python2-%{name}}
2020-01-08 20:11:37 +08:00
Summary: Python 2 bindings for the libdnf library.
Requires: %{name} = %{version}-%{release}
BuildRequires: python2-devel swig >= %{swig_version}
%if !0%{?mageia}
BuildRequires: %{requires_python2_sphinx}
%endif
2019-09-30 10:55:46 -04:00
2020-01-08 20:11:37 +08:00
%description -n python2-%{name}
2019-09-30 10:55:46 -04:00
Python 2 bindings for the libdnf library.
%endif
2020-01-08 20:11:37 +08:00
%if %{with python3}
%package -n python3-%{name}
2019-09-30 10:55:46 -04:00
%{?python_provide:%python_provide python3-%{name}}
2020-01-08 20:11:37 +08:00
Summary: Python 3 bindings for the libdnf library.
Requires: %{name} = %{version}-%{release}
BuildRequires: python3-devel %{requires_python3_sphinx} swig >= %{swig_version}
2019-09-30 10:55:46 -04:00
2020-01-08 20:11:37 +08:00
%description -n python3-%{name}
2019-09-30 10:55:46 -04:00
Python 3 bindings for the libdnf library.
2020-01-08 20:11:37 +08:00
%endif
2019-09-30 10:55:46 -04:00
%if %{with python2}
2020-01-08 20:11:37 +08:00
%package -n python2-hawkey
Summary: Python 2 bindings for the hawkey library
2019-09-30 10:55:46 -04:00
%{?python_provide:%python_provide python2-hawkey}
2020-01-08 20:11:37 +08:00
BuildRequires: python2-devel python2-nose
Requires: %{name} = %{version}-%{release}
Requires: python2-%{name} = %{version}-%{release}
Conflicts: python2-dnf < %{dnf_conflict}
Conflicts: python-dnf < %{dnf_conflict}
2019-09-30 10:55:46 -04:00
%description -n python2-hawkey
Python 2 bindings for the hawkey library.
%endif
2020-01-08 20:11:37 +08:00
%if %{with python3}
%package -n python3-hawkey
Summary: Python 3 bindings for the hawkey library
2019-09-30 10:55:46 -04:00
%{?python_provide:%python_provide python3-hawkey}
2020-01-08 20:11:37 +08:00
BuildRequires: python3-devel python3-nose
Requires: %{name} = %{version}-%{release}
Requires: python3-%{name} = %{version}-%{release}
Conflicts: python3-dnf < %{dnf_conflict}
Obsoletes: platform-python-hawkey < %{version}-%{release}
2019-09-30 10:55:46 -04:00
%description -n python3-hawkey
Python 3 bindings for the hawkey library.
2020-01-08 20:11:37 +08:00
%endif
2019-09-30 10:55:46 -04:00
%prep
%autosetup -p1
2019-09-30 10:55:46 -04:00
%if %{with python2}
mkdir build-py2
%endif
2020-01-08 20:11:37 +08:00
%if %{with python3}
2019-09-30 10:55:46 -04:00
mkdir build-py3
2020-01-08 20:11:37 +08:00
%endif
2019-09-30 10:55:46 -04:00
%build
%if %{with python2}
pushd build-py2
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} \
-DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF}
2019-09-30 10:55:46 -04:00
%make_build
popd
%endif
%if %{with python3}
pushd build-py3
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} \
-DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF}
2019-09-30 10:55:46 -04:00
%make_build
popd
%endif
%check
2020-01-08 20:11:37 +08:00
%if %{with python3}
%if %{without python2}
pushd build-py3
make ARGS="-V" test
popd
%else
2019-09-30 10:55:46 -04:00
pushd build-py3/python/hawkey/tests
make ARGS="-V" test
popd
2020-01-08 20:11:37 +08:00
%endif
%endif
2019-09-30 10:55:46 -04:00
%install
%if %{with python2}
pushd build-py2
%make_install
popd
%endif
2020-01-08 20:11:37 +08:00
%if %{with python3}
2019-09-30 10:55:46 -04:00
pushd build-py3
%make_install
popd
2020-01-08 20:11:37 +08:00
%endif
2019-09-30 10:55:46 -04:00
%find_lang %{name}
%ldconfig_scriptlets
2020-01-08 20:11:37 +08:00
%files -f %{name}.lang
%license COPYING
%doc README.md AUTHORS
2019-09-30 10:55:46 -04:00
%{_libdir}/%{name}.so.*
2020-01-08 20:11:37 +08:00
%dir %{_libdir}/libdnf/
%dir %{_libdir}/libdnf/plugins/
%{_libdir}/libdnf/plugins/README
2019-09-30 10:55:46 -04:00
%files devel
2020-01-08 20:11:37 +08:00
%doc %{_datadir}/gtk-doc/html/%{name}/
2019-09-30 10:55:46 -04:00
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/%{name}/
%if %{with python2}
%files -n python2-%{name}
%{python2_sitearch}/%{name}/
%endif
2019-09-30 10:55:46 -04:00
2020-01-08 20:11:37 +08:00
%if %{with python3}
2019-09-30 10:55:46 -04:00
%files -n python3-%{name}
%{python3_sitearch}/%{name}/
2020-01-08 20:11:37 +08:00
%endif
2019-09-30 10:55:46 -04:00
%if %{with python2}
%files -n python2-hawkey
%{python2_sitearch}/hawkey/
%endif
2019-09-30 10:55:46 -04:00
2020-01-08 20:11:37 +08:00
%if %{with python3}
2019-09-30 10:55:46 -04:00
%files -n python3-hawkey
%{python3_sitearch}/hawkey/
2020-01-08 20:11:37 +08:00
%endif
2019-09-30 10:55:46 -04:00
%changelog
* Mon Jul 29 2024 Wenhua Huang <huangwenhua@Kylinos.cn> - 0.48.0-8
- Fix a memory leak in glob_for_cachedir()
* Tue Jul 23 2024 LuWu <2398491106@qq.com> - 0.48.0-7
- Fix memory leak detected in get_best_solution() method
* Wed Jul 17 2024 LuWu <2398491106@qq.com> - 0.48.0-6
- Fix countme bucket calculation
* Tue Jul 18 2023 konglidong <konglidong@uniontech.com> - 0.48.0-5
- Add loongarch and sw_64 support for libdnf
* Tue Dec 07 2021 gaihuiying <gaihuiying1@huawei.com> - 0.48.0-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:avoid adding duplicates via different action
* Thu Jul 15 2021 gaihuiying <gaihuiying1@huawei.com> - 0.48.0-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:dnf and libdnf upgrade downgrade together
* Tue Jun 8 2021 gaihuiying <gaihuiying@huawei.com> - 0.48.0-2
- Type:CVE
- ID:NA
- SUG:NA
- DESC:fix CVE-2021-3445 and remove python2 test
* Sat Aug 29 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.48.0-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:upgrade to 0.48.0
2020-08-18 21:44:34 +08:00
* Tue Aug 18 2020 chenyaqiang <chenyaqiang@huawei.com> - 0.37.2-3
- rebuild for package build
2020-01-08 20:11:37 +08:00
* Tue Jan 7 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.37.2-2
- Package init.