summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.SRCINFO10
-rwxr-xr-xPKGBUILD101
-rw-r--r--openfoam-esi.install19
3 files changed, 48 insertions, 82 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f9d886da121a..9b20b16a458a 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,25 +1,23 @@
pkgbase = openfoam-esi
pkgdesc = The open source CFD toolbox (ESI-OpenCFD version)
pkgver = v2006
- pkgrel = 1
+ pkgrel = 2
url = http://www.openfoam.com/
+ install = openfoam-esi.install
arch = i686
arch = x86_64
license = GPL
depends = gcc
depends = cgal
- depends = cmake
depends = fftw
depends = boost
depends = openmpi
depends = paraview
depends = utf8cpp
+ depends = scotch
+ depends = parmetis
source = https://sourceforge.net/projects/openfoam/files/v2006/OpenFOAM-v2006.tgz
- source = https://sourceforge.net/projects/openfoam/files/v2006/ThirdParty-v2006.tgz
- source = http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz
md5sums = 1226d48e74a4c78f12396cb586c331d8
- md5sums = 6b598b6faa6ddeb25235c5dded0ca275
- md5sums = 5465e67079419a69e0116de24fce58fe
pkgname = openfoam-esi
diff --git a/PKGBUILD b/PKGBUILD
index 7f7f735fe067..6eebea02f9af 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,20 +8,17 @@ pkgname=openfoam-esi
pkgver=v2006
_distname=OpenFOAM
_dist=$_distname-$pkgver
-pkgrel=1
+pkgrel=2
pkgdesc="The open source CFD toolbox (ESI-OpenCFD version)"
arch=('i686' 'x86_64')
url="http://www.openfoam.com/"
license=('GPL')
-depends=('gcc' 'cgal' 'cmake' 'fftw' 'boost' 'openmpi' 'paraview' 'utf8cpp')
+install="${pkgname}.install"
+depends=('gcc' 'cgal' 'fftw' 'boost' 'openmpi' 'paraview' 'utf8cpp' 'scotch' 'parmetis')
-source=("https://sourceforge.net/projects/openfoam/files/v2006/OpenFOAM-v2006.tgz"
- "https://sourceforge.net/projects/openfoam/files/v2006/ThirdParty-v2006.tgz"
- "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz")
+source=("https://sourceforge.net/projects/openfoam/files/v2006/OpenFOAM-v2006.tgz")
-md5sums=('1226d48e74a4c78f12396cb586c331d8'
- '6b598b6faa6ddeb25235c5dded0ca275'
- '5465e67079419a69e0116de24fce58fe')
+md5sums=('1226d48e74a4c78f12396cb586c331d8')
prepare() {
if [ $WM_PROJECT_DIR ]
@@ -32,54 +29,20 @@ prepare() {
return 1
fi
- echo " "
- echo -e "\e[1m\e[31mKnown issues:\n - Adios2 does not compile\n - foam reader does not compile (Threading Building Blocks (TBB) not found)\n\nPlease press any key to continue.\e[0m"
- echo " "
- read -rsp $'\n' -n1 key
-
- cd "$srcdir/$_dist"
+ # Extract the current version and major of paraview and of scotch for use in the system preferences
+ _pversion=$(pacman -Q $(pacman -Qqo $(which paraview)) | sed -e 's/.* //; s/-.*//g')
+ _pmajor=`echo $_pversion | cut -d '.' -f1`
# Generate and install the system preferences file
echo "export compilerInstall=system" > ${srcdir}/prefs.sh
- echo "export cmake_version=cmake-system" >> ${srcdir}/prefs.sh
- echo "export ParaView_QT=qt-system" >> ${srcdir}/prefs.sh
+ echo "export WM_MPLIB=SYSTEMOPENMPI" >> ${srcdir}/prefs.sh
+ echo "export ParaView_VERSION=${_pversion}" >> ${srcdir}/prefs.sh
+ echo "export ParaView_MAJOR=${_pmajor}" >> ${srcdir}/prefs.sh
cp ${srcdir}/prefs.sh ${srcdir}/${_distname}-${pkgver}/etc
- # get paraview-5.8 directories
- # paraview-5.8
- para_dir=`pacman -Q -l paraview | grep "include" | head -n3 | tail -n1 | sed -e 's!p.*/p!p!g' | sed -e 's!/.*!!g'`
- # /usr/include
- para_include_dir=`pacman -Q -l paraview | grep "include" | head -n3 | tail -n1 | awk '{print $2}' | sed 's!/paraview.*!!g'`
- # /usr/bin
- para_bin_dir=`which paraview | sed -e 's!/paraview!!g'`
- # /usr/lib
- para_lib_dir=`echo $para_bin_dir | sed -e 's/bin/lib/g'`
-
- # the variable ParaView_DIR must be defined to compile paraFoam,
- # but it cannot be /usr as it should be
- # (otherwise all pathes containing /usr are removed from PATH)
- arbitrary_dir=`echo ${srcdir}/ThirdParty-${pkgver}/paraview`
- [ ! -d "$arbitrary_dir" ] && mkdir $arbitrary_dir
-
- # this is needed for compiling paraFoam
- echo "export PV_PLUGIN_PATH=\$FOAM_LIBBIN/$para_dir" >> ${srcdir}/system_paraview
- echo "export PATH=$para_bin_dir:\$PATH" >> ${srcdir}/system_paraview
- echo "export LD_LIBRARY_PATH=$para_lib_dir/$para_dir:\$LD_LIBRARY_PATH" >> ${srcdir}/system_paraview
- echo "unset ParaView_VERSION" >> ${srcdir}/system_paraview
- echo "unset ParaView_DIR" >> ${srcdir}/system_paraview
-
- cp ${srcdir}/system_paraview ${srcdir}/${_distname}-${pkgver}/etc/config.sh
-
- cd ${srcdir}/${_distname}-${pkgver}/etc/config.sh
- # write content of system_paraview into file "paraview"
- sed -i "/ParaView_VERSION=5./r system_paraview" ${srcdir}/${_distname}-${pkgver}/etc/config.sh/paraview
- # remove ParaView_VERSION in order to use system paraview
- sed -i '/ParaView_VERSION=5./d' ${srcdir}/${_distname}-${pkgver}/etc/config.sh/paraview
-
- # create link to metis
- cd "$srcdir/ThirdParty-${pkgver}"
- [[ ! -e "metis-5.1.0" ]] && ln -s ../metis-5.1.0 metis-5.1.0
- return 0
+ # Generate the scotch.sh file for arch
+ echo "export SCOTCH_VERSION=scotch-system" > ${srcdir}/scotch
+ cp ${srcdir}/scotch ${srcdir}/${_distname}-${pkgver}/etc/config.sh
}
build() {
@@ -98,46 +61,32 @@ build() {
# without && echo " ", makepkg fails
source ${foamDotFile} && echo " "
- echo -e "\e[1m\e[5m\e[31mPlease read:\e[0m "
- echo -e " "
- echo -e "\e[92mFor compiling the paraview plugin it might be necessary to give OpenFOAM MANUALLY write-access to the following directory:"
- echo -e "sudo chmod 757 /usr/lib/cmake/paraview*/Modules"
- echo -e " "
- echo -e "If you have paraview 5.6 installed, please add the line"
- echo -e "find_package(ospray REQUIRED)"
- echo -e "on line 794 (in FUNCTION(ADD_PARAVIEW_PLUGIN) in the file /usr/lib64/cmake/paraview-5.6/ParaViewPlugins.cmake."
- echo -e "This avoids the error '/usr/bin/ld: cannot find -lospray::ospray' when compiling the paraview reader."
- echo -e " "
- echo -e "Please press any key to continue."
- echo -e "\e[0m "
-
- read -rsp $'\n' -n1 key
-
cd "$srcdir/$_dist"
./Allwmake -j `nproc` 2>&1 | tee log.wmake
- # you need to enter the root password after 2 hours
- #sudo chmod 755 /usr/lib/cmake/paraview*/Modules
+ # check if an error occured during build
+ ret="${PIPESTATUS[0]}"
+ [[ "$ret" -ne "0" ]] && exit 1
- wclean all
- wmakeLnIncludeAll
+ wclean all || exit 1
+ wmakeLnIncludeAll || exit 1
}
package() {
cd ${srcdir}
# Create destination directories
- install -d ${pkgdir}/opt/${_distname} ${pkgdir}/etc/profile.d
+ install -d ${pkgdir}/opt/${_distname} ${pkgdir}/etc/profile.d || return 1
# copy package to pkgdir
- cp -r "${srcdir}/${_dist}" "${pkgdir}/opt/${_distname}"
- cp -r "${srcdir}/ThirdParty-${pkgver}" "${pkgdir}/opt/${_distname}"
-
- # create alias in .bashrc
- echo "alias ofoam=\"source /opt/${_distname}/${_dist}/etc/bashrc\"" >> ~/.bashrc
+ cp -r "${srcdir}/${_dist}" "${pkgdir}/opt/${_distname}" || return 1
# Permission fixes - for system-wide install and use
chmod -R go+r ${pkgdir}/opt
chmod -R 755 ${pkgdir}/opt/${_distname}/${_dist}/bin
chmod -R 755 ${pkgdir}/opt/${_distname}/${_dist}/etc
+
+ # create alias in .bashrc
+ echo "alias of=\"source /opt/${_distname}/${_dist}/etc/bashrc\"" >> ~/.bashrc
+ echo "alias paraFoam=\"paraFoam -builtin\"" >> ~/.bashrc
}
diff --git a/openfoam-esi.install b/openfoam-esi.install
new file mode 100644
index 000000000000..53d498aafd68
--- /dev/null
+++ b/openfoam-esi.install
@@ -0,0 +1,19 @@
+# arg 1: the new package version
+post_install() {
+ echo -e ""
+ echo -e "\e[1m\e[31mNOTE:"
+ echo -e " "
+ echo -e "This install of OpenFOAM does NOT include the ThirdParty libraries."
+ echo -e "Known issue: ptscotch does not compile."
+ echo -e ""
+ echo -e "Please use \"of\" to load OpenFOAM."
+ echo -e ""
+ echo -e "paraFoam will automatically be called using the option \"-builtin\"\e[0m".
+ echo -e ""
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install $1
+}