From 5ed2f39cb41c3a2b1d912053401d57c66563f078 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 2 Mar 2017 10:37:37 -0700 Subject: [PATCH] Move python libraries into python?- sub-packages Make python3 default for Fedora --- netcdf4-python.spec | 101 ++++++++++++++++++++++++-------------------- 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/netcdf4-python.spec b/netcdf4-python.spec index 14bc434..c1dcbe0 100644 --- a/netcdf4-python.spec +++ b/netcdf4-python.spec @@ -1,8 +1,6 @@ -%global with_python3 1 - Name: netcdf4-python Version: 1.2.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python/numpy interface to netCDF Group: Development/Languages @@ -24,30 +22,17 @@ BuildRequires: python-dateutil BuildRequires: python-ordereddict %endif BuildRequires: numpy -%if 0%{?with_python3} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-Cython BuildRequires: python%{python3_pkgversion}-dateutil BuildRequires: python%{python3_pkgversion}-numpy -%endif # if with_python3 BuildRequires: netcdf-devel - -# EL6 has python 2.6 and needs ordereddict -%if 0%{?rhel} && 0%{?rhel} <= 6 -Requires: python-ordereddict +# python3 is default in fedora, but not EPEL +%if 0%{?fedora} +Requires: python%{python3_pkgversion}-netcdf4 = %{version}-%{release} +%else +Requires: python2-netcdf4 = %{version}-%{release} %endif -Requires: Cython -Requires: numpy -Provides: python2-netcdf4 = %{version}-%{release} - -# 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 @@ -64,15 +49,41 @@ 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 +%package -n python2-netcdf4 Summary: Python/numpy interface to netCDF Group: Development/Languages -Requires: python%{python3_pkgversion}-Cython -Requires: python%{python3_pkgversion}-numpy -Provides: python%{python3_pkgversion}-netcdf4 = %{version}-%{release} +# EL6 has python 2.6 and needs ordereddict +%if 0%{?rhel} && 0%{?rhel} <= 6 +Requires: python-ordereddict +%endif +Requires: Cython +Requires: numpy +Provides: netcdf4-python2 = %{version}-%{release} -%description -n netcdf4-python3 +%description -n python2-netcdf4 +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. + + +%package -n python%{python3_pkgversion}-netcdf4 +Summary: Python/numpy interface to netCDF +Group: Development/Languages +Requires: python%{python3_pkgversion}-Cython +Requires: python%{python3_pkgversion}-numpy +Obsoletes: netcdf4-python%{python3_pkgversion} < 1.2.7-3 +Provides: netcdf4-python%{python3_pkgversion} = %{version}-%{release} + +%description -n python%{python3_pkgversion}-netcdf4 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 @@ -85,7 +96,6 @@ dimensions, groups and zlib data compression. All the new numeric data types 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 @@ -98,49 +108,48 @@ rm test/tst_dap.py %build %py2_build - -%if 0%{?with_python3} %py3_build -%endif # with_python3 %install -# 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} -%py3_install -rm $RPM_BUILD_ROOT%{_bindir}/* -%endif # with_python3 - +# python3 is default in fedora, but not EPEL +%if 0%{?fedora} %py2_install +%py3_install +%else +%py3_install +%py2_install +%endif %check cd test PYTHONPATH=$(echo ../build/lib.*%{python2_version}) %{__python2} run_all.py -%if 0%{?with_python3} PYTHONPATH=$(echo ../build/lib.*%{python3_version}) %{__python3} run_all.py -%endif %files %license COPYING -%doc Changelog docs examples README.md %{_bindir}/nc3tonc4 %{_bindir}/nc4tonc3 %{_bindir}/ncinfo -%{python_sitearch}/* -%if 0%{?with_python3} -%files -n netcdf4-python3 +%files -n python2-netcdf4 +%license COPYING +%doc Changelog docs examples README.md +%{python2_sitearch}/* + +%files -n python%{python3_pkgversion}-netcdf4 %license COPYING %doc Changelog docs examples README.md %{python3_sitearch}/* -%endif # with_python3 %changelog +* Thu Mar 2 2017 Orion Poplawski - 1.2-7-3 +- Move python libraries into python?- sub-packages +- Make python3 default for Fedora + * Fri Feb 10 2017 Fedora Release Engineering - 1.2.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild