Blob Blame History Raw
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora >= 24}
%global with_python3 1
%endif

%global pypi_name deprecation

Name:           python-%{pypi_name}
Version:        1.0
Release:        5%{?dist}
Summary:        A library to handle automated deprecations
# License text missing from tarball
# https://github.com/briancurtin/deprecation/pull/3
License:        ASL 2.0
URL:            http://deprecation.readthedocs.io/
Source0:        https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
# Fetched from https://raw.githubusercontent.com/briancurtin/deprecation/master/LICENSE (see above)
Source1:        LICENSE
BuildArch:      noarch
 
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
 
%description
The deprecation library provides a deprecated decorator and a
fail_if_not_removed decorator for your tests.

%package -n     python2-%{pypi_name}
Summary:        A library to handle automated deprecations
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
The deprecation library provides a deprecated decorator and a
fail_if_not_removed decorator for your tests.


%if 0%{?with_python3}
%package -n     python3-%{pypi_name}
Summary:        A library to handle automated deprecations
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%description -n python3-%{pypi_name}
The deprecation library provides a deprecated decorator and a
fail_if_not_removed decorator for your tests.
%endif


%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# License text missing from tarball
# https://github.com/briancurtin/deprecation/pull/3
cp -a %{SOURCE1} .

%build
# Required to avoid error "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1918"
export LANG=en_US.utf8
%py2_build
%if 0%{?with_python3}
%py3_build
%endif

%install
# Required to avoid error "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1918"
export LANG=en_US.utf8
%if 0%{?with_python3}
# Must do the subpackages' install first because the scripts in /usr/bin are
# overwritten with every setup.py install.
%py3_install
%endif

%py2_install


%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{pypi_name}.py*
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{pypi_name}.py
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif

%changelog
* Tue Jan 16 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.0-5
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Tue Feb 28 2017 Javier Peña <jpena@redhat.com> - 1.0-3
- Fix description for subpackages

* Tue Feb 28 2017 Javier Peña <jpena@redhat.com> - 1.0-2
- Added license file from git repo

* Wed Feb 15 2017 Javier Peña <jpena@redhat.com> - 1.0-1
- Initial package.