a7dca9f
# This package contains macros that provide functionality relating to
a7dca9f
# Software Collections. These macros are not used in default
a7dca9f
# Fedora builds, and should not be blindly copied or enabled.
a7dca9f
# Specifically, the "scl" macro must not be defined in official Fedora
a7dca9f
# builds. For more information, see:
a7dca9f
# http://docs.fedoraproject.org/en-US/Fedora_Contributor_Documentation
a7dca9f
# /1/html/Software_Collections_Guide/index.html
a7dca9f
a7dca9f
%{?scl:%scl_package python-%{pypi_name}}
a7dca9f
%{!?scl:%global pkg_name %{name}}
a7dca9f
5ec486c
# Created by pyp2rpm-0.5.1
f6c1005
# if building for SCL or on RHEL, don't build python3- subpackage
f6c1005
%if %{?scl:0}%{!?scl:1} && %{?rhel:0}%{!?rhel:1}
f6c1005
%global with_python3 1
f6c1005
%else
f6c1005
%global with_python3 0
f6c1005
%endif
5ec486c
%global pypi_name sure
5ec486c
a7dca9f
Name:           %{?scl_prefix}python-%{pypi_name}
f6c1005
Version:        1.2.5
9b869bc
Release:        2%{?dist}
5ec486c
Summary:        Assertion toolbox for python
5ec486c
370b208
License:        GPLv3+
5ec486c
URL:            https://github.com/gabrielfalcao/sure
5ec486c
Source0:        http://pypi.python.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
5ec486c
# Already asked upstream to include COPYING in the source tar:
5ec486c
# https://github.com/gabrielfalcao/sure/issues/17
5ec486c
Source1:        https://raw.github.com/gabrielfalcao/sure/master/COPYING
5ec486c
# To get tests:
5ec486c
# git clone https://github.com/gabrielfalcao/sure.git && cd sure
f6c1005
# git checkout 1.2.5 && tar czf sure-1.2.5-tests.tgz tests/
5ec486c
Source2:        %{pypi_name}-%{version}-tests.tgz
9b869bc
# Remove unnecessary dependencies in setup.py which might break
9b869bc
# depending packages builds, https://github.com/gabrielfalcao/sure/pull/57
9b869bc
Patch0:         sure-remove-unnecessary-dependencies.patch
5ec486c
BuildArch:      noarch
5ec486c
a7dca9f
BuildRequires:  %{?scl_prefix}python2-devel
a7dca9f
BuildRequires:  %{?scl_prefix}python-nose
a7dca9f
BuildRequires:  %{?scl_prefix}python-setuptools
5ec486c
a594c9c
%if 0%{with_python3}
a594c9c
BuildRequires:  %{?scl_prefix}python3-devel
a594c9c
BuildRequires:  %{?scl_prefix}python3-nose
a594c9c
BuildRequires:  %{?scl_prefix}python3-setuptools
a594c9c
%endif
a594c9c
5ec486c
%description
5ec486c
A Python assertion toolbox that works fine with nose.
5ec486c
a594c9c
%if 0%{?with_python3}
a594c9c
%package -n python3-%{pypi_name}
a594c9c
Summary:        Assertion toolbox for python 3
a594c9c
a594c9c
%description -n python3-%{pypi_name}
a594c9c
A Python assertion toolbox that works fine with nose.
a594c9c
%endif # with_python3
a594c9c
5ec486c
%prep
5ec486c
%setup -q -n %{pypi_name}-%{version}
5ec486c
# Remove bundled egg-info
5ec486c
rm -rf %{pypi_name}.egg-info
5ec486c
cp %{SOURCE1} .
a594c9c
tar xzf %{SOURCE2}
a594c9c
9b869bc
%patch0 -p1
9b869bc
a594c9c
%if 0%{?with_python3}
a594c9c
rm -rf %{py3dir}
a594c9c
cp -a . %{py3dir}
a594c9c
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/bin/env python|#!%{__python3}|'
a594c9c
%endif # with_python3
5ec486c
5ec486c
%build
a7dca9f
%{?scl:scl enable %{scl} "}
5ec486c
%{__python} setup.py build
a7dca9f
%{?scl:"}
5ec486c
a594c9c
%if 0%{with_python3}
a594c9c
pushd %{py3dir}
f6c1005
LANG=en_US.utf8 %{__python3} setup.py build
a594c9c
popd
a594c9c
%endif
a594c9c
5ec486c
%install
a7dca9f
%{?scl:scl enable %{scl} "}
5ec486c
%{__python} setup.py install --skip-build --root %{buildroot}
a7dca9f
%{?scl:"}
5ec486c
a594c9c
%if 0%{?with_python3}
a594c9c
pushd %{py3dir}
f6c1005
LANG=en_US.utf8 %{__python3} setup.py install --skip-build --root %{buildroot}
a594c9c
popd
a594c9c
%endif # with_python3
a594c9c
5ec486c
%check
a7dca9f
%{?scl:scl enable %{scl} "}
5ec486c
nosetests
a7dca9f
%{?scl:"}
5ec486c
a594c9c
%if 0%{?with_python3}
a594c9c
pushd %{py3dir}
a594c9c
/usr/bin/nosetests-3*
a594c9c
popd
a594c9c
%endif # with_python3
a594c9c
5ec486c
%files
5ec486c
%doc COPYING
5ec486c
%{python_sitelib}/%{pypi_name}
5ec486c
%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
5ec486c
f6c1005
%if 0%{?with_python3}
a594c9c
%files -n python3-%{pypi_name}
a594c9c
%doc COPYING
a594c9c
%{python3_sitelib}/%{pypi_name}
a594c9c
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
f6c1005
%endif
a594c9c
5ec486c
%changelog
9b869bc
* Mon Mar 31 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.2.5-2
9b869bc
- Remove unneeded dependencies from setup.py.
9b869bc
Resolves: rhbz#1082400
9b869bc
f6c1005
* Fri Mar 07 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.2.5-1
f6c1005
- Updated to 1.2.5
f6c1005
- Fix with_python3 macro definition to work correctly on EPEL, too.
f6c1005
a594c9c
* Fri Nov 29 2013 Miro HronĨok <mhroncok@redhat.com> - 1.2.3-1
a594c9c
- Updated
a594c9c
- Introduced Python 3 subpackage
a594c9c
3672995
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-3
3672995
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
3672995
a7dca9f
* Thu May 30 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 1.1.7-2
a7dca9f
- Introduce SCL macros in the specfile.
a7dca9f
370b208
* Mon Feb 18 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 1.1.7-1
370b208
- Update to 1.1.7.
370b208
- License change from MIT to GPLv3.
370b208
e7bdbfe
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.6-2
e7bdbfe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
e7bdbfe
6df3a58
* Mon Nov 05 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.0.6-1
6df3a58
- Update to 1.0.6.
6df3a58
bb777c2
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.3-3
bb777c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
bb777c2
5ec486c
* Tue Jun 26 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 0.10.3-2
5ec486c
- python-devel should be python2-devel
5ec486c
- URL now points to the real homepage of the project
5ec486c
5ec486c
* Fri Jun 22 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 0.10.3-1
5ec486c
- Initial package.