Пакет freecfd-complex: Specfile

%define oname freecfd
%define scalar_type complex
%define ldir %_libexecdir/petsc-%scalar_type
%define mpiimpl openmpi
%define mpidir %_libexecdir/%mpiimpl

Name: %oname-%scalar_type
Version: 0.1.2
Release: alt1
Summary: Computational fluid dynamics (CFD) code (%scalar_type scalars)

Group: Sciences/Mathematics
License: GPL v3 or later
URL: http://www.freecfd.com/
Source: free-cfd-%version.tar.gz
Source1: README.txt
Source2: fcfd
Packager: Eugeny A. Rostovtsev (REAL) <real at altlinux.org>

Requires: %oname-common = %version-%release
Requires: libcgns-mpi libhdf5-mpi

BuildPreReq: %mpiimpl-devel libhdf5-mpi-devel libcgns-mpi-devel
BuildPreReq: libpetsc-%scalar_type-devel

%description
Free CFD is an open source computational fluid dynamics (CFD) code.
Features:

* 3D Unstructured: Free CFD can handle arbitrary polyhedral, mixed
  element type 3D unstructured grids.
* Parallel: ParMETIS is used for domain decomposition. Open MPI is used
  as the message passing interface.
* All Speed: OK, we know that this is too general a statement but let's
  say that the code can handle a Mach number of 3 as well as a Mach
  number of 0.001
* Density Based: AUSM+-up and Roe convective flux functions are
  currently available.
* Implicit: A fully impicit framework with first order, backward Euler
  time integration.
* Second Order Spatial Accuracy: Linear MUSCL reconstruction of the cell
  variables provide second order accuracy.
* Turbulence Models: A number of turbulence models ranging from basic
  k-epsilon to Menter's SST (Shear Stress Transport) are available.

%package -n %oname-common
Summary: Scalar type independent files of Free CFD
Group: Sciences/Mathematics
BuildArch: noarch

%description -n %oname-common
Free CFD is an open source computational fluid dynamics (CFD) code.

This package contains scalar type independent files of Free CFD.

%package -n %oname-examples
Summary: Examples for Free CFD
Group: Documentation
BuildArch: noarch

%description -n %oname-examples
Free CFD is an open source computational fluid dynamics (CFD) code.

This package contains examples for Free CFD.

%prep
%setup
sed -i 's|@MPIDIR@|%mpidir|g' src/Makefile
install -m644 %SOURCE1 .

%build
source %_bindir/petsc-%scalar_type.sh
%make_build -C src

%install
source %_bindir/petsc-%scalar_type.sh
%makeinstall_std -C src

%if "%scalar_type" == "real"
install -d %buildroot%_bindir
install -m755 %SOURCE2 %buildroot%_bindir
%endif

%files
%doc README.txt doc/*
%ldir/bin/*

%if "%scalar_type" == "real"
%files -n %oname-common
%_bindir/*

%files -n %oname-examples
%doc examples/*
%endif

%changelog
* Sat Oct 24 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.1.2-alt1
- Initial build for Sisyphus