%define _libdir64 %{_prefix}/lib64 Name: netcdf Version: 4.2 Release: 1 Summary: Libraries for the Unidata network Common Data Form Group: Applications/Engineering License: NetCDF URL: http://www.unidata.ucar.edu/software/netcdf/ Source0: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-%{version}.tar.gz # use pkgconfig in nc-config to avoid multi-lib issues Patch0: %{name}-pkgconfig.patch # required AIX 5.1 patches Patch1: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gawk, patch BuildRequires: curl-devel >= 7.19.7 BuildRequires: hdf5-devel >= 1.8.7 BuildRequires: zlib-devel >= 1.2.3 Requires: curl >= 7.19.7 Requires: hdf5 >= 1.8.7 Requires: zlib >= 1.2.3 %description NetCDF (network Common Data Form) is an interface for array-oriented data access and a freely-distributed collection of software libraries for C, Fortran, C++, and perl that provides an implementation of the interface. The NetCDF library also defines a machine-independent format for representing scientific data. Together, the interface, library, and format support the creation, access, and sharing of scientific data. The NetCDF software was developed at the Unidata Program Center in Boulder, Colorado. NetCDF data is: o Self-Describing: A NetCDF file includes information about the data it contains. o Network-transparent: A NetCDF file is represented in a form that can be accessed by computers with different ways of storing integers, characters, and floating-point numbers. o Direct-access: A small subset of a large dataset may be accessed efficiently, without first reading through all the preceding data. o Appendable: Data can be appended to a NetCDF dataset along one dimension without copying the dataset or redefining its structure. The structure of a NetCDF dataset can be changed, though this sometimes causes the dataset to be copied. o Sharable: One writer and multiple readers may simultaneously access the same NetCDF file. The library is available as 32-bit and 64-bit. %package devel Summary: Development files for netcdf Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config Requires: hdf5-devel >= 1.8.7 Requires: curl-devel >= 7.19.7 %description devel This package contains the netCDF header files, shared devel libs, and man pages. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "xlc_r -q64" or "gcc -maix64". %prep %setup -q export PATH=/opt/freeware/bin:$PATH %patch0 -p1 -b .pkgconfig %patch1 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh export CC="xlc_r" export CXX="xlC_r" export F77="xlf" export FC="xlf90" export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include -D_LARGE_FILES" export FCFLAGS="$FFLAGS" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-netcdf-4 \ --enable-dap \ --enable-extra-example-tests \ --disable-dap-remote-tests make %{?_smp_mflags} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared --disable-static \ --enable-netcdf-4 \ --enable-dap \ --enable-extra-example-tests \ --disable-dap-remote-tests make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 make install DESTDIR=${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects for f in cdf ; do /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libnet${f}.a ${RPM_BUILD_ROOT}%{_libdir64}/libnet${f}.so* done ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/COPYRIGHT 32bit/README %{_bindir}/nccopy* %{_bindir}/ncdump* %{_bindir}/ncgen* %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* %{_mandir}/man1/* /usr/bin/nccopy* /usr/bin/ncdump* /usr/bin/ncgen* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %{_bindir}/nc-config* %{_includedir}/netcdf.h %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/netcdf.pc %{_libdir64}/pkgconfig/netcdf.pc %{_mandir}/man3/* /usr/bin/nc-config* /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Thu Mar 22 2012 Michael Perzl - 4.2-1 - updated to version 4.2 * Tue Jul 19 2011 Michael Perzl - 4.1.3-1 - first version for AIX V5.1 and higher