/[gentoo-x86]/sci-libs/openfoam/openfoam-1.7.1.ebuild
Gentoo

Contents of /sci-libs/openfoam/openfoam-1.7.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Oct 17 20:34:23 2010 UTC (3 years, 11 months ago) by patrick
Branch: MAIN
Bump

(Portage version: 2.2_rc97/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/openfoam/openfoam-1.6.ebuild,v 1.2 2009/09/25 09:28:54 flameeyes Exp $
4
5 EAPI="2"
6
7 inherit eutils versionator multilib toolchain-funcs
8
9 MY_PN="OpenFOAM"
10 MY_PV=$(get_version_component_range 1-2)
11 MY_P="${MY_PN}-${PV}"
12
13 DESCRIPTION="Open Field Operation and Manipulation - CFD Simulation Toolbox"
14 HOMEPAGE="http://www.opencfd.co.uk/openfoam/"
15 SRC_URI="mirror://sourceforge/foam/${MY_P}.gtgz -> ${MY_P}.tgz"
16 #mirror://gentoo/${MY_P}-compile.patch.bz2"
17
18 LICENSE="GPL-2"
19 SLOT="1.7"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="doc examples"
22
23 DEPEND="!=sci-libs/openfoam-bin-${MY_PV}*
24 !=sci-libs/openfoam-kernel-${MY_PV}*
25 !=sci-libs/openfoam-meta-${MY_PV}*
26 !=sci-libs/openfoam-solvers-${MY_PV}*
27 !=sci-libs/openfoam-utilities-${MY_PV}*
28 !=sci-libs/openfoam-wmake-${MY_PV}*
29 sci-libs/parmetis
30 sci-libs/parmgridgen
31 sci-libs/scotch
32 || ( >sci-visualization/paraview-3.0 sci-visualization/opendx )
33 virtual/mpi"
34 RDEPEND="${DEPEND}"
35
36 S=${WORKDIR}/${MY_P}
37 INSDIR="/usr/$(get_libdir)/${MY_PN}/${MY_P}"
38
39 pkg_setup() {
40 # just to be sure the right profile is selected (gcc-config)
41 if ! version_is_at_least 4.3 $(gcc-version) ; then
42 die "${PN} requires >=sys-devel/gcc-4.3 to compile."
43 fi
44
45 elog
46 elog "In order to use ${MY_PN} you should add the following line to ~/.bashrc :"
47 elog
48 elog "alias startOF$(delete_all_version_separators ${MY_PV})='source ${INSDIR}/etc/bashrc'"
49 elog
50 elog "And everytime you want to use OpenFOAM you have to execute startOF$(delete_all_version_separators ${MY_PV})"
51 ewarn
52 ewarn "FoamX is deprecated since ${MY_PN}-1.5! "
53 ewarn
54 }
55
56 #src_prepare() {
57 # epatch "${WORKDIR}"/${MY_P}-compile.patch
58 #}
59
60 src_configure() {
61 if has_version sys-cluster/mpich2 ; then
62 export WM_MPLIB=MPICH
63 elif has_version sys-cluster/openmpi ; then
64 export WM_MPLIB=OPENMPI
65 else
66 die "You need one of the following mpi implementations: openmpi or mpich2"
67 fi
68
69 sed -i -e "s|WM_MPLIB:=OPENMPI|WM_MPLIB:="${WM_MPLIB}"|" etc/bashrc
70 sed -i -e "s|setenv WM_MPLIB OPENMPI|setenv WM_MPLIB "${WM_MPLIB}"|" etc/cshrc
71 }
72
73 src_compile() {
74 export FOAM_INST_DIR=${WORKDIR}
75 source etc/bashrc
76
77 find wmake -name dirToString | xargs rm -rf
78 find wmake -name wmkdep | xargs rm -rf
79
80 ./Allwmake || die "could not build"
81 }
82
83 src_test() {
84 cd bin
85 ./foamInstallationTest
86 }
87
88 src_install() {
89 insinto ${INSDIR}
90 doins -r etc
91
92 use examples && doins -r tutorials
93
94 insopts -m0755
95 doins -r bin
96
97 insinto ${INSDIR}/applications/bin
98 doins -r applications/bin/*
99
100 insinto ${INSDIR}/lib
101 doins -r lib/*
102
103 insinto ${INSDIR}/wmake
104 doins -r wmake/*
105
106 dodoc {doc/Guides-a4/*.pdf,README}
107
108 if use doc ; then
109 dohtml -r doc/Doxygen
110 fi
111 }

  ViewVC Help
Powered by ViewVC 1.1.20