Package Xdmf: Specfile

%define mpiimpl openmpi
%define mpidir %_libexecdir/%mpiimpl

Name: Xdmf
Version: 20100923
Release: alt6
Summary: eXtensible Data Model and Format
License: Free
Group: Sciences/Other
Url: http://www.xdmf.org/index.php/Main_Page
Packager: Eugeny A. Rostovtsev (REAL) <real at altlinux.org>

# cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/Xdmf login
# (respond with password xdmf)
# cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/Xdmf checkout Xdmf
Source: %name-%version.tar
Source1: CMakeCache.txt

BuildPreReq: libexpat-devel libvtk-devel python-devel %mpiimpl-devel
BuildPreReq: libhdf5-mpi-devel zlib-devel bzlib-devel cmake
BuildPreReq: libX11-devel libICE-devel libXtst-devel libXau-devel
BuildPreReq: libXcomposite-devel libXcursor-devel libXdamage-devel
BuildPreReq: libXdmcp-devel libXext-devel libXfixes-devel libXi-devel
BuildPreReq: libXft-devel libXinerama-devel libXrandr-devel
BuildPreReq: libXrender-devel libXt-devel libXpm-devel libXv-devel
BuildPreReq: libXxf86misc-devel flex libxml2-devel libmetis-devel
BuildPreReq: libmysqlclient-devel libvtk-python-devel libvtk-tcl-devel
BuildPreReq: libpq5.3-devel libjpeg-devel libtiff-devel qt4-devel
BuildPreReq: libOSMesa-devel vtk-python tcl-devel tk-devel
BuildPreReq: libgomp-devel libexodusii-devel libnetcdf-mpi-devel

Requires: lib%name = %version-%release

%description
The need for a standardized method to exchange scientific data between
High Performance Computing codes and tools lead to the development of
the eXtensible Data Model and Format (XDMF) . Uses for XDMF range from a
standard format used by HPC codes to take advantage of widely used
visualization programs like ParaView, to a mechanism for performing
coupled calculations using multiple, previously stand alone codes.

%package -n lib%name
Summary: Shared libraries of XDMF
Group: System/Libraries

%description -n lib%name
The need for a standardized method to exchange scientific data between
High Performance Computing codes and tools lead to the development of
the eXtensible Data Model and Format (XDMF) . Uses for XDMF range from a
standard format used by HPC codes to take advantage of widely used
visualization programs like ParaView, to a mechanism for performing
coupled calculations using multiple, previously stand alone codes.

This package contains shared libraries of XDMF.

%package devel
Summary: Development files of XDMF
Group: Development/C++
BuildArch: noarch
Requires: lib%name = %version-%release
Requires: libvtk-devel

%description devel
The need for a standardized method to exchange scientific data between
High Performance Computing codes and tools lead to the development of
the eXtensible Data Model and Format (XDMF) . Uses for XDMF range from a
standard format used by HPC codes to take advantage of widely used
visualization programs like ParaView, to a mechanism for performing
coupled calculations using multiple, previously stand alone codes.

This package contains development files of XDMF.

%package -n python-module-%name
Summary: Python module of XDMF
Group: Development/Python
Requires: lib%name = %version-%release

%description -n python-module-%name
The need for a standardized method to exchange scientific data between
High Performance Computing codes and tools lead to the development of
the eXtensible Data Model and Format (XDMF) . Uses for XDMF range from a
standard format used by HPC codes to take advantage of widely used
visualization programs like ParaView, to a mechanism for performing
coupled calculations using multiple, previously stand alone codes.

This package contains Python module of XDMF.

%package data
Summary: Data files for XDMF
Group: Sciences/Other
BuildArch: noarch

%description data
The need for a standardized method to exchange scientific data between
High Performance Computing codes and tools lead to the development of
the eXtensible Data Model and Format (XDMF) . Uses for XDMF range from a
standard format used by HPC codes to take advantage of widely used
visualization programs like ParaView, to a mechanism for performing
coupled calculations using multiple, previously stand alone codes.

This package contains data files for XDMF.

%package examples
Summary: Examples for XDMF
Group: Development/Documentation
BuildArch: noarch

%description examples
The need for a standardized method to exchange scientific data between
High Performance Computing codes and tools lead to the development of
the eXtensible Data Model and Format (XDMF) . Uses for XDMF range from a
standard format used by HPC codes to take advantage of widely used
visualization programs like ParaView, to a mechanism for performing
coupled calculations using multiple, previously stand alone codes.

This package contains examples for XDMF.

%prep
%setup
install -p -m644 %SOURCE1 .

%build
mpi-selector --set %mpiimpl
source %mpidir/bin/mpivars.sh

cmake .
%make_build verbose=1

%install
source %mpidir/bin/mpivars.sh
%makeinstall_std

install -d %buildroot%_libexecdir/vtk-5.6/CMake
mv %buildroot%prefix/vtk/* %buildroot%_libexecdir/vtk-5.6/CMake/
mv %buildroot%_libexecdir/XdmfCMake/* \
	%buildroot%_libexecdir/vtk-5.6/CMake/
rmdir %buildroot%_libexecdir/XdmfCMake
ln -s %_libexecdir/vtk-5.6/CMake %buildroot%_libexecdir/XdmfCMake

%ifarch x86_64
install -d %buildroot%_libdir
mv %buildroot%_libexecdir/*.so %buildroot%_libdir/
install -d %buildroot%python_sitelibdir
mv %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/
%endif

install -d %buildroot%_datadir/%name
cp -fR Data/Data/* %buildroot%_datadir/%name/

rm -f $(find Examples -name '*.o')

%files
%_bindir/*

%files -n lib%name
%_libdir/*.so

%files devel
%_includedir/*
%_libexecdir/vtk-5.6/CMake/*
%_libexecdir/XdmfCMake

%files -n python-module-%name
%python_sitelibdir/*

%files data
%_datadir/%name

%files examples
%doc Examples/*

%changelog
* Sun Apr 24 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 20100923-alt6
- Rebuilt with libnetcdf7-mpi

* Fri Apr 22 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 20100923-alt5
- Rebuilt with VTK 5.6.1

* Tue Mar 01 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 20100923-alt4
- Rebuilt for debuginfo

* Fri Feb 25 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 20100923-alt3
- Rebuilt with metis 4.0.1-alt9

* Mon Nov 08 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 20100923-alt2
- Rebuilt with PostgreSQL 9

* Fri Sep 24 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 20100923-alt1
- Initial build for Sisyphus