%{?fedora: %global with_python3 1}
%global oname Unipath
Summary: Alternative to Python modules os, os.path and shutil
Name: python-unipath
Version: 1.0
Release: 9%{?dist}
License: Python
Group: Development/Tools
URL : http://pypi.python.org/pypi/Unipath/
Source0: https://pypi.python.org/packages/source/U/Unipath/Unipath-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
%description
Unipath is a package for doing pathname calculations and filesystem
access in an object-oriented manner, an alternative to functions in
os.path, shutil and glob, and even some functions in os.* It's based
on Jason Orendorff's path.py but does not adhere as strictly to the
underlying functions' syntax, in order to provide more user
convenience and higher-level functionality. For example:
o p.mkdir() succeeds silently if the directory already exists, and
o p.mkdir(True) creates intermediate directories a la os.makedirs.
o p.rmtree(parents=True) combines shutil.rmtree, os.path.isdir,
os.remove, and os.removedirs, to recursively remove whatever it is
if it exists.
o p.read_file("rb") returns the file's contents in binary mode.
o p.needs_update([other_path1, ...]) returns True if p doesn't exist
or has an older timestamp than any of the others.
o extra convenience functions in the unipath.tools module. dict2dir
creates a directory hierarchy described by a dict. dump_path displays
an ASCII tree of a directory hierarchy.
%if 0%{?with_python3}
%package -n python3-unipath
Summary: Alternative to Python modules os, os.path and shutil
Group: Development/Tools
%description -n python3-unipath
Unipath is a package for doing pathname calculations and filesystem
access in an object-oriented manner, an alternative to functions in
os.path, shutil and glob, and even some functions in os.* It's based
on Jason Orendorff's path.py but does not adhere as strictly to the
underlying functions' syntax, in order to provide more user
convenience and higher-level functionality. For example:
o p.mkdir() succeeds silently if the directory already exists, and
o p.mkdir(True) creates intermediate directories a la os.makedirs.
o p.rmtree(parents=True) combines shutil.rmtree, os.path.isdir,
os.remove, and os.removedirs, to recursively remove whatever it is
if it exists.
o p.read_file("rb") returns the file's contents in binary mode.
o p.needs_update([other_path1, ...]) returns True if p doesn't exist
or has an older timestamp than any of the others.
o extra convenience functions in the unipath.tools module. dict2dir
creates a directory hierarchy described by a dict. dump_path displays
an ASCII tree of a directory hierarchy.
This is the Python 3 build of Unipath
%endif # if with_python3
%prep
%setup -q -n %{oname}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
%endif
%install
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
%endif
%files
%doc BUGS.txt CHANGES PKG-INFO README.html README.rst
%{python_sitelib}/unipath/
%{python_sitelib}/%{oname}-%{version}-py*.egg-info
%if 0%{?with_python3}
%files -n python3-unipath
%doc BUGS.txt CHANGES PKG-INFO README.html README.rst
%{python3_sitelib}/unipath/
%{python3_sitelib}/%{oname}-%{version}-py*.egg-info
%endif
%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 1.0-8
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Wed Oct 23 2013 Terje Rosten <terje.rosten@ntnu.no> - 1.0-1
- 1.0
- Python 3 package
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.2.1-4
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Tue Apr 14 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.2.1-2
- Minor changes taken from review
* Sun Mar 29 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.2.1-1
- initial build