python-unipath-vl.spec 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
  2. %global oname Unipath
  3. Summary: Alternative to Python modules os, os.path and shutil
  4. Name: python-unipath
  5. Version: 0.2.1
  6. Release: 2%{?_dist_release}
  7. License: Python
  8. Group: Development/Tools
  9. URL: http://pypi.python.org/pypi/Unipath/
  10. Source0: http://pypi.python.org/packages/source/U/Unipath/%{oname}-%{version}.tar.gz
  11. BuildArch: noarch
  12. BuildRequires: python-setuptools python-nose nkf
  13. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  14. %description
  15. Unipath is a package for doing pathname calculations and filesystem
  16. access in an object-oriented manner, an alternative to functions in
  17. os.path, shutil and glob, and even some functions in os.* It's based
  18. on Jason Orendorff's path.py but does not adhere as strictly to the
  19. underlying functions' syntax, in order to provide more user
  20. convenience and higher-level functionality. For example:
  21. o p.mkdir() succeeds silently if the directory already exists, and
  22. o p.mkdir(True) creates intermediate directories a la os.makedirs.
  23. o p.rmtree(parents=True) combines shutil.rmtree, os.path.isdir,
  24. os.remove, and os.removedirs, to recursively remove whatever it is
  25. if it exists.
  26. o p.read_file("rb") returns the file's contents in binary mode.
  27. o p.needs_update([other_path1, ...]) returns True if p doesn't exist
  28. or has an older timestamp than any of the others.
  29. o extra convenience functions in the unipath.tools module. dict2dir
  30. creates a directory hierarchy described by a dict. dump_path displays
  31. an ASCII tree of a directory hierarchy.
  32. %prep
  33. %setup -q -n %{oname}-%{version}
  34. for f in doc/reference/{test_,}path_nr.py ; do
  35. nkf --unix --overwrite $f
  36. done
  37. for f in README.txt doc/reference/path_355.py ; do
  38. iconv -f ISO-8859-1 -t UTF-8 -o $f.utf8 $f && \
  39. touch -r $f $f.utf8 && \
  40. %{__mv} $f.utf8 $f
  41. done
  42. # To avoid warning about script without execute bit set
  43. %{__sed} -i -e '1d' unipath/test.py
  44. %build
  45. %{__python} setup.py build
  46. %install
  47. %{__rm} -rf %{buildroot}
  48. %{__python} setup.py install -O1 --skip-build --root %{buildroot}
  49. %clean
  50. %{__rm} -rf %{buildroot}
  51. %check
  52. %{__cp} unipath/test.py .
  53. %{__python} test.py
  54. %files
  55. %defattr(-, root, root, -)
  56. %doc BUGS.txt CHANGES doc/reference/ PKG-INFO README.html README.txt
  57. %{python_sitelib}/unipath/
  58. %{python_sitelib}/%{oname}-%{version}-py*.*.egg-info
  59. %changelog
  60. * Wed Feb 03 2010 Shu KONNO <owa@bg.wakwak.com> 0.2.1-2
  61. - rebuild with python-2.6.4
  62. * Thu Oct 22 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.2.1-1
  63. - initial build for Vine Linux based on fedora development
  64. * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-3
  65. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  66. * Tue Apr 14 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.2.1-2
  67. - Minor changes taken from review
  68. * Sun Mar 29 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.2.1-1
  69. - initial build