%define _libdir64 %{_prefix}/lib64 Name: netcdf-cxx Version: 4.2 Release: 2 Summary: Legacy netCDF C++ library Group: Applications/Engineering License: NetCDF URL: http://www.unidata.ucar.edu/software/netcdf/ Source0: ftp://ftp.unidata.ucar.edu/pub/netcdf/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: netcdf-devel >= 4.3.3.1-1 Requires: netcdf >= 4.3.3.1-1 %description Legacy netCDF C++ library. This library is provided for backward compatibility only. New C++ development should be done with the netCDF CXX4 C++ library. %package devel Summary: Development files legacy netCDF C++ library Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: netcdf-devel >= 4.3.3.1-1 %description devel This package contains the legacy netCDF C++ library header files and shared devel library. %prep %setup -q 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 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 CXXFLAGS="$CFLAGS" 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} \ --infodir=%{_infodir} \ --enable-shared --disable-static 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} \ --infodir=%{_infodir} \ --enable-shared --disable-static 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 ../32bit export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install ( 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 ) rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir gzip --best ${RPM_BUILD_ROOT}%{_infodir}/*.info # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects for f in cdf_c++ ; 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 include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %post /sbin/install-info %{_infodir}/%{name}.info.gz \ %{_infodir}/dir 2>/dev/null || : %postun if [ "$1" = 0 ]; then /sbin/install-info --delete %{_infodir}/%{name}.info.gz \ %{_infodir}/dir 2>/dev/null || : fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %doc 32bit/COPYRIGHT 32bit/cxx/README %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %doc 32bit/examples 32bit/man4/%{name}.pdf %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_infodir}/%{name}.info* /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Tue Jan 05 2016 Michael Perzl - 4.2-2 - rebuilt against latest version of netcdf * Thu Jun 14 2012 Michael Perzl - 4.2-1 - first version for AIX V5.1 and higher