diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-08-31 13:44:44 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-08-31 14:05:52 -0300 |
commit | 1a18bfac36a2c5c7b6a55b0b5df47288f5ec81ea (patch) | |
tree | ebae54226f22e0a36730a3b988fb9da67c6f2743 /pcr/openfoam3.0-git/PKGBUILD | |
parent | 9ec77b02bfd23c73cf12df33bf6cccd01481c34a (diff) | |
download | abslibre-1a18bfac36a2c5c7b6a55b0b5df47288f5ec81ea.tar.gz abslibre-1a18bfac36a2c5c7b6a55b0b5df47288f5ec81ea.tar.bz2 abslibre-1a18bfac36a2c5c7b6a55b0b5df47288f5ec81ea.zip |
openfoam3.0-git: add new package to [pcr] - Packaging request #1047 -> https://labs.parabola.nu/issues/1047
Diffstat (limited to 'pcr/openfoam3.0-git/PKGBUILD')
-rw-r--r-- | pcr/openfoam3.0-git/PKGBUILD | 74 |
1 files changed, 74 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" +} + + + |