Drop support for Python 2 from spec

Python 2 was used in Fedora 21 (old-stable now) and before, but no
updates are expected for Fedora < 22.
This commit is contained in:
Mikolaj Izdebski 2015-06-02 09:45:35 +02:00
parent 192ffcbf82
commit fd20f54087

View File

@ -1,12 +1,5 @@
%bcond_without tests
%if 0%{?fedora} > 21
%global with_python3 1
%else
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
%endif
Name: javapackages-tools
Version: 4.4.0
Release: 1%{?dist}
@ -19,19 +12,11 @@ Source0: https://fedorahosted.org/released/javapackages/javapackages-%{ve
BuildArch: noarch
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-lxml
BuildRequires: python3-setuptools
BuildRequires: python3-nose
BuildRequires: python3-six
%else
BuildRequires: python2-devel
BuildRequires: python-lxml
BuildRequires: python-setuptools
BuildRequires: python-nose
BuildRequires: python-six
%endif
BuildRequires: make
BuildRequires: asciidoc
BuildRequires: xmlto
@ -42,13 +27,8 @@ BuildRequires: xmvn-resolve >= 2
Requires: coreutils
Requires: lua
%if 0%{?with_python3}
Requires: python3-javapackages = %{version}-%{release}
Requires: python3
%else
Requires: python-javapackages = %{version}-%{release}
Requires: python
%endif
Provides: jpackage-utils = %{version}-%{release}
Obsoletes: jpackage-utils < %{version}-%{release}
@ -122,7 +102,6 @@ Requires: xmvn-connector-ivy >= 2
This package implements local mode fow Apache Ivy, which allows
artifact resolution using XMvn resolver.
%if 0%{?with_python3}
%package -n python3-javapackages
Summary: Module for handling various files for Java packaging
Requires: python3-lxml
@ -133,19 +112,6 @@ Obsoletes: python-javapackages < %{version}-%{release}
Module for handling, querying and manipulating of various files for Java
packaging in Linux distributions
%else # python2
%package -n python-javapackages
Summary: Module for handling various files for Java packaging
Requires: python-lxml
Requires: python-six
Obsoletes: python3-javapackages < %{version}-%{release}
%description -n python-javapackages
Module for handling, querying and manipulating of various files for Java
packaging in Linux distributions
%endif
%package doc
Summary: Guide for Java packaging
@ -166,11 +132,7 @@ This package provides non-essential macros and scripts to support Java packaging
%setup -q -n javapackages-%{version}
%build
%if 0%{?with_python3}
%configure --pyinterpreter=%{__python3}
%else
%configure --pyinterpreter=%{__python2}
%endif
./build
%install
@ -178,11 +140,7 @@ This package provides non-essential macros and scripts to support Java packaging
sed -e 's/.[17]$/&.gz/' -e 's/.py$/&*/' -i files-*
pushd python
%if 0%{?with_python3}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
%else
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%endif
popd
%if %{with tests}
@ -201,15 +159,9 @@ popd
%files -n ivy-local -f files-ivy
%if 0%{?with_python3}
%files -n python3-javapackages
%doc LICENSE
%{python3_sitelib}/javapackages*
%else # python2
%files -n python-javapackages
%doc LICENSE
%{python_sitelib}/javapackages*
%endif
%files doc -f files-doc
%doc LICENSE