summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-08-31 13:44:44 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-08-31 14:05:52 -0300
commit1a18bfac36a2c5c7b6a55b0b5df47288f5ec81ea (patch)
treeebae54226f22e0a36730a3b988fb9da67c6f2743 /pcr
parent9ec77b02bfd23c73cf12df33bf6cccd01481c34a (diff)
openfoam3.0-git: add new package to [pcr] - Packaging request #1047 -> https://labs.parabola.nu/issues/1047
Diffstat (limited to 'pcr')
-rw-r--r--pcr/openfoam3.0-git/PKGBUILD74
-rw-r--r--pcr/openfoam3.0-git/openfoam.install20
2 files changed, 94 insertions, 0 deletions
diff --git a/pcr/openfoam3.0-git/PKGBUILD b/pcr/openfoam3.0-git/PKGBUILD
new file mode 100644
index 000000000..69b7fc5d6
--- /dev/null
+++ b/pcr/openfoam3.0-git/PKGBUILD
@@ -0,0 +1,74 @@
+# Original Contributor (Arch): aquavitae <aquavitae69: gmail>
+# Current Maintainer (Arch): Andrew Fischer <andrew_at_ltengsoft.com>
+
+pkgname=openfoam3.0-git
+
+# The distributors package name
+_distpkgname=OpenFOAM
+_distpkgver=3.0.x
+_gitname=$_distpkgname-$_distpkgver
+pkgver=20160803.4b5e129
+pkgrel=1.parabola1
+pkgdesc="The libre CFD toolbox, without nonfree parmetis support"
+arch=('i686' 'x86_64')
+url="http://www.openfoam.com"
+license=('GPL')
+groups=()
+depends=('cgal' 'paraview' 'scotch' 'boost')
+makedepends=('git')
+optdepends=()
+replaces=()
+backup=()
+options=()
+source=(git+https://github.com/OpenFOAM/OpenFOAM-3.0.x.git)
+noextract=()
+install=openfoam.install
+md5sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/$_gitname"
+ git log -1 --date=short --format="%cd.%h" | tr -d '-'
+}
+
+
+build() {
+ # Setup the build environment
+ export FOAM_INST_DIR=$srcdir
+ foamDotFile=$srcdir/$_gitname/etc/bashrc
+ [ -f $foamDotFile ] && . $foamDotFile || return 1
+
+ # Enter build directory
+ cd "$srcdir/$_gitname" || return 1
+
+ # Build and clean up OpenFOAM
+ ./Allwmake || return 1
+ wclean all || return 1
+ wmakeLnIncludeAll || return 1
+}
+package() {
+ cd "$srcdir"
+
+ # Create destination directories
+ install -d "$pkgdir/opt/$_distpkgname" "$pkgdir/etc/profile.d" || return 1
+
+ # Move package to pkgdir
+ mv "$srcdir/$_gitname" "$pkgdir/opt/$_distpkgname/$_gitname" || return 1
+
+ mkdir -p "$pkgdir/usr/bin"
+
+ # Add source file
+ echo "export FOAM_INST_DIR=/opt/$_distpkgname" > "$pkgdir/usr/bin/ofoam-3.0" || return 1
+ echo ".\$FOAM_INST_DIR/$_gitname/etc/bashrc" >> "$pkgdir/usr/bin/ofoam-3.0" || return 1
+
+ # Add stub thirdparty directory to keep openfoam happy
+ install -d "$pkgdir/opt/$_distpkgname/ThirdParty-$_distpkgver" || return 1
+
+ # Permission fixes - for system-wide install and use
+ chmod -R go+r "$pkgdir/opt"
+ chmod -R 755 "$pkgdir/opt/$_distpkgname/$_gitname/bin"
+ chmod -R 755 "$pkgdir/opt/$_distpkgname/$_gitname/etc"
+ chmod -R 755 "$pkgdir/usr/bin/ofoam-3.0"
+}
+
+
+
diff --git a/pcr/openfoam3.0-git/openfoam.install b/pcr/openfoam3.0-git/openfoam.install
new file mode 100644
index 000000000..939247c8f
--- /dev/null
+++ b/pcr/openfoam3.0-git/openfoam.install
@@ -0,0 +1,20 @@
+post_install() {
+ echo "NOTE:"
+ echo "This install of OpenFOAM does Not include the"
+ echo "ThirdParty libraries from openfoam's website."
+ echo "It simply creates a stub OpenFOAM/ThirdParty"
+ echo "directory to keep the OpenFOAM bashrc happy."
+ echo ""
+ echo "The most common use of ThirdParty is to get Paraview."
+ echo "Modern versions of Paraview include an OpenFOAM"
+ echo "case file viewer. Instead of installing the ThirdParty"
+ echo "build of Paraview, using the standard arch Paraview"
+ echo "package is recommended."
+ echo ""
+ echo "If you need other components of the ThirdParty bundle"
+ echo "it will have to be installed manually."
+ echo "See http://www.openfoam.com/download/source.php for details."
+ echo ""
+ echo "Also, to avoid conflict with 'R' from r-project.org, please"
+ echo "type 'ofoam-3.0' to initialize the environment."
+}