1 # Maintainer: Myles English <myles at rockhead dot biz>
4 _config=linux-gnu-cxx-debug
6 pkgdesc="Portable, extensible toolkit for scientific computation"
8 url="http://www.mcs.anl.gov/petsc/petsc-as"
9 license=('MIT compatible')
10 depends=('python2' 'gcc' 'mpich2' 'boost')
11 #conflicts=('umfpack')
12 install=(petsc.install)
13 source=(http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${pkgname}-${pkgver/_/-}.tar.gz)
14 md5sums=('936b56152f6eeaf3322b87683d757622')
16 _build_dir=${srcdir}/${pkgname}-${pkgver/_/-}
17 _install_dir=/usr/petsc/${_config}
23 export PETSC_DIR=${_build_dir}
25 find ${srcdir} -name "*" -type f -exec \
26 sed -i 's#\(/usr/bin/env \|/usr/bin/\)python[2-3]*#\1python2#' {} \;
28 python2 ./config/configure.py --prefix=${pkgdir}${_install_dir} \
29 --with-mpi-dir=/opt/mpich2 \
32 --download-umfpack=1 \
33 --with-clanguage=cxx \
34 --with-boost-dir=/usr \
35 --with-umfpack=1 --with-umfpack-dir=/usr/lib \
38 sed -i 's/.\/config\/install.py/python2 .\/config\/install.py/' makefile
44 make PETSC_DIR=${_build_dir} PETSC_ARCH=${_config} install
46 sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/conf/variables"
47 sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/conf/petscvariables"
48 sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/conf/rules"
49 sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/include/petscconf.h"
50 sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/include/petscconfiginfo.h"
51 sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/conf/petscrules"
53 export PETSC_DIR=${_install_dir}
56 mkdir -p ${pkgdir}/usr/share/doc/$pkgname/
57 cp -r ${_build_dir}/docs ${pkgdir}/usr/share/doc/$pkgname/
60 mkdir -p ${pkgdir}/usr/share/doc/$pkgname/tutorials
61 cp -r ${_build_dir}/tutorials ${pkgdir}/usr/share/doc/$pkgname/tutorials
63 # install licenCe (even though there is no such word as licenSes)
64 mkdir -p ${pkgdir}/usr/share/licenses/petsc
65 cp ${_build_dir}/docs/copyright.html ${pkgdir}/usr/share/licenses/$pkgname/
67 mkdir -p ${pkgdir}/etc/profile.d
68 echo "export PETSC_DIR=${_install_dir}" > ${pkgdir}/etc/profile.d/petsc.sh
69 chmod +x ${pkgdir}/etc/profile.d/petsc.sh
71 # show where the shared libraries are
72 install -d -m755 "${pkgdir}"/etc/ld.so.conf.d/
73 echo '/usr/petsc/linux-gnu-cxx-debug/lib' > "${pkgdir}"/etc/ld.so.conf.d/petsc.conf