Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

%if 0%{?fedora}
%global with_python3 1
%endif

%define modname zope.deprecation

Name:           python-zope-deprecation
Version:        4.4.0
Release:        1%{?dist}
Summary:        Zope 3 Deprecation Infrastructure

License:        ZPLv2.1
URL:            https://pypi.python.org/pypi/zope.deprecation
Source0:        https://files.pythonhosted.org/packages/source/z/%{modname}/%{modname}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python2-setuptools

%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
%endif

%global _description\
This package provides a simple function called 'deprecated(names, reason)' to\
deprecate the previously mentioned Python objects.

%description %_description

%package -n python2-zope-deprecation
Summary: %summary
%{?python_provide:%python_provide python2-zope-deprecation}

%description -n python2-zope-deprecation %_description

%if 0%{?with_python3}
%package -n python3-zope-deprecation
Summary:        Zope 3 Deprecation Infrastructure

%description -n python3-zope-deprecation
This package provides a simple function called 'deprecated(names, reason)' to
deprecate the previously mentioned Python objects.
%endif

%prep
%setup -q -n %{modname}-%{version}

rm -rf %{modname}.egg-info

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%py2_build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif

%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
rm -f %{buildroot}%{python3_sitelib}/zope/deprecation/tests.py*
popd
%endif

%py2_install
rm -f %{buildroot}%{python_sitelib}/zope/deprecation/tests.py*

%check
%{__python2} setup.py test

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif

%files -n python2-zope-deprecation
%doc README.rst LICENSE.txt
%{python2_sitelib}/zope/deprecation/
%{python2_sitelib}/%{modname}-%{version}-*

%if 0%{?with_python3}
%files -n python3-zope-deprecation
%doc README.rst LICENSE.txt
%{python3_sitelib}/zope/deprecation/
%{python3_sitelib}/%{modname}-%{version}-*
%endif


%changelog
* Wed Jan 16 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 4.4.0-1
- Upgrade to 4.4.0.
- https://github.com/zopefoundation/zope.deprecation/blob/4.4.0/CHANGES.rst

* Thu Sep 20 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 4.3.0-4
- Fix FTBFS by adding a BR on python2-devel (#1606009).

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Sun Jun 17 2018 Miro Hrončok <mhroncok@redhat.com> - 4.3.0-3
- Rebuilt for Python 3.7

* Thu Feb 08 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.3.0-2
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Tue Feb 06 2018 Lumír Balhar <lbalhar@redhat.com> - 4.3.0-1
- New upstream release
- URLs with SSL

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.1.1-13
- Python 2 binary package renamed to python2-zope-deprecation
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

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

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild