Пакет petscfem-complex: Specfile

%define gver 4.9
%set_gcc_version %gver

%define mpiimpl openmpi
%define mpidir %_libdir/%mpiimpl

%define scalar_type complex
%define ldir %_libdir/petsc-%scalar_type

%define oname petscfem
%define somver 0
%define sover %somver.0.0

Name: %oname-%scalar_type
Version: 3.53.1
Release: alt15
Summary: A General Purpose, Parallel, Multi-Physics FEM Program (%scalar_type scalars)
License: GPL v2+
Group: Sciences/Mathematics
Url: http://www.cimec.org.ar/petscfem
Packager: Eugeny A. Rostovtsev (REAL) <real at altlinux.org>

Source: %oname-%version.tar
Source1: mstorti.sty

BuildPreReq: libpetsc-%scalar_type-devel %mpiimpl-devel liblapack-devel
BuildPreReq: libnewmat-devel libparmetis0-devel libsuperlu-devel
BuildPreReq: libann-devel glib2-devel libopendx-devel libmetis0-devel
BuildPreReq: liblibretto-devel libmeschach-devel libscotch-devel
BuildPreReq: texlive-extra-utils svg2pdf latex2html doc++
BuildPreReq: libhypre-devel-doc ghostscript-utils chrpath
BuildPreReq: libtrilinos-devel libgaleri-devel c2html
BuildPreReq: transfig tgif rpm-macros-make perl-devel
BuildPreReq: libdakota-devel perl-podlators
BuildPreReq: gcc%gver-c++

Requires: lib%name = %version-%release

%description
This is PETSc-FEM, a general purpose, parallel, multi-physics FEM
(Finite Element Method) program for CFD (Computational Fluid Dynamics)
applications based on PETSc . PETSc-FEM comprises both a library that
allows the user to develop FEM (or FEM-like, i.e. non-structured mesh
oriented) programs, and a suite of application programs. It is written
in the C++ language with an OOP (Object Oriented Programming)
philosophy, keeping in mind the scope of efficiency.

%package -n lib%name
Summary: Shared library of PETSc-FEM (%scalar_type scalars)
Group: System/Libraries

%description -n lib%name
This is PETSc-FEM, a general purpose, parallel, multi-physics FEM
(Finite Element Method) program for CFD (Computational Fluid Dynamics)
applications based on PETSc . PETSc-FEM comprises both a library that
allows the user to develop FEM (or FEM-like, i.e. non-structured mesh
oriented) programs, and a suite of application programs. It is written
in the C++ language with an OOP (Object Oriented Programming)
philosophy, keeping in mind the scope of efficiency.

This package contains shared library of PETSc-FEM.

%package -n lib%name-devel
Summary: Development files of PETSc-FEM (%scalar_type scalars)
Group: Development/C++
Requires: lib%name = %version-%release
Requires: libpetsc-%scalar_type-devel

%description -n lib%name-devel
This is PETSc-FEM, a general purpose, parallel, multi-physics FEM
(Finite Element Method) program for CFD (Computational Fluid Dynamics)
applications based on PETSc . PETSc-FEM comprises both a library that
allows the user to develop FEM (or FEM-like, i.e. non-structured mesh
oriented) programs, and a suite of application programs. It is written
in the C++ language with an OOP (Object Oriented Programming)
philosophy, keeping in mind the scope of efficiency.

This package contains development files of PETSc-FEM.

%package -n %oname-docs
Summary: Documentation for PETSc-FEM
Group: Documentation
BuildArch: noarch

%description -n %oname-docs
This is PETSc-FEM, a general purpose, parallel, multi-physics FEM
(Finite Element Method) program for CFD (Computational Fluid Dynamics)
applications based on PETSc . PETSc-FEM comprises both a library that
allows the user to develop FEM (or FEM-like, i.e. non-structured mesh
oriented) programs, and a suite of application programs. It is written
in the C++ language with an OOP (Object Oriented Programming)
philosophy, keeping in mind the scope of efficiency.

This package contains development files of PETSc-FEM.

%prep
%setup
install -m644 %SOURCE1 doc
ln -s ../index.tex doc/manual
ln -s /usr/share/doc/libhypre-devel-doc/docxx.sty doc/manual

%build
source %_bindir/petsc-%scalar_type.sh
export OMPI_LDFLAGS="-Wl,--as-needed,-rpath,%mpidir/lib:%ldir/lib -L%mpidir/lib -L%ldir/lib"
export MPIDIR=%mpidir

%add_optflags -I%_includedir/openblas -fpermissive
%make_ext -C src amplidl.o
for i in depend libpetscfem; do
	%make_ext $i SOMVER=%somver SOVER=%sover
done
%make_ext all \
	SOMVER=%somver SOVER=%sover \
	PERL_DIR=%perl_vendor_archlib/CORE

%if "%scalar_type" == "real"
%make_build -C doc
#make_build -C doc/manual ps
#export C2HTML=c2html
#make_build -C doc/manual man_html
%endif

%install
source %_bindir/petsc-%scalar_type.sh
install -d %buildroot%ldir/bin
install -d %buildroot%ldir/lib
install -d %buildroot%ldir/include/%name

install -m755 applications/*/*.bin %buildroot%ldir/bin

install -m644 *.so.* %buildroot%ldir/lib
ln -s lib%oname.so.%sover %buildroot%ldir/lib/lib%oname.so.%somver
ln -s lib%oname.so.%somver %buildroot%ldir/lib/lib%oname.so

install -p -m644 src/*.h %buildroot%ldir/include/%name

for i in %buildroot%ldir/bin/* %buildroot%ldir/lib/*.so; do
	chrpath -r %mpidir/lib:$PETSC_DIR/lib $i
done

%files
%doc README* PROJECTS TODO
%ldir/bin/*

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

%files -n lib%name-devel
%ldir/lib/*.so
%ldir/include/*

#if "%scalar_type" == "real"
#files -n %oname-docs
#doc doc/*.pdf doc/OBJ/*.pdf doc/manual/html
#doc doc/OBJ/*.pdf
#endif

%changelog
* Thu Apr 30 2015 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt15
- Rebuilt with gcc 4.9

* Tue Jul 08 2014 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt14
- Fixed build

* Tue Mar 04 2014 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt13
- Built with gcc 4.7

* Wed Nov 06 2013 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt12
- Fixed build

* Mon Jul 15 2013 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt11
- Version 3.53.1

* Tue May 07 2013 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt10.beta
- Fixed build

* Fri Feb 08 2013 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt9.beta
- New snapshot

* Wed Oct 10 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt8.beta
- Rebuilt with gc 4.7

* Tue Sep 11 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt7.beta
- Fixed build

* Mon Aug 13 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt6.beta
- New snapshot

* Sun Aug 12 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt5.beta
- Built with OpenBLAS instead of GotoBLAS2

* Sat Jul 07 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt4.beta
- Rebuilt with OpenMPI 1.6

* Wed Dec 14 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt3.beta
- Fixed RPATH

* Sat Dec 10 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt2.beta
- New snapshot

* Sat Nov 05 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt1.beta.7
- Rebuilt with perl 5.14.2

* Wed Sep 14 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt1.beta.6
- Rebuilt with libparmetis0 instead of libparmetis

* Sun Sep 11 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt1.beta.5
- Rebuilt with metis 5.0.1

* Thu May 05 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt1.beta.4
- New snapshot

* Wed Apr 13 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt1.beta.3
- Built with GotoBLAS instead of ATLAS

* Tue Mar 08 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt1.beta.2
- Rebuilt for debuginfo

* Sat Feb 26 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt1.beta.1
- Rebuilt with parmetis 3.1.1-alt10

* Fri Dec 17 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.53.1-alt1.beta
- Initial build for Sisyphus