[netcdf4-python] Initial import

Orion Poplawski orion at fedoraproject.org
Wed Sep 12 19:46:30 UTC 2012


commit 5541250ab8c1debc76f61dd638077097bcadbf81
Author: Orion Poplawski <orion at nwra.com>
Date:   Wed Sep 12 13:46:52 2012 -0600

    Initial import

 .gitignore                   |    1 +
 netcdf4-python-norpath.patch |   12 ++++
 netcdf4-python.spec          |  142 ++++++++++++++++++++++++++++++++++++++++++
 sources                      |    1 +
 4 files changed, 156 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..278ce1f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/netCDF4-1.0fix1.tar.gz
diff --git a/netcdf4-python-norpath.patch b/netcdf4-python-norpath.patch
new file mode 100644
index 0000000..bd73655
--- /dev/null
+++ b/netcdf4-python-norpath.patch
@@ -0,0 +1,12 @@
+diff -up netCDF4-1.0/setup.py.norpath netCDF4-1.0/setup.py
+--- netCDF4-1.0/setup.py.norpath	2012-05-12 08:04:26.000000000 -0600
++++ netCDF4-1.0/setup.py	2012-05-23 16:38:16.376417441 -0600
+@@ -163,7 +163,7 @@ NETCDF4_DIR environment variable not set
+         lib_dirs.append(szip_libdir)
+         inc_dirs.append(szip_incdir)
+ 
+-extensions = [Extension("netCDF4",["netCDF4.c"],libraries=libs,library_dirs=lib_dirs,include_dirs=inc_dirs,runtime_library_dirs=lib_dirs)]
++extensions = [Extension("netCDF4",["netCDF4.c"],libraries=libs,library_dirs=lib_dirs,include_dirs=inc_dirs)]
+ 
+ setup(name = "netCDF4",
+   version = "1.0",
diff --git a/netcdf4-python.spec b/netcdf4-python.spec
new file mode 100644
index 0000000..81136e5
--- /dev/null
+++ b/netcdf4-python.spec
@@ -0,0 +1,142 @@
+%if 0%{?fedora} > 12 || 0%{?rhel} > 6
+%global with_python3 1
+%else
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%endif
+
+%global srcname distribute
+
+Name:           netcdf4-python
+Version:        1.0
+Release:        1.fix1%{?dist}
+Summary:        Python/numpy interface to netCDF
+
+Group:          Development/Languages
+License:        MIT
+URL:            http://code.google.com/p/netcdf4-python/
+Source0:        http://netcdf4-python.googlecode.com/files/netCDF4-%{version}fix1.tar.gz
+# No rpath for library
+Patch0:         netcdf4-python-norpath.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires:  python2-devel
+BuildRequires:  numpy
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-numpy
+%endif # if with_python3
+BuildRequires:  netcdf-devel
+
+Requires:       numpy
+
+# we don't want to provide private python extension libs
+%{?filter_setup:
+%filter_provides_in %{python_sitearch}/.*\.so$ 
+%if 0%{?with_python3}
+%filter_provides_in %{python3_sitearch}/.*\.so$ 
+%endif # if with_python3
+%filter_setup
+}
+
+%description
+netCDF version 4 has many features not found in earlier versions of the
+library and is implemented on top of HDF5. This module can read and write
+files in both the new netCDF 4 and the old netCDF 3 format, and can create
+files that are readable by HDF5 clients. The API modeled after
+Scientific.IO.NetCDF, and should be familiar to users of that module.
+
+Most new features of netCDF 4 are implemented, such as multiple unlimited
+dimensions, groups and zlib data compression. All the new numeric data types
+(such as 64 bit and unsigned integer types) are implemented. Compound and
+variable length (vlen) data types are supported, but the enum and opaque data
+types are not. Mixtures of compound and vlen data types (compound types
+containing vlens, and vlens containing compound types) are not supported.
+
+
+%if 0%{?with_python3}
+%package -n netcdf4-python3
+Summary:        Python/numpy interface to netCDF
+Group:          Development/Languages
+Requires:       python3-numpy
+
+%description -n netcdf4-python3
+netCDF version 4 has many features not found in earlier versions of the
+library and is implemented on top of HDF5. This module can read and write
+files in both the new netCDF 4 and the old netCDF 3 format, and can create
+files that are readable by HDF5 clients. The API modeled after
+Scientific.IO.NetCDF, and should be familiar to users of that module.
+
+Most new features of netCDF 4 are implemented, such as multiple unlimited
+dimensions, groups and zlib data compression. All the new numeric data types
+(such as 64 bit and unsigned integer types) are implemented. Compound and
+variable length (vlen) data types are supported, but the enum and opaque data
+types are not. Mixtures of compound and vlen data types (compound types
+containing vlens, and vlens containing compound types) are not supported.
+%endif # with_python3
+
+
+%prep
+%setup -q -n netCDF4-%{version}
+%patch0 -p1 -b .norpath
+
+%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|#!%{__python}|'
+
+
+%build
+CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
+popd
+%endif # with_python3
+
+
+%install
+rm -rf $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
+rm $RPM_BUILD_ROOT%{_bindir}/*
+popd
+%endif # with_python3
+
+%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
+
+ 
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%doc Changelog COPYING docs examples README
+%{_bindir}/nc3tonc4
+%{_bindir}/nc4tonc3
+%{python_sitearch}/*
+
+%if 0%{?with_python3}
+%files -n netcdf4-python3
+%doc Changelog COPYING docs examples README
+%{python3_sitearch}/*
+%endif # with_python3
+
+
+%changelog
+* Thu May 24 2012 Orion Poplawski <orion at cora.nwra.com> - 1.0-1.fix1
+- Update to 1.0fix1
+
+* Thu Apr 5 2012 Orion Poplawski <orion at cora.nwra.com> - 0.9.9-1
+- Update to 0.9.9
+
+* Thu Sep 8 2011 Orion Poplawski <orion at cora.nwra.com> - 0.9.7-1
+- Initial package
diff --git a/sources b/sources
index e69de29..d7aefeb 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+9200f66aa48ce8dc257db5b4b2cf0512  netCDF4-1.0fix1.tar.gz


More information about the scm-commits mailing list