eb61a9e
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
eb61a9e
%if 0%{?fedora >= 24}
eb61a9e
%global with_python3 1
eb61a9e
%endif
eb61a9e
eb61a9e
%global pypi_name deprecation
eb61a9e
eb61a9e
Name:           python-%{pypi_name}
eb61a9e
Version:        1.0
296e993
Release:        4%{?dist}
eb61a9e
Summary:        A library to handle automated deprecations
eb61a9e
# License text missing from tarball
eb61a9e
# https://github.com/briancurtin/deprecation/pull/3
eb61a9e
License:        ASL 2.0
eb61a9e
URL:            http://deprecation.readthedocs.io/
eb61a9e
Source0:        https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
eb61a9e
# Fetched from https://raw.githubusercontent.com/briancurtin/deprecation/master/LICENSE (see above)
eb61a9e
Source1:        LICENSE
eb61a9e
BuildArch:      noarch
eb61a9e
 
eb61a9e
BuildRequires:  python2-devel
eb61a9e
BuildRequires:  python-setuptools
eb61a9e
 
eb61a9e
%description
eb61a9e
The deprecation library provides a deprecated decorator and a
eb61a9e
fail_if_not_removed decorator for your tests.
eb61a9e
eb61a9e
%package -n     python2-%{pypi_name}
eb61a9e
Summary:        A library to handle automated deprecations
eb61a9e
%{?python_provide:%python_provide python2-%{pypi_name}}
eb61a9e
eb61a9e
%description -n python2-%{pypi_name}
eb61a9e
The deprecation library provides a deprecated decorator and a
eb61a9e
fail_if_not_removed decorator for your tests.
eb61a9e
eb61a9e
eb61a9e
%if 0%{?with_python3}
eb61a9e
%package -n     python3-%{pypi_name}
eb61a9e
Summary:        A library to handle automated deprecations
eb61a9e
%{?python_provide:%python_provide python3-%{pypi_name}}
eb61a9e
BuildRequires:  python3-devel
eb61a9e
BuildRequires:  python3-setuptools
eb61a9e
eb61a9e
%description -n python3-%{pypi_name}
eb61a9e
The deprecation library provides a deprecated decorator and a
eb61a9e
fail_if_not_removed decorator for your tests.
eb61a9e
%endif
eb61a9e
eb61a9e
eb61a9e
%prep
eb61a9e
%autosetup -n %{pypi_name}-%{version}
eb61a9e
# Remove bundled egg-info
eb61a9e
rm -rf %{pypi_name}.egg-info
eb61a9e
# License text missing from tarball
eb61a9e
# https://github.com/briancurtin/deprecation/pull/3
eb61a9e
cp -a %{SOURCE1} .
eb61a9e
eb61a9e
%build
eb61a9e
# Required to avoid error "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1918"
eb61a9e
export LANG=en_US.utf8
eb61a9e
%py2_build
eb61a9e
%if 0%{?with_python3}
eb61a9e
%py3_build
eb61a9e
%endif
eb61a9e
eb61a9e
%install
eb61a9e
# Required to avoid error "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1918"
eb61a9e
export LANG=en_US.utf8
eb61a9e
%if 0%{?with_python3}
eb61a9e
# Must do the subpackages' install first because the scripts in /usr/bin are
eb61a9e
# overwritten with every setup.py install.
eb61a9e
%py3_install
eb61a9e
%endif
eb61a9e
eb61a9e
%py2_install
eb61a9e
eb61a9e
eb61a9e
%files -n python2-%{pypi_name}
eb61a9e
%doc README.rst
eb61a9e
%license LICENSE
eb61a9e
%{python2_sitelib}/%{pypi_name}.py*
eb61a9e
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
eb61a9e
eb61a9e
%if 0%{?with_python3}
eb61a9e
%files -n python3-%{pypi_name}
eb61a9e
%doc README.rst
eb61a9e
%license LICENSE
eb61a9e
%{python3_sitelib}/__pycache__/*
eb61a9e
%{python3_sitelib}/%{pypi_name}.py
eb61a9e
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
eb61a9e
%endif
eb61a9e
eb61a9e
%changelog
296e993
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-4
296e993
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
296e993
eb61a9e
* Tue Feb 28 2017 Javier Peña <jpena@redhat.com> - 1.0-3
eb61a9e
- Fix description for subpackages
eb61a9e
eb61a9e
* Tue Feb 28 2017 Javier Peña <jpena@redhat.com> - 1.0-2
eb61a9e
- Added license file from git repo
eb61a9e
eb61a9e
* Wed Feb 15 2017 Javier Peña <jpena@redhat.com> - 1.0-1
eb61a9e
- Initial package.