[python26-h5py/el5] First python26 package rhbz#730697
stevetraylen
stevetraylen at fedoraproject.org
Mon Jul 16 17:22:28 UTC 2012
commit c3a556e5e2fe133742a26d473fbf73ed0792ef69
Author: Steve Traylen <steve.traylen at cern.ch>
Date: Mon Jul 16 20:35:34 2012 +0200
First python26 package rhbz#730697
.gitignore | 1 +
h5py-1.3.1-system-lzf.patch | 34 +++++++++++++
python26-h5py.spec | 109 +++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
4 files changed, 145 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..b199464 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/h5py-1.3.1.tar.gz
diff --git a/h5py-1.3.1-system-lzf.patch b/h5py-1.3.1-system-lzf.patch
new file mode 100644
index 0000000..7bae078
--- /dev/null
+++ b/h5py-1.3.1-system-lzf.patch
@@ -0,0 +1,34 @@
+--- h5py-1.3.1.ORIG/lzf/lzf_filter.c 2011-05-22 22:20:02.488196039 +0200
++++ h5py-1.3.1.ORIG/lzf/lzf_filter.c 2011-05-22 23:09:49.235190001 +0200
+@@ -26,7 +26,7 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include "hdf5.h"
+-#include "lzf/lzf.h"
++#include "lzf.h"
+ #include "lzf_filter.h"
+
+ /* Our own versions of H5Epush_sim, as it changed in 1.8 */
+--- h5py-1.3.1.ORIG/setup.py 2011-05-22 22:20:02.487196131 +0200
++++ h5py-1.3.1.ORIG/setup.py 2011-05-22 23:10:46.158190215 +0200
+@@ -167,7 +167,7 @@
+ COMPILER_SETTINGS['library_dirs'] += [op.join(HDF5, 'dll')]
+ else:
+ COMPILER_SETTINGS = {
+- 'libraries' : ['hdf5'],
++ 'libraries' : ['hdf5','lzf'],
+ 'include_dirs' : [numpy.get_include(), localpath('lzf')],
+ 'library_dirs' : [],
+ 'define_macros' : [('H5_USE_16_API', None)]
+@@ -183,9 +183,7 @@
+ MODULES = ['h5', 'h5e', 'h5f', 'h5g', 'h5s', 'h5t', 'h5d', 'h5a', 'h5p', 'h5z',
+ 'h5i', 'h5r', 'h5fd', 'utils', 'h5o', 'h5l', '_conv', '_proxy']
+
+-EXTRA_SRC = {'h5': [ localpath("lzf/lzf_filter.c"),
+- localpath("lzf/lzf/lzf_c.c"),
+- localpath("lzf/lzf/lzf_d.c")]}
++EXTRA_SRC = {'h5': [ localpath("lzf/lzf_filter.c") ]}
+
+ def make_extension(module):
+ sources = [op.join('h5py', module+'.c')] + EXTRA_SRC.get(module, [])
+
diff --git a/python26-h5py.spec b/python26-h5py.spec
new file mode 100644
index 0000000..9e8b2f3
--- /dev/null
+++ b/python26-h5py.spec
@@ -0,0 +1,109 @@
+%global __python /usr/bin/python2.6
+%global python_sitearch %{_libdir}/python2.6/site-packages
+
+# Leave out documentation for now since python26
+# https://bugzilla.redhat.com/show_bug.cgi?id=662750
+%global with_doc 0
+# Fix byte-compilation:
+%global __os_install_post %{__python26_os_install_post}
+
+
+
+Summary: A Python interface to the HDF5 library
+Name: python26-h5py
+Version: 1.3.1
+Release: 5%{?dist}
+Group: Applications/Engineering
+License: BSD
+URL: http://h5py.alfven.org/
+Source0: http://h5py.googlecode.com/files/h5py-%{version}.tar.gz
+# patch to use a system liblzf rather than bundled liblzf
+Patch0: h5py-1.3.1-system-lzf.patch
+BuildRequires: python26-devel
+BuildRequires: python26-nose
+
+%if 0%{?with_doc}
+BuildRequires: python26-sphinx
+%endif
+BuildRequires: hdf5-devel >= 1.6
+BuildRequires: python26-numpy-devel >= 1.0.3
+BuildRequires: liblzf-devel
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: python26-numpy >= 1.0.3
+
+%{?filter_provides_in: %filter_provides_in .*/h5py/.*\.so}
+%{?filter_setup}
+
+%description
+The h5py package provides both a high- and low-level interface to the
+HDF5 library from Python. The low-level interface is intended to be a
+complete wrapping of the HDF5 API, while the high-level component
+supports access to HDF5 files, data sets and groups using established
+Python and NumPy concepts.
+
+A strong emphasis on automatic conversion between Python (Numpy)
+data types and data structures and their HDF5 equivalents vastly
+simplifies the process of reading and writing data from Python.
+
+%prep
+%setup -q -n h5py-%{version}
+# use system libzlf and remove private copy
+%patch0 -p1
+rm -rf lzf/lzf
+
+%build
+export CC="%{__cc}"
+export CFLAGS="%{optflags} -fno-strict-aliasing -fopenmp -llzf"
+%{__python} setup.py configure --hdf5=%{_libdir} --api=16
+%{__python} setup.py build
+# build docs
+%if 0%{?with_doc}
+dir=$(basename build/lib.linux-*)
+PYTHONPATH=$(pwd)/build/$dir make -C docs html
+rm -f docs/build/html/.buildinfo
+%endif
+
+%install
+rm -rf %{buildroot}
+%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+chmod 0755 %{buildroot}%{python_sitearch}/h5py/*.so
+
+%check
+%{__python} setup.py nosetests
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-, root, root, -)
+%doc README.txt LICENSE.txt h5py.egg-info licenses
+%if 0%{?with_doc}
+%doc docs/build/html
+%endif
+%{python_sitearch}/h5py/
+%{python_sitearch}/h5py-%{version}-*.egg-info/
+
+%changelog
+* Mon Aug 15 2011 Steve Traylen <steve.traylen at cern.ch> - 1.3.1-5
+- Create python26 package for EPEL5.
+
+* Mon May 23 2011 Terje Rosten <terje.rosten at ntnu.no> - 1.3.1-4
+- add patch from Steve Traylen (thanks!) to use system liblzf
+
+* Thu Jan 13 2011 Terje Rosten <terje.rosten at ntnu.no> - 1.3.1-3
+- fix buildroot
+- add filter
+- don't remove egg-info files
+- remove explicit hdf5 req
+
+* Sun Jan 2 2011 Terje Rosten <terje.rosten at ntnu.no> - 1.3.1-2
+- build and ship docs as html
+
+* Mon Dec 27 2010 Terje Rosten <terje.rosten at ntnu.no> - 1.3.1-1
+- 1.3.1
+- license is BSD only
+- run tests
+- new url
+
+* Sat Jul 3 2009 Joseph Smidt <josephsmidt at gmail.com> - 1.2.0-1
+- initial RPM release
diff --git a/sources b/sources
index e69de29..c8d1555 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+cfef84992d33910a06371dc35becb71b h5py-1.3.1.tar.gz
More information about the scm-commits
mailing list