summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorm-pilia2017-12-01 14:55:37 +0100
committerm-pilia2017-12-01 14:55:37 +0100
commit1939f52e4016f335b99ed603ff3f9a7b0b3d08ad (patch)
tree75b7e6cb64fd3fe1c6fc702c3f3e8dfdcc8a4e13 /PKGBUILD
downloadaur-1939f52e4016f335b99ed603ff3f9a7b0b3d08ad.tar.gz
submission
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD87
1 files changed, 87 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..021b8d59610c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,87 @@
+# Maintainer of this PKBGUILD file: Martino Pilia <martino.pilia@gmail.com>
+pkgname=salome-meca-bin
+pkgver=2017.0.2
+pkgrel=1
+pkgdesc='Integration of the Code_Aster solver in the Salome platform'
+arch=('x86_64')
+url='https://www.code-aster.org/spip.php?article303'
+license=('LGPL')
+depends=('openblas')
+makedepends=()
+optdepends=()
+provides=('salome-meca')
+source=("https://www.code-aster.org/FICHIERS/Salome-Meca-${pkgver}-LGPL-1.tgz")
+md5sums=('e65b4da01a8200492b94a278db621029')
+
+build() {
+ cd "${srcdir}"
+
+ echo "Extracting installer..."
+
+ # self-extract
+ ./Salome-Meca-2017.0.2-LGPL-1.run &> /dev/null <<-EOF
+ ${srcdir}/salome_meca
+ EOF
+
+ cd "${srcdir}/salome_meca/V2017.0.2/"
+
+ # impose the right path for the setup script
+ sed -i \
+ "107iSALOMEDIR=${srcdir}/salome_meca/V2017.0.2/" \
+ create_appli.sh
+
+ # use the bundled version of python
+ export PATH="${srcdir}/salome_meca/V2017.0.2/prerequisites/Python-2710/bin/":$PATH
+
+ echo "Building virtual application..."
+
+ # create virtual application
+ # -D to not automatically create a (wrong) desktop and menu entry
+ ./create_appli.sh -D &> /dev/null <<-EOF
+ ${srcdir}/salome_meca/appli_V2017.0.2
+ EOF
+
+ # create .desktop file from template
+ # use the bundled libraries and Python version
+ _path='PATH=/opt/salome_meca/V2017.0.2/prerequisites/Python-2710/bin/:$PATH'
+ _ld_path='LD_LIBRARY_PATH=$(find /opt/salome_meca/V2017.0.2/ -type d -name lib | tr '"'"'\\n'"'"' '"'"':'"'"' | sed '"'"'s/:$//'"'"'):$LD_LIBRARY_PATH'
+ sed -e "s,APPLIDIR,$_path $_ld_path /opt/salome_meca/appli_V2017.0.2/salome," \
+ -e "s,SALOMEDIR,/opt/salome_meca/V2017.0.2," \
+ ${srcdir}/salome_meca/V2017.0.2/.salome_meca_V2017.0.2.desktop \
+ > ${srcdir}/salome_meca.desktop
+
+ echo "Fixing references..."
+
+ # fix references to srcdir
+ for f in `grep -R "${srcdir}" ${srcdir} | cut -d: -f1`; do
+ sed -i "s,${srcdir},/opt," $f
+ done
+
+ echo "Fixing symlinks..."
+
+ # fix symlinks pointing to srcdir
+ # https://stackoverflow.com/questions/31020219/how-change-symlink-path-for-many-files
+ oldpath="${srcdir}"
+ newpath='/opt'
+ find ${srcdir}/salome_meca -type l -execdir bash -c 'p="$(readlink "{}")"; if [ "${p:0:1}" != "/" ]; then p="$(echo "$(pwd)/$p" | sed -e "s|/\./|/|g" -e ":a" -e "s|/[^/]*/\.\./|/|" -e "t a")"; fi; if [ "${p:0:'${#oldpath}'}" == "'"$oldpath"'" ]; then ln -snf "'"$newpath"'${p:'${#oldpath}'}" "{}"; fi;' \;
+}
+
+package() {
+ cd ${srcdir}
+
+ # install bash completions
+ mkdir -p $pkgdir/usr/share/bash-completion/completions
+ install -D -m644 \
+ "${srcdir}/salome_meca/appli_V2017.0.2/.salome-completion.sh" \
+ "${pkgdir}/usr/share/bash-completion/completions/salome"
+
+ # install application
+ mkdir ${pkgdir}/opt
+ mv ${srcdir}/salome_meca ${pkgdir}/opt/salome_meca
+
+ # install .desktop file
+ mkdir -p ${pkgdir}/usr/share/applications
+ install -D -m644 \
+ "${srcdir}/salome_meca.desktop" \
+ "${pkgdir}/usr/share/applications/salome_meca.desktop"
+}