Blob Blame History Raw
Name:           pyutil
Version:        1.7.9
Release:        1%{?dist}
Summary:        A collection of mature utilities for Python programmers

Group:          Development/Languages
License:        GPLv2+
URL:            http://allmydata.org/trac/pyutil
Source0:        http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
Patch0:         pyutil-remove-darcs-dep.patch
Patch1:         pyutil-remove-dependency-on-trial.patch

BuildArch:      noarch
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  python-argparse
BuildRequires:  python-zbase32
BuildRequires:  python-twisted-core
BuildRequires:  net-tools
BuildRequires:  python-simplejson
Requires:	python-twisted-core
Requires:       python-argparse
Requires:       python-zbase32
Requires:       python-simplejson


%description
These are a few data structures, classes and functions which we've needed
over many years of Python programming and which seem to be of general use
to other Python programmers. Many of the modules that have existed in pyutil
over the years have subsequently been obsoleted by new features added to
the Python language or its standard library, thus showing that we're not
alone in wanting tools like these.

%prep
%setup -q
# remove dependency on darcs
%patch0 -p1
# remove dependency on setuptools_trial (#523034)
%patch1 -p1
# remove accidentally added test file, reported upstream
rm -v pyutil/test/test_decimalutil.py


%build
python setup.py build


%install
python setup.py install -O1 --skip-build --root %{buildroot}

# rename the utilities to something less generic
mv %{buildroot}%{_bindir}/lines %{buildroot}%{_bindir}/%{name}_lines
mv %{buildroot}%{_bindir}/randcookie %{buildroot}%{_bindir}/%{name}_randcookie
mv %{buildroot}%{_bindir}/randfile %{buildroot}%{_bindir}/%{name}_randfile
mv %{buildroot}%{_bindir}/tailx %{buildroot}%{_bindir}/%{name}_tailx
mv %{buildroot}%{_bindir}/try_decoding %{buildroot}%{_bindir}/%{name}_try_decoding
mv %{buildroot}%{_bindir}/unsort %{buildroot}%{_bindir}/%{name}_unsort
mv %{buildroot}%{_bindir}/verinfo %{buildroot}%{_bindir}/%{name}_verinfo

# remove shebang
find %{buildroot}%{python_sitelib}/%{name} -type f -name \*.py -o -name test_template | \
	xargs sed -i '/^#!\/usr\/bin\/env/d'
 
%check
%{__python} setup.py test


%files
%defattr(-,root,root,-)
%doc README.txt COPYING.GPL COPYING.TGPPL.html CREDITS
%{python_sitelib}/%{name}
%{python_sitelib}/%{name}-%{version}-*.egg-info
%{_bindir}/%{name}_lines
%{_bindir}/%{name}_randcookie
%{_bindir}/%{name}_randfile
%{_bindir}/%{name}_tailx
%{_bindir}/%{name}_try_decoding
%{_bindir}/%{name}_unsort
%{_bindir}/%{name}_verinfo



%changelog
* Thu Jun 24 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 1.7.9-1
- Upstream released new version

* Sat Feb 13 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 1.6.1-4
- Review fixes (#560457)

* Sat Feb 13 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 1.6.1-3
- Rename utilities to something less generic
- BR Twisted for testsuite

* Fri Feb 12 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 1.6.1-2
- Remove dependency on darcs

* Sun Jan 31 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 1.6.1-1
- Initial import