1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Maintainer: Jed Brown <jedbrown>
pkgname=ptscotch-openmpi
pkgver=5.1.10b
pkgrel=1
_prefix=/usr
pkgdesc="SCOTCH is a software package and libraries for graph, mesh and hypergraph partitioning, static mapping, and sparse matrix block ordering. This is the Parallel version using MPI."
url="http://www.labri.fr/perso/pelegrin/scotch/"
license="custom: CeCILL-C free/libre software license"
depends=('openmpi' 'numactl')
provides=()
conflicts=()
replaces=()
backup=()
arch=('i686' 'x86_64')
source=("http://gforge.inria.fr/frs/download.php/27583/scotch_${pkgver}.tar.gz" scotch.patch)
md5sums=('9b8622b39c141ecaca4a46298486fd99'
         '7c338bcfa1785909193170cca30da698')

build() {
  cd "${srcdir}/scotch_${pkgver}"
  patch -p1 < "${srcdir}/scotch.patch"

  cd src
  sed "s,-O3,$CFLAGS,g" Make.inc/Makefile.inc.x86-64_pc_linux2 > Makefile.inc
  sed -i "s,= mpicc,= ${_prefix}/bin/mpicc,g" Makefile.inc

  make ptscotch
}

package() {
  cd "${srcdir}/scotch_${pkgver}"
  install -d "${pkgdir}/${_prefix}"/{bin,lib,include/scotch}
  install -m 644 -t "${pkgdir}/${_prefix}"/include/scotch include/*.h
  install -m 644 -t "${pkgdir}/${_prefix}"/lib lib/lib*.a
  install -m 755 -t "${pkgdir}/${_prefix}"/bin bin/*
  install -m 644 -D "${srcdir}/scotch_${pkgver}/doc/CeCILL-C_V1-en.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}