2008-04-08 00:07:38 +00:00
|
|
|
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
|
2010-06-30 19:40:26 +00:00
|
|
|
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
|
2010-06-30 20:25:03 +00:00
|
|
|
%global with_python3 1
|
2010-06-30 19:40:26 +00:00
|
|
|
%else
|
|
|
|
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
|
|
|
%endif
|
2008-04-08 00:07:38 +00:00
|
|
|
|
|
|
|
Name: python-decorator
|
2010-06-30 19:40:26 +00:00
|
|
|
Version: 3.2.0
|
2010-07-08 01:45:03 +00:00
|
|
|
Release: 2%{?dist}
|
2008-04-08 00:07:38 +00:00
|
|
|
Summary: Module to simplify usage of decorators
|
|
|
|
|
|
|
|
Group: Development/Languages
|
|
|
|
License: BSD
|
|
|
|
URL: http://www.phyast.pitt.edu/~micheles/python/documentation.html
|
2009-01-22 07:53:46 +00:00
|
|
|
Source0: http://pypi.python.org/packages/source/d/decorator/decorator-%{version}.tar.gz
|
2008-04-08 00:07:38 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
|
|
|
|
BuildArch: noarch
|
2010-06-30 19:40:26 +00:00
|
|
|
BuildRequires: python2-devel
|
|
|
|
%if 0%{?fedora} && 0%{?fedora} < 13
|
2008-04-08 00:07:38 +00:00
|
|
|
BuildRequires: python-setuptools-devel
|
2010-06-30 19:40:26 +00:00
|
|
|
%else
|
|
|
|
BuildRequires: python-setuptools
|
|
|
|
%endif
|
2009-01-22 07:53:46 +00:00
|
|
|
BuildRequires: python-nose
|
2008-04-08 00:07:38 +00:00
|
|
|
|
2010-06-30 20:25:03 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
%endif
|
|
|
|
|
2008-04-08 00:07:38 +00:00
|
|
|
%description
|
|
|
|
The aim of the decorator module is to simplify the usage of decorators for
|
|
|
|
the average programmer, and to popularize decorators usage giving examples
|
|
|
|
of useful decorators, such as memoize, tracing, redirecting_stdout, locked,
|
|
|
|
etc. The core of this module is a decorator factory called decorator.
|
|
|
|
|
2010-06-30 20:25:03 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
%package -n python3-decorator
|
|
|
|
Summary: Module to simplify usage of decorators in python3
|
|
|
|
Group: Development/Languages
|
|
|
|
|
|
|
|
%description -n python3-decorator
|
|
|
|
The aim of the decorator module is to simplify the usage of decorators for
|
|
|
|
the average programmer, and to popularize decorators usage giving examples
|
|
|
|
of useful decorators, such as memoize, tracing, redirecting_stdout, locked,
|
|
|
|
etc. The core of this module is a decorator factory called decorator.
|
|
|
|
%endif # if with_python3
|
|
|
|
|
2008-04-08 00:07:38 +00:00
|
|
|
%prep
|
2009-01-22 07:53:46 +00:00
|
|
|
%setup -q -n decorator-%{version}
|
2010-06-30 19:40:26 +00:00
|
|
|
|
2009-05-22 05:24:36 +00:00
|
|
|
chmod a-x *.txt *.py
|
2008-04-08 00:07:38 +00:00
|
|
|
%{__sed} -i 's/\r//' README.txt
|
|
|
|
|
2010-06-30 20:25:03 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
rm -rf %{py3dir}
|
|
|
|
cp -a . %{py3dir}
|
|
|
|
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
|
|
|
%endif # with_python3
|
|
|
|
|
|
|
|
|
2008-04-08 00:07:38 +00:00
|
|
|
%build
|
|
|
|
%{__python} setup.py build
|
|
|
|
|
2010-06-30 20:25:03 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
%{__python3} setup.py build
|
|
|
|
popd
|
|
|
|
%endif # with_python3
|
|
|
|
|
|
|
|
|
2008-04-08 00:07:38 +00:00
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
|
|
|
|
2010-06-30 20:25:03 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
|
|
|
popd
|
|
|
|
%endif # with_python3
|
|
|
|
|
2008-04-08 00:07:38 +00:00
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%check
|
2009-06-05 13:58:43 +00:00
|
|
|
# Until we get the python-multiprocessing backport packaged
|
2009-06-15 16:47:51 +00:00
|
|
|
%if 0%{?fedora} >= 11 || 0%{?rhel} > 5
|
2010-06-30 19:40:26 +00:00
|
|
|
nosetests --with-doctest -e documentation3
|
2009-06-05 13:58:43 +00:00
|
|
|
%endif
|
2008-04-08 00:07:38 +00:00
|
|
|
|
2010-06-30 20:25:03 +00:00
|
|
|
# nose is not Python3 ready yet
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
#nosetests --with-doctest -e documentation
|
|
|
|
popd
|
|
|
|
%endif # with_python3
|
|
|
|
|
2008-04-08 00:07:38 +00:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2010-07-08 01:45:03 +00:00
|
|
|
%doc *.txt documentation.py
|
2008-04-08 00:07:38 +00:00
|
|
|
%{python_sitelib}/*
|
|
|
|
|
2010-06-30 20:25:03 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
%files -n python3-decorator
|
|
|
|
%defattr(-,root,root,-)
|
2010-07-08 01:45:03 +00:00
|
|
|
%doc *.txt documentation3.py
|
2010-06-30 20:25:03 +00:00
|
|
|
%{python3_sitelib}/*
|
|
|
|
%endif # with_python3
|
|
|
|
|
|
|
|
|
2008-04-08 00:07:38 +00:00
|
|
|
%changelog
|
2010-07-08 01:45:03 +00:00
|
|
|
* Wed Jul 7 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 3.2.0-2
|
|
|
|
- Add documentation.py files to both subpackages (this contains a brief license
|
|
|
|
assertion among other things).
|
2010-06-30 19:40:26 +00:00
|
|
|
* Wed Jun 30 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 3.2.0-1
|
|
|
|
- Minor cleanups
|
|
|
|
- Upgrade to 3.2.0
|
2010-06-30 20:25:03 +00:00
|
|
|
- Add python3 subpackage
|
2010-06-30 19:40:26 +00:00
|
|
|
|
2009-10-06 20:40:24 +00:00
|
|
|
* Tue Oct 6 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 3.1.2-2
|
|
|
|
- Really include the new source tarball
|
|
|
|
|
2009-10-06 20:35:57 +00:00
|
|
|
* Tue Oct 6 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 3.1.2-1
|
|
|
|
- Update to upstream release 3.1.2
|
|
|
|
|
2009-07-26 20:17:31 +00:00
|
|
|
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.1-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
|
|
|
|
2009-06-05 13:58:43 +00:00
|
|
|
* Sun May 31 2009 Luke Macken <lmacken@redhat.com> - 3.0.1-2
|
|
|
|
- Only run the test suite on Fedora 11, which has Py2.6 and the multiprocessing
|
|
|
|
module. We can disable this once the compat module is packaged for F10 and
|
|
|
|
below.
|
|
|
|
|
2009-05-22 05:24:36 +00:00
|
|
|
* Thu May 21 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 3.0.1-1
|
|
|
|
- Update to upstream release 3.0.1.
|
|
|
|
|
2009-02-26 21:08:01 +00:00
|
|
|
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.2-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
|
|
|
|
2009-01-22 07:53:46 +00:00
|
|
|
* Wed Jan 21 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 2.3.2-1
|
|
|
|
- Update to 2.3.2
|
|
|
|
- Enable tests via nose
|
|
|
|
|
2008-11-29 15:27:22 +00:00
|
|
|
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.2.0-2
|
|
|
|
- Rebuild for Python 2.6
|