Package libhdf5: Specfile

#libtool: compile: unable to infer tagged configuration
#libtool: compile: specify a tag with `--tag'
#make[3]: *** [H5IdComponent.lo] Error 1

#TODO: examples packing

%define oname hdf5
Name: lib%oname
Version: 1.6.6
Release: alt2

Summary: Hierarchical Data Format 5 library

Group: System/Libraries
License: Nearly BSD, but changed sources must be marked
Url: http://hdf.ncsa.uiuc.edu/HDF5/

Packager: Vitaly Lipatov <lav@altlinux.ru>

Source: ftp://ftp.hdfgroup.org/HDF5/current/src/%oname-%version.tar.bz2
Patch0: %oname-config.patch
Patch1: %oname-sig.patch
Patch2: %oname-link.patch
Patch3: %oname-gcc43.patch

# Automatically added by buildreq on Sat Sep 15 2007
BuildRequires: gcc-c++ libssl-devel zlib-devel

%description
HDF5 is a completely new Hierarchical Data Format product consisting
of a data format specification and a supporting library
implementation. HDF5 is designed to address some of the limitations of
the older HDF product and to address current and anticipated
requirements of modern systems and applications.

%package devel
Summary: HDF5 library development package
Group: Development/C
Requires: %name = %version-%release

%description devel
Header files for HDF5 library.

%package devel-doc
Summary: HDF5 library documentation package
Group: Development/C

%description devel-doc
HDF5 documentation.

%prep
%setup -q -n %oname-%version
%patch0 -p1
%patch1 -p1
%patch2
%patch3 -p1

%build
%__libtoolize
%__aclocal
%__autoconf
cd c++
%__aclocal
%__autoconf
cd ..
%configure \
	--enable-cxx \
	--enable-linux-lfs \
	--enable-threadsafe \
	--enable-production \
	--with-pthread \
	--disable-static \
	--with-ssl \
	--with-szlib

#	--enable-fortran  - requires Fortran90 compiler
%__subst "s|^LT=.*|LT=../libtool|g" c++/src/Makefile c++/test/Makefile
%make_build

%install
export LD_LIBRARY_PATH="../src/.libs"
install -d %buildroot%_includedir

%make_install install \
	libdir=%buildroot%_libdir \
	includedir=%buildroot%_includedir \
	bindir=%buildroot%_bindir \
	docdir=%buildroot%_docdir

find doc -name Dependencies -o -name Makefile\* | xargs rm -f

#mv %buildroot%_docdir/%oname/examples %buildroot%_docdir/%name-devel-%version/
rm -rf %buildroot%_docdir/%oname/

%post -p %post_ldconfig
%postun -p %post_ldconfig

%files
%_bindir/*
%doc COPYING README.txt release_docs/{HISTORY.txt,RELEASE.txt}
%_libdir/libhdf5.so.*
%_libdir/libhdf5_cpp.so.*
%_libdir/libhdf5_hl.so.*
# used to show configuration at runtime
%_libdir/libhdf5.settings
#%_libdir/libhdf5_cpp.settings

%files devel
%_libdir/libhdf5.so
%_libdir/libhdf5_cpp.so
%_libdir/libhdf5_hl.so
#%_libdir/libhdf5.la
#%_libdir/libhdf5_cpp.la
#%_libdir/libhdf5_hl.la
%_includedir/*.h

%files devel-doc
%doc doc/html
#%doc examples

%changelog
* Sun Dec 14 2008 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.6.6-alt2
- fixed build with gcc4.3

* Sat Sep 15 2007 Vitaly Lipatov <lav@altlinux.ru> 1.6.6-alt1
- initial build for ALT Linux Sisyphus