disable python2

This commit is contained in:
h00465007 2020-03-14 15:46:11 +08:00
parent f1f7a57ef1
commit 008f645045

View File

@ -1,6 +1,8 @@
%bcond_with enable_python2
Name: python-blivet Name: python-blivet
Version: 3.1.1 Version: 3.1.1
Release: 5 Release: 6
Epoch: 1 Epoch: 1
Summary: A python module for system storage configuration Summary: A python module for system storage configuration
License: LGPLv2+ License: LGPLv2+
@ -10,7 +12,7 @@ Source0: http://github.com/storaged-project/blivet/archive/blivet-%{versi
BuildArch: noarch BuildArch: noarch
BuildRequires: systemd gettext python3-devel python3-setuptools BuildRequires: systemd gettext python3-devel python3-setuptools
%if %{with_python2} %if %{with enable_python2}
BuildRequires: python2-devel python2-setuptools BuildRequires: python2-devel python2-setuptools
%endif %endif
@ -43,7 +45,7 @@ Recommends: libblockdev-nvdimm >= 2.19 libblockdev-part >= 2.19 libblockdev-
Recommends: libblockdev-s390 >= 2.19 Recommends: libblockdev-s390 >= 2.19
%{?python_provide:%python_provide python3-blivet} %{?python_provide:%python_provide python3-blivet}
Obsoletes: blivet-data < 1:2.0.0 Obsoletes: blivet-data < 1:2.0.0
%if %{without python2} %if %{without enable_python2}
Obsoletes: python2-blivet < 1:2.0.2-2 python-blivet < 1:2.0.2-2 Obsoletes: python2-blivet < 1:2.0.2-2 python-blivet < 1:2.0.2-2
%else %else
Obsoletes: python-blivet < 1:2.0.0 Obsoletes: python-blivet < 1:2.0.0
@ -52,7 +54,7 @@ Obsoletes: python-blivet < 1:2.0.0
%description -n python3-blivet %description -n python3-blivet
python3 package for blivet python3 package for blivet
%if %{with python2} %if %{with enable_python2}
%package -n python2-blivet %package -n python2-blivet
Summary: python2 package for blivet Summary: python2 package for blivet
Requires: python2 python2-six python2-pyudev >= 0.18 python2-pyparted >= 3.10.4 Requires: python2 python2-six python2-pyudev >= 0.18 python2-pyparted >= 3.10.4
@ -77,11 +79,16 @@ python2 package for blivet
%autosetup -n blivet-%{version} -p1 %autosetup -n blivet-%{version} -p1
%build %build
%{?with_python2:make PYTHON=%{__python2}}
%if %{with enable_python2}
make PYTHON=%{__python2}
%endif
%{?with_python3:make PYTHON=%{__python3}} %{?with_python3:make PYTHON=%{__python3}}
%install %install
%{?with_python2:make PYTHON=%{__python2} DESTDIR=%{buildroot} install} %if %{with enable_python2}
make PYTHON=%{__python2} DESTDIR=%{buildroot} install
%endif
%{?with_python3:make PYTHON=%{__python3} DESTDIR=%{buildroot} install} %{?with_python3:make PYTHON=%{__python3} DESTDIR=%{buildroot} install}
%find_lang blivet %find_lang blivet
@ -99,7 +106,7 @@ python2 package for blivet
%doc examples %doc examples
%{python3_sitelib}/* %{python3_sitelib}/*
%if %{with python2} %if %{with enable_python2}
%files -n python2-blivet %files -n python2-blivet
%defattr(-,root,root) %defattr(-,root,root)
%license COPYING %license COPYING
@ -112,6 +119,12 @@ python2 package for blivet
%doc README %doc README
%changelog %changelog
* Sat Mar 14 2020 hexiujun <hexiujun1@huawei.com> - 3.1.1-6
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:disable python2
* Mon Jan 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.1.1-5 * Mon Jan 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.1.1-5
- update software package - update software package