Move from variables to bcond

i9ce
Fabio Alessandro Locati 9 years ago
parent e901e63320
commit 96a1bb2a36

@ -1,12 +1,7 @@
%if 0%{?rhel} %if 0%{?rhel} && 0%{?rhel} <= 7
%global with_python3 0 %bcond_with python3
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
%else %else
%global with_python3 1 %bcond_without python3
%endif %endif
%global pypi_name boto3 %global pypi_name boto3
@ -30,7 +25,7 @@ BuildRequires: python2-botocore
BuildRequires: python2-jmespath BuildRequires: python2-jmespath
BuildRequires: python-futures BuildRequires: python-futures
BuildRequires: python2-s3transfer BuildRequires: python2-s3transfer
%if 0%{?with_python3} %if %{with python3}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python3-nose BuildRequires: python3-nose
@ -39,7 +34,7 @@ BuildRequires: python3-wheel
BuildRequires: python3-botocore BuildRequires: python3-botocore
BuildRequires: python3-jmespath BuildRequires: python3-jmespath
BuildRequires: python3-s3transfer BuildRequires: python3-s3transfer
%endif # with_python3 %endif # with python3
%description %description
Boto3 is the Amazon Web Services (AWS) Software Development Boto3 is the Amazon Web Services (AWS) Software Development
@ -62,7 +57,7 @@ Kit (SDK) for Python, which allows Python developers to
write software that makes use of services like Amazon S3 write software that makes use of services like Amazon S3
and Amazon EC2. and Amazon EC2.
%if 0%{?with_python3} %if %{with python3}
%package -n python3-%{pypi_name} %package -n python3-%{pypi_name}
Summary: The AWS SDK for Python Summary: The AWS SDK for Python
Requires: python3-botocore >= 1.4.1 Requires: python3-botocore >= 1.4.1
@ -75,7 +70,7 @@ Boto3 is the Amazon Web Services (AWS) Software Development
Kit (SDK) for Python, which allows Python developers to Kit (SDK) for Python, which allows Python developers to
write software that makes use of services like Amazon S3 write software that makes use of services like Amazon S3
and Amazon EC2. and Amazon EC2.
%endif # with_python3 %endif # with python3
%prep %prep
%setup -q -n %{pypi_name}-%{version} %setup -q -n %{pypi_name}-%{version}
@ -85,21 +80,21 @@ rm -rf tests/integration
%build %build
%py2_build %py2_build
%if 0%{?with_python3} %if %{with python3}
%py3_build %py3_build
%endif # with_python3 %endif # with python3
%install %install
%if 0%{?with_python3} %if %{with python3}
%py3_install %py3_install
%endif # with_python3 %endif # with python3
%py2_install %py2_install
%check %check
%{__python2} setup.py test %{__python2} setup.py test
%if 0%{?with_python3} %if %{with python3}
%{__python3} setup.py test %{__python3} setup.py test
%endif # with_python3 %endif # with python3
%files -n python2-%{pypi_name} %files -n python2-%{pypi_name}
%{!?_licensedir:%global license %doc} %{!?_licensedir:%global license %doc}
@ -108,13 +103,13 @@ rm -rf tests/integration
%{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%if 0%{?with_python3} %if %{with python3}
%files -n python3-%{pypi_name} %files -n python3-%{pypi_name}
%doc README.rst %doc README.rst
%license LICENSE %license LICENSE
%{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with_python3 %endif # with python3
%changelog %changelog
* Thu Aug 04 2016 Fabio Alessandro Locati <fale@redhat.com> - 1.4.0-1 * Thu Aug 04 2016 Fabio Alessandro Locati <fale@redhat.com> - 1.4.0-1

Loading…
Cancel
Save