[python-blist/el6] Update to 1.3.6

Michel Alexandre Salim salimma at fedoraproject.org
Mon May 12 08:31:08 UTC 2014


commit 1f3681eb9e6f6514fb8b9d3ee64057ae4a42c409
Author: Michel Alexandre Salim <salimma at fedoraproject.org>
Date:   Thu May 8 14:26:01 2014 +0700

    Update to 1.3.6
    
    - Build for Python 3 as well on supported releases
    
    (cherry picked from commit db6ee535220c43c9745ba47f7816b9f5f5b31c54)

 .gitignore                           |    2 +-
 blist-1.2.1-use-sys-setuptools.patch |   11 ---
 python-blist.spec                    |  122 +++++++++++++++++++++++++++-------
 sources                              |    2 +-
 4 files changed, 99 insertions(+), 38 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3908da6..068b5c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/blist-1.3.4.tar.gz
+/blist-1.3.6.tar.gz
diff --git a/python-blist.spec b/python-blist.spec
index 6ac2df0..1cb449e 100644
--- a/python-blist.spec
+++ b/python-blist.spec
@@ -1,7 +1,16 @@
-%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
 
-Name:           python-blist
-Version:        1.3.4
+%if 0%{?fedora}
+%global with_python3 1
+%endif
+
+%global srcname blist
+
+Name:           python-%{srcname}
+Version:        1.3.6
 Release:        1%{?dist}
 Summary:        A faster list implementation for Python
 
@@ -9,59 +18,122 @@ Group:          Development/Languages
 License:        BSD
 URL:            http://pypi.python.org/pypi/blist/
 Source0:        http://pypi.python.org/packages/source/b/blist/blist-%{version}.tar.gz
-Patch0:		blist-1.2.1-use-sys-setuptools.patch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+#Patch0:                blist-1.2.1-use-sys-setuptools.patch
 
-BuildRequires:  python-devel python-setuptools
+BuildRequires:  python2-devel
+BuildRequires:  python-setuptools
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:	python3-setuptools
+%endif # if with_python3
 
 %description
-The BList is a type that looks, acts, and quacks like a Python list,
-but has better performance for for modifying large lists.
+The blist is a drop-in replacement for the Python list that provides
+better performance when modifying large lists. The blist package also
+provides sortedlist, sortedset, weaksortedlist, weaksortedset,
+sorteddict, and btuple types.
+
+Python's built-in list is a dynamically-sized array; to insert or
+remove an item from the beginning or middle of the list, it has to
+move most of the list in memory, i.e., O(n) operations. The blist uses
+a flexible, hybrid array/tree structure and only needs to move a small
+portion of items in memory, specifically using O(log n) operations.
+
+For small lists, the blist and the built-in list have virtually
+identical performance.
+
+%if 0%{?with_python3}
+%package -n python3-%{srcname}
+Summary:        A faster list implementation for Python
 
-For small lists (fewer than 128 elements), BLists and the built-in
-list have very similar performance, although BLists are memory
-inefficient if you need to create a larger number of small lists.
+%description -n python3-%{srcname}
+The blist is a drop-in replacement for the Python list that provides
+better performance when modifying large lists. The blist package also
+provides sortedlist, sortedset, weaksortedlist, weaksortedset,
+sorteddict, and btuple types.
 
+Python's built-in list is a dynamically-sized array; to insert or
+remove an item from the beginning or middle of the list, it has to
+move most of the list in memory, i.e., O(n) operations. The blist uses
+a flexible, hybrid array/tree structure and only needs to move a small
+portion of items in memory, specifically using O(log n) operations.
+
+For small lists, the blist and the built-in list have virtually
+identical performance.
+%endif # with_python3
 
 %prep
-%setup -q -n blist-%{version}
-%patch0 -p1 -b .use-sys-setuptools
+%setup -q -n %{srcname}-%{version}
+#patch0 -p1 -b .use-sys-setuptools
 
 # Replace the not-zip-safe file; keep rpmlint happy by not having
 # CRLF line endings
-echo > not-zip-safe
-touch -r blist.egg-info/not-zip-safe not-zip-safe
-rm blist.egg-info/not-zip-safe
+#echo > not-zip-safe
+#touch -r blist.egg-info/not-zip-safe not-zip-safe
+#rm blist.egg-info/not-zip-safe
 # egg-info files should not be executables
-chmod -x blist.egg-info/*
+# chmod -x blist.egg-info/*
 # Move the new not-zip-safe file back
-mv not-zip-safe blist.egg-info/
+# mv not-zip-safe blist.egg-info/
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif # with_python3
 
+find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
 
 %build
-CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %{__python} setup.py build
+CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %{__python2} setup.py build
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %{__python3} setup.py build
+popd
+%endif # with_python3
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+# Must do the python3 install first because the scripts in /usr/bin are
+# overwritten with every setup.py install (and we want the python2 version
+# to be the default for now).
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
+popd
+%endif # with_python3
+
+%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
 
  
 %check
-%{__python} setup.py test
+%{__python2} setup.py test
 
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+%endif # with_python3
 
 
 %files
 %defattr(-,root,root,-)
 %doc LICENSE README.rst
-%{python_sitearch}/*
+%{python2_sitearch}/*
+
+%if 0%{?with_python3}
+%files -n python3-%{srcname}
+%doc LICENSE README.rst
+%{python3_sitearch}/*
+%endif # with_python3
 
 
 %changelog
+* Thu May  8 2014 Michel Salim <salimma at fedoraproject.org> - 1.3.6-1
+- Update to 1.3.6
+- Build for Python 3 as well on supported releases
+
 * Sat Jul  2 2011 Michel Salim <salimma at fedoraproject.org> - 1.3.4-1
 - Update to 1.3.4
 
diff --git a/sources b/sources
index b4b6247..9680ca7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-02e8bf33cffec9cc802f4567f39ffa6f  blist-1.3.4.tar.gz
+a538f1a24b9191e3c40252e9397408a9  blist-1.3.6.tar.gz


More information about the scm-commits mailing list