Skip to content

Instantly share code, notes, and snippets.

@simonpintarelli
Created February 26, 2018 22:49
Show Gist options
  • Save simonpintarelli/23421c6e06f90815f7cb0d921069d7e7 to your computer and use it in GitHub Desktop.
Save simonpintarelli/23421c6e06f90815f7cb0d921069d7e7 to your computer and use it in GitHub Desktop.
med
# Maintainer Oliver Goethel <deezy>
# Contributor: Michele Mocciola <mickele>
# Contributor: Brice Méalier <mealier_brice@yahoo.fr>
# Contributor: Philippe Miron <tuxication@gmail.com>
# Modified by: César Vecchio <cesar UNDERSTRIKE vecchio AT yahoo DOT com>
# Modified by: Martin Ortbauer <mortbauer@gmail.com>
pkgname=med
pkgver=3.2.0
pkgrel=5
pkgdesc="MED stands for Modelisation et Echanges de Donnees, i.e. Data Modelization and Exchanges - MED is code-aster exchange module linked to hdf5"
url="http://www.code-aster.org/outils/med/"
license=('LGPL')
depends=('hdf5' 'openmpi' 'swig')
makedepends=('gcc-fortran' 'coreutils' 'python2')
optdepends=('tk')
provides=()
conflicts=('med_fichier')
replaces=('med_fichier')
backup=()
arch=('i686' 'x86_64')
source=("http://files.salome-platform.org/Salome/other/${pkgname}-${pkgver}.tar.gz"
"patch-include_2.3.6_med.h.in"
"patch-include_med.h.in"
"patch-src_2.3.6_ci_MEDequivInfo.c"
"patch-int2long")
sha256sums=('d52e9a1bdd10f31aa154c34a5799b48d4266dc6b4a5ee05a9ceda525f2c6c138'
'e73695d7b9910b033bd6e04f90ba4fbae09841b67bbe85a1a040044caff7ed25'
'3463c4690d12d338c6ef890db2d78c6a170ea643af4750102be832707e9103ce'
'7b20b319ae427f8bf2af40079141be8444714a4a1b5fa5d5d0298f989f4bbe66'
'e4ddecd9a1496eb9479813cefded57dcdf7487e0a4a741c9dcd467ab971d6e9f')
sha512sums=('5a40d1fe454d5a1ec90dc192fe4a914433841928ffde668aeb7fd78d0aea1083f98c8c895b7bd8dbc28e91ed455cb8e7f1235fa9bce43e1e7feaf6abf20c94a8'
'b6433b55cb6cd705c5d1c9c30837aee0f81faec9232cd10a2239fe2c618a2dc508118da6175b174fcb6e33469276898f21095b0988ad5a34ab8d6d675ec1ca7a'
'3f717e1ccdcd248ef3c129aa778950f4e7101583bde04c808ea35c6e0d483ccd3483468d42115bf7515537ef715b529db2edd4b7790fd4f3ed5007e253382c4a'
'2a5eb924b880bf1926c2aa9ba6a0103767ad46cf5849fb0728c9892e368b2045dfb179c9f923c73b8f140825af370f330ed601b8a15162d66cf2f3fc035ce4d3'
'db544d7983891ecec8af7968e194b7c3c188cddb0ee36d4d8fcbd108e2b5a248b1867654a5a14729ef9ba8cb1d2fbd7bced81046c5f99d95b84be3a31a384e37')
build() {
if [ "$CARCH" = "x86_64" ]; then
export FFLAGS="-fopenmp -fPIC -fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -ffixed-line-length-0 ${CFLAGS}"
export FCFLAGS="-fopenmp -fPIC -fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -ffixed-line-length-0 ${CFLAGS}"
export CPPFLAGS="-DHAVE_F77INT64 ${CPPFLAGS}"
export F77=mpif90
export FC=mpif90
else # i686
export FFLAGS="-fopenmp -fPIC -ffixed-line-length-0 ${CFLAGS}"
export FCFLAGS="-fopenmp -fPIC -ffixed-line-length-0 ${CFLAGS}"
export F77=mpif90
export FC=mpif90
fi
export PYTHON="$(which python2)"
cd ${srcdir}/${pkgname}-${pkgver} || return 1
# patch H5public_extract.h.in
sed -i -e '/^#typedef/ s/#/\/\//' ./include/H5public_extract.h.in
#patch for hdf5-1.10
patch -p0 < ${srcdir}/patch-include_2.3.6_med.h.in
patch -p0 < ${srcdir}/patch-include_med.h.in
patch -p0 < ${srcdir}/patch-src_2.3.6_ci_MEDequivInfo.c
patch -p0 < ${srcdir}/patch-int2long
./configure --with-f90=mpif90 --prefix=/usr --datadir=/usr/share/med --with-swig=yes || return 1
make || return 1
}
package() {
cd ${srcdir}/${pkgname}-${pkgver} || return 1
make DESTDIR=${pkgdir} install || return 1
# now move the testprograms to share, we don't want all the stuff in the bindir
cp -dpr --no-preserve=ownership ${pkgdir}/usr/bin/testc ${pkgdir}/usr/share/med/testc
cp -dpr --no-preserve=ownership ${pkgdir}/usr/bin/testf ${pkgdir}/usr/share/med/
cp -dpr --no-preserve=ownership ${pkgdir}/usr/bin/unittests ${pkgdir}/usr/share/med/
cp -dpr --no-preserve=ownership ${pkgdir}/usr/bin/usescases ${pkgdir}/usr/share/med/
rm -r ${pkgdir}/usr/bin/{usescases,unittests,testf,testc}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment