- add Python 3 subpackage
This commit is contained in:
Terje Rsten 2012-12-06 19:29:13 +01:00
parent 494cde6385
commit 2aab3ac209
4 changed files with 82 additions and 20 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/h5py-1.3.1.tar.gz
/h5py-2.0.1.tar.gz
/h5py-2.1.0.tar.gz

View File

@ -12,26 +12,27 @@ index c6dd4b0..08579a7 100644
/* Our own versions of H5Epush_sim, as it changed in 1.8 */
diff --git a/setup.py b/setup.py
index dc6d6ac..dddb95e 100644
index c939133..4ffc6fe 100644
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@ if sys.platform.startswith('win'):
COMPILER_SETTINGS['library_dirs'] += [op.join(HDF5, 'dll')]
else:
COMPILER_SETTINGS = {
- 'libraries' : ['hdf5'],
+ 'libraries' : ['hdf5', 'lzf'],
- 'libraries' : ['hdf5', 'hdf5_hl'],
+ 'libraries' : ['hdf5', 'hdf5_hl', 'lzf'],
'include_dirs' : [numpy.get_include(), localpath('lzf')],
'library_dirs' : [],
'define_macros' : [('H5_USE_16_API', None)]
@@ -77,9 +77,7 @@ MODULES = ['defs','_errors','_objects','_proxy', 'h5fd', 'h5z',
'h5d', 'h5a', 'h5f', 'h5g',
'h5l', 'h5o']
@@ -78,9 +78,8 @@ MODULES = ['defs','_errors','_objects','_proxy', 'h5fd', 'h5z',
'h5l', 'h5o',
'h5ds']
-EXTRA_SRC = {'h5z': [ localpath("lzf/lzf_filter.c"),
-EXTRA_SRC = {'h5z': [ localpath("lzf/lzf_filter.c"),
- localpath("lzf/lzf/lzf_c.c"),
- localpath("lzf/lzf/lzf_d.c")]}
+EXTRA_SRC = {'h5z': [ localpath("lzf/lzf_filter.c")]}
+
def make_extension(module):
sources = [op.join('h5py', module+SUFFIX)] + EXTRA_SRC.get(module, [])

View File

@ -1,25 +1,34 @@
# TODO: enable tests
%global with_python3 1
%{?filter_provides_in: %filter_provides_in .*/h5py/.*\.so}
%{?filter_setup}
# TODO: py3 support + enable tests
Summary: A Python interface to the HDF5 library
Name: h5py
Version: 2.0.1
Release: 2%{?dist}
Version: 2.1.0
Release: 1%{?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-2.0.1-system-lzf.patch
Patch0: h5py-2.1.0-system-lzf.patch
BuildRequires: liblzf-devel
BuildRequires: hdf5-devel >= 1.8.3
BuildRequires: python-devel >= 2.6
BuildRequires: python-sphinx
BuildRequires: hdf5-devel >= 1.8.3
BuildRequires: numpy >= 1.0.3
BuildRequires: liblzf-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?with_python3}
BuildRequires: python-tools
BuildRequires: python3-devel >= 3.2
# FC > 16
BuildRequires: python3-sphinx
BuildRequires: python3-numpy >= 1.0.3
%endif
Requires: numpy >= 1.0.3
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
The h5py package provides both a high- and low-level interface to the
@ -32,36 +41,87 @@ 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.
%if 0%{?with_python3}
%package -n python3-h5py
Summary: A Python 3 interface to the HDF5 library
Group: Applications/Engineering
Requires: python3-numpy >= 1.0.3
%description -n python3-h5py
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.
This is the Python 3 version of h5py.
%endif
%prep
%setup -q
# use system libzlf and remove private copy
%patch0 -p1
rm -rf lzf/lzf
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
export CFLAGS="%{optflags} -fopenmp -llzf"
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
chmod 0755 %{buildroot}%{python_sitearch}/%{name}/*.so
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
chmod 0755 %{buildroot}%{python3_sitearch}/%{name}/*.so
%endif
%check
#{__python} setup.py test
#{__python} setup.py test || :
%if 0%{?with_python3}
#pushd %{py3dir}
#{__python3} setup.py test || :
%endif
%clean
rm -rf %{buildroot}
%files
%defattr(-, root, root, -)
%doc ANN.txt README.txt
%doc ANN.txt README.txt examples
%{python_sitearch}/%{name}/
%{python_sitearch}/%{name}-%{version}-*.egg-info
%if 0%{?with_python3}
%files -n python3-h5py
%defattr(-, root, root, -)
%doc ANN.txt README.txt
%{python3_sitearch}/%{name}/
%{python3_sitearch}/%{name}-%{version}-*.egg-info
%endif
%changelog
* Thu Dec 06 2012 Terje Rosten <terje.rosten@ntnu.no> - 2.1.0-1
- 2.1.0
- add Python 3 subpackage
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
- rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Jan 24 2012 Terje Rosten <terje.rosten@ntnu.no> - 2.0.1-1
- 2.0.1
@ -69,7 +129,7 @@ rm -rf %{buildroot}
- rebase patch
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
- rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon May 23 2011 Terje Rosten <terje.rosten@ntnu.no> - 1.3.1-4
- add patch from Steve Traylen (thanks!) to use system liblzf

View File

@ -1 +1 @@
ea271f5cc8a78a531316918906aacdd0 h5py-2.0.1.tar.gz
a6f0d15cc5e51c322479822f5cc6c1d6 h5py-2.1.0.tar.gz