remove python2

This commit is contained in:
zhanglu 2020-02-18 18:04:35 +08:00
parent 4c802e9ec0
commit f8c9fd24ad

View File

@ -3,20 +3,19 @@
%global hawkey_version 0.34.0
%bcond_without python3
%bcond_with python2
%bcond_without yumcompatibility
%bcond_without yumutils
Name: dnf-plugins-core
Version: 4.0.11
Release: 2
Release: 3
Summary: Core Plugins for DNF
License: GPLv2+
URL: https://github.com/rpm-software-management/dnf-plugins-core
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: cmake gettext %{_bindir}/sphinx-build-3 %{_bindir}/sphinx-build
Requires: python3-%{name} = %{version}-%{release} python2-%{name} = %{version}-%{release}
BuildRequires: cmake gettext %{_bindir}/sphinx-build-3
Requires: python3-%{name} = %{version}-%{release}
Requires: dnf >= %{dnf_lowest_compatible} %{name} = %{version}-%{release}
Requires: python3-dnf >= %{dnf_lowest_compatible}
Provides: dnf-command(builddep) dnf-command(changelog) dnf-command(config-manager)
@ -52,29 +51,6 @@ copr, debug, debuginfo-install, download, needs-restarting, repoclosure,
repograph, repomanage, reposync, changelog and repodiff commands. Additionally
provides generate_completion_cache passive plugin.
%package -n python2-%{name}
Summary: Core Plugins for DNF
%{?python_provide:%python_provide python2-%{name}}
BuildRequires: python2-dnf >= %{dnf_lowest_compatible} python2-nose python2-devel
Requires: python2-distro python2-dnf >= %{dnf_lowest_compatible}
Requires: python2-hawkey >= %{hawkey_version} python2-dateutil
Provides: python2-dnf-plugins-extras-debug = %{version}-%{release}
Provides: python2-dnf-plugins-extras-repoclosure = %{version}-%{release}
Provides: python2-dnf-plugins-extras-repograph = %{version}-%{release}
Provides: python2-dnf-plugins-extras-repomanage = %{version}-%{release}
Obsoletes: python2-dnf-plugins-extras-debug < %{dnf_plugins_extra}
Obsoletes: python2-dnf-plugins-extras-repoclosure < %{dnf_plugins_extra}
Obsoletes: python2-dnf-plugins-extras-repograph < %{dnf_plugins_extra}
Obsoletes: python2-dnf-plugins-extras-repomanage < %{dnf_plugins_extra}
Conflicts: %{name} <= 0.1.5 python3-%{name} < %{version}-%{release}
Conflicts: python-%{name} < %{version}-%{release}
%description -n python2-%{name}
Core Plugins for DNF, Python 2 interface. This package enhances DNF with builddep,
config-manager, copr, degug, debuginfo-install, download, needs-restarting,
repoclosure, repograph, repomanage, reposync, changelog and repodiff commands.
Additionally provides generate_completion_cache passive plugin.
%package -n python3-%{name}
Summary: Core Plugins for DNF
%{?python_provide:%python_provide python3-%{name}}
@ -98,33 +74,6 @@ config-manager, copr, debug, debuginfo-install, download, needs-restarting,
repoclosure, repograph, repomanage, reposync, changelog and repodiff commands.
Additionally provides generate_completion_cache passive plugin.
%package -n python2-dnf-plugin-migrate
Summary: Migrate Plugin for DNF
Requires: python2-%{name} = %{version}-%{release} yum
Provides: dnf-plugin-migrate = %{version}-%{release} dnf-command(migrate)
Provides: python2-dnf-plugins-extras-migrate = %{version}-%{release}
Provides: dnf-plugins-extras-migrate = %{version}-%{release}
Conflicts: dnf-plugins-extras-common-data < %{dnf_plugins_extra}
Obsoletes: python2-dnf-plugins-extras-migrate < %{dnf_plugins_extra}
Obsoletes: python-dnf-plugins-extras-migrate < %{dnf_plugins_extra}
%description -n python2-dnf-plugin-migrate
Migrate Plugin for DNF, Python 2 version. Migrates history, group and yumdb data from yum to dnf.
%package -n python2-dnf-plugin-versionlock
Summary: Version Lock Plugin for DNF
Requires: python2-%{name} = %{version}-%{release}
Provides: yum-plugin-versionlock = %{version}-%{release}
Provides: python2-dnf-plugins-extras-versionlock = %{version}-%{release}
Conflicts: dnf-plugins-extras-common-data < %{dnf_plugins_extra}
Conflicts: python3-dnf-plugin-versionlock < %{version}-%{release}
Obsoletes: python2-dnf-plugins-extras-versionlock < %{dnf_plugins_extra}
%description -n python2-dnf-plugin-versionlock
Version lock plugin takes a set of name/versions for packages and excludes all other
versions of those packages. This allows you to e.g. protect packages from being
updated by newer versions.
%package -n python3-dnf-plugin-versionlock
Summary: Version Lock Plugin for DNF
Requires: python3-%{name} = %{version}-%{release}
@ -146,16 +95,9 @@ updated by newer versions.
%prep
%autosetup
mkdir build-py2
mkdir build-py3
%build
pushd build-py2
%cmake ../ -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITHOUT_LOCAL:str=8}
%make_build
make doc-man
popd
pushd build-py3
%cmake ../ -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITHOUT_LOCAL:str=8}
%make_build
@ -163,10 +105,6 @@ pushd build-py3
popd
%install
pushd build-py2
%make_install
popd
pushd build-py3
%make_install
popd
@ -199,7 +137,6 @@ ln -sf %{_mandir}/man1/dnf-utils.1.gz %{buildroot}%{_mandir}/man1/repoquery.1.gz
ln -sf %{_mandir}/man1/dnf-utils.1.gz %{buildroot}%{_mandir}/man1/repotrack.1.gz
%check
PYTHONPATH=./plugins nosetests-%{python2_version} -s tests/
PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
%files
@ -225,29 +162,6 @@ PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
%exclude %{python3_sitelib}/dnf-plugins/leaves.*
%exclude %{python3_sitelib}/dnf-plugins/__pycache__/leaves.*
%files -n python2-%{name} -f %{name}.lang
%license COPYING
%doc AUTHORS README.rst
%ghost %attr(644,-,-) %{_var}/cache/dnf/packages.db
%config(noreplace) %{_sysconfdir}/dnf/plugins/copr.conf
%config(noreplace) %{_sysconfdir}/dnf/plugins/copr.d
%config(noreplace) %{_sysconfdir}/dnf/plugins/debuginfo-install.conf
%{python2_sitelib}/dnf-plugins/builddep.*
%{python2_sitelib}/dnf-plugins/changelog.*
%{python2_sitelib}/dnf-plugins/config_manager.*
%{python2_sitelib}/dnf-plugins/copr.*
%{python2_sitelib}/dnf-plugins/debug.*
%{python2_sitelib}/dnf-plugins/debuginfo-install.*
%{python2_sitelib}/dnf-plugins/download.*
%{python2_sitelib}/dnf-plugins/generate_completion_cache.*
%{python2_sitelib}/dnf-plugins/needs_restarting.*
%{python2_sitelib}/dnf-plugins/repoclosure.*
%{python2_sitelib}/dnf-plugins/repodiff.*
%{python2_sitelib}/dnf-plugins/repograph.*
%{python2_sitelib}/dnf-plugins/repomanage.*
%{python2_sitelib}/dnf-plugins/reposync.*
%{python2_sitelib}/dnfpluginscore/
%files -n python3-%{name} -f %{name}.lang
%license COPYING
%doc AUTHORS README.rst
@ -285,19 +199,6 @@ PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
%{python3_sitelib}/dnf-plugins/__pycache__/reposync.*
%{python3_sitelib}/dnfpluginscore/
%files -n python2-dnf-plugin-migrate
%{python2_sitelib}/dnf-plugins/migrate.*
%{_mandir}/man8/dnf.plugin.migrate.*
%exclude %{_mandir}/man8/dnf.plugin.show-leaves.*
%exclude %{python2_sitelib}/dnf-plugins/show_leaves.*
%exclude %{python3_sitelib}/dnf-plugins/show_leaves.*
%exclude %{python3_sitelib}/dnf-plugins/__pycache__/show_leaves.*
%files -n python2-dnf-plugin-versionlock
%config(noreplace) %{_sysconfdir}/dnf/plugins/versionlock.conf
%config(noreplace) %{_sysconfdir}/dnf/plugins/versionlock.list
%{python2_sitelib}/dnf-plugins/versionlock.*
%files -n python3-dnf-plugin-versionlock
%config(noreplace) %{_sysconfdir}/dnf/plugins/versionlock.conf
%config(noreplace) %{_sysconfdir}/dnf/plugins/versionlock.list
@ -344,5 +245,8 @@ PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
%{_mandir}/man8/yum-copr.*
%changelog
* Tue Feb 18 2020 zhangrui <zhangrui182@huawei.com> -4.0.11-3
- remove python2
* Wed Jan 8 2020 zhangrui <zhangrui182@huawei.com> - 4.0.11-2
- Package init.