Add python3 subpackage
This commit is contained in:
parent
9f63354ee1
commit
077afebfe3
65
cpioarchive_supports_2_3.patch
Normal file
65
cpioarchive_supports_2_3.patch
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
--- cpioarchive.py.orig 2006-01-03 19:49:29.000000000 +0000
|
||||||
|
+++ cpioarchive.py 2015-08-14 17:06:40.580092327 +0100
|
||||||
|
@@ -1,3 +1,5 @@
|
||||||
|
+from __future__ import absolute_import
|
||||||
|
+
|
||||||
|
""" cpioarchive: Support for cpio archives
|
||||||
|
Copyright (C) 2006 Ignacio Vazquez-Abrams """
|
||||||
|
|
||||||
|
@@ -54,7 +56,7 @@
|
||||||
|
"""Close this cpio entry. Further calls to methods will raise an
|
||||||
|
exception."""
|
||||||
|
self.closed=True
|
||||||
|
-
|
||||||
|
+
|
||||||
|
def flush(self):
|
||||||
|
"""Flush the entry (no-op)."""
|
||||||
|
pass
|
||||||
|
@@ -77,7 +79,7 @@
|
||||||
|
|
||||||
|
def seek(self, offset, whence=0):
|
||||||
|
"""Move to new position within an entry.
|
||||||
|
-
|
||||||
|
+
|
||||||
|
Keyword arguments:
|
||||||
|
offset -- Byte count
|
||||||
|
whence -- Describes how offset is used.
|
||||||
|
@@ -107,7 +109,7 @@
|
||||||
|
def open(name=None, mode='r', fileobj=None):
|
||||||
|
"""Open a cpio archive. Defers to CpioArchive.__init__()."""
|
||||||
|
return CpioArchive(name, mode, fileobj)
|
||||||
|
-
|
||||||
|
+
|
||||||
|
def __init__(self, name=None, mode='r', fileobj=None):
|
||||||
|
"""Open a cpio archive.
|
||||||
|
|
||||||
|
@@ -140,6 +142,9 @@
|
||||||
|
if not self.external:
|
||||||
|
self.file.close()
|
||||||
|
|
||||||
|
+ def __next__(self):
|
||||||
|
+ return self.next()
|
||||||
|
+
|
||||||
|
def next(self):
|
||||||
|
"""Return the next entry in the archive."""
|
||||||
|
if self.closed:
|
||||||
|
@@ -154,8 +159,8 @@
|
||||||
|
return iter(self._infos)
|
||||||
|
|
||||||
|
def _readfile(self, name):
|
||||||
|
- self._readobj(file(name, 'rb'))
|
||||||
|
-
|
||||||
|
+ self._readobj(open(name, 'rb'))
|
||||||
|
+
|
||||||
|
def _readobj(self, fileobj):
|
||||||
|
self.file=fileobj
|
||||||
|
start=self.file.tell()
|
||||||
|
@@ -168,7 +173,7 @@
|
||||||
|
if not ce.name=="TRAILER!!!":
|
||||||
|
self._infos.append(ce)
|
||||||
|
else:
|
||||||
|
- return
|
||||||
|
+ return
|
||||||
|
self.file.seek((4-(self.file.tell()-istart)%4)%4, 1)
|
||||||
|
self.file.seek(self._infos[-1].size, 1)
|
||||||
|
self.file.seek((4-(self.file.tell()-istart)%4)%4, 1)
|
@ -5,44 +5,57 @@
|
|||||||
|
|
||||||
Name: python-cpio
|
Name: python-cpio
|
||||||
Version: 0.1
|
Version: 0.1
|
||||||
Release: 18%{?dist}
|
Release: 19%{?dist}
|
||||||
Summary: A Python module for accessing cpio archives
|
Summary: A Python module for accessing cpio archives
|
||||||
|
|
||||||
Group: Development/Languages
|
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: http://developer.berlios.de/projects/python-cpio/
|
URL: http://developer.berlios.de/projects/python-cpio/
|
||||||
Source0: http://download.berlios.de/python-cpio/python-cpio-0.1.tar.bz2
|
Source0: http://download.berlios.de/python-cpio/python-cpio-0.1.tar.bz2
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
Patch0: cpioarchive_supports_2_3.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This is a Python module for accessing cpio archives.
|
This is a Python module for accessing cpio archives.
|
||||||
|
|
||||||
|
%package -n python3-cpio
|
||||||
|
Summary: A Python module for accessing cpio archives
|
||||||
|
|
||||||
|
%description -n python3-cpio
|
||||||
|
This is a Python module for accessing cpio archives.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch0
|
||||||
|
|
||||||
%build
|
%build
|
||||||
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
%py2_build
|
||||||
|
%py3_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
%py2_install
|
||||||
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
%py3_install
|
||||||
|
|
||||||
%clean
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%license COPYING.lib
|
||||||
%doc AUTHORS ChangeLog COPYING.lib README TODO
|
%doc AUTHORS ChangeLog README TODO
|
||||||
%{python_sitelib}/cpioarchive.py*
|
%{python_sitelib}/cpioarchive.py*
|
||||||
%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6
|
|
||||||
%{python_sitelib}/*.egg-info
|
%{python_sitelib}/*.egg-info
|
||||||
%endif
|
|
||||||
|
%files -n python3-cpio
|
||||||
|
%license COPYING.lib
|
||||||
|
%doc AUTHORS ChangeLog README TODO
|
||||||
|
%{python3_sitelib}/cpioarchive.py*
|
||||||
|
%{python3_sitelib}/__pycache__/*
|
||||||
|
%{python3_sitelib}/*.egg-info
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Aug 14 2015 José Matos <jamatos@fedoraproject.org> - 0.1-19
|
||||||
|
- Add python3 subpackage
|
||||||
|
|
||||||
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-18
|
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-18
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user