diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b9f9046 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/unittest2-0.8.0.tar.gz diff --git a/dead.package b/dead.package deleted file mode 100644 index 0f98991..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -Package is retired diff --git a/python-unittest2.spec b/python-unittest2.spec new file mode 100644 index 0000000..310f490 --- /dev/null +++ b/python-unittest2.spec @@ -0,0 +1,110 @@ +# Created by pyp2rpm-1.1.1 +%global pypi_name unittest2 +%global with_python3 1 + +Name: python-%{pypi_name} +Version: 0.8.0 +Release: 1%{?dist} +Summary: The new features in unittest backported to Python 2.4+ + +License: BSD +URL: http://pypi.python.org/pypi/unittest2 +Source0: https://pypi.python.org/packages/source/u/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +Patch0: unittest2-0.8.0-remove-argparse-from-requires.patch +BuildArch: noarch + +BuildRequires: python2-devel +BuildRequires: python-setuptools +BuildRequires: python-six +Requires: python-setuptools +Requires: python-six + +%if %{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-six +%endif # if with_python3 + + +%description +unittest2 is a backport of the new features added to the unittest testing +framework in Python 2.7 and onwards. It is tested to run on Python 2.6, 2.7, +3.2, 3.3, 3.4 and pypy. + +%if 0%{?with_python3} +%package -n python3-%{pypi_name} +Summary: The new features in unittest backported to Python 2.4+ +Requires: python3-setuptools +Requires: python3-six + +%description -n python3-%{pypi_name} +unittest2 is a backport of the new features added to the unittest testing +framework in Python 2.7 and onwards. It is tested to run on Python 2.6, 2.7, +3.2, 3.3, 3.4 and pypy. +%endif # with_python3 + +%prep +%setup -q -n %{pypi_name}-%{version} +# Remove bundled egg-info +rm -rf %{pypi_name}.egg-info + +%patch0 -p0 + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # with_python3 + + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif # with_python3 + + +%install +# Must do the subpackages' install first because the scripts in /usr/bin are +# overwritten with every setup.py install (and we want the python2 version +# to be the default for now). +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +mv %{buildroot}%{_bindir}/unit2 %{buildroot}/%{_bindir}/python3-unit2 +popd +%endif # with_python3 + +%{__python2} setup.py install --skip-build --root %{buildroot} + + +%check +%{__python2} -m unittest2 + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} -m unittest2 +popd +%endif # with_python3 + + +%files +%doc README.txt +%{_bindir}/unit2 +%{python2_sitelib}/%{pypi_name} +%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info + +%if 0%{?with_python3} +%files -n python3-%{pypi_name} +%doc README.txt +%{_bindir}/python3-unit2 +%{python3_sitelib}/%{pypi_name} +%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%endif # with_python3 + +%changelog +* Mon Nov 10 2014 Slavek Kabrda - 0.8.0-1 +- Unretire the package, create a fresh specfile diff --git a/sources b/sources new file mode 100644 index 0000000..909a88a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +3ae364d783aaf1fafb67ff77fd7abfcb unittest2-0.8.0.tar.gz diff --git a/unittest2-0.8.0-remove-argparse-from-requires.patch b/unittest2-0.8.0-remove-argparse-from-requires.patch new file mode 100644 index 0000000..05862b4 --- /dev/null +++ b/unittest2-0.8.0-remove-argparse-from-requires.patch @@ -0,0 +1,11 @@ +--- setup.py.orig 2014-11-10 14:56:10.834139343 +0100 ++++ setup.py 2014-11-10 14:56:25.701122189 +0100 +@@ -57,7 +57,7 @@ + # Both install and setup requires - because we read VERSION from within the + # package, and the package also exports all the APIs. + # six for compat helpers +-REQUIRES = ['argparse', 'six'], ++REQUIRES = ['six'], + + params = dict( + name=NAME,