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
38
39
40
41
# Contributor: Jed Brown <[email protected]>
pkgname=(parmetis)
_prefix=/usr
pkgver=3.1.1
pkgrel=2
pkgdesc="A parallel graph partitioning library"
url="http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview"
arch=('i686' 'x86_64')
license="custom"
depends=()
makedepends=(openmpi)
conflicts=()
replaces=()
provides=(metis)
backup=()
source=(http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/ParMetis-$pkgver.tar.gz)
md5sums=('57318dbaddff2c3d1ef820cff0bf87b0')

build() {
  cd $srcdir/ParMetis-$pkgver
  cat > Makefile.in <<EOF
CC= ${_prefix}/bin/mpicc
OPTFLAGS= -O2 -fPIC
LD= ${_prefix}/bin/mpicc
AR= ar rv
RANLIB= ar -ts
EOF
  make || return 1
  ${_prefix}/bin/mpicc -o libmetis.so -shared METISLib/*.o -lm
  ${_prefix}/bin/mpicc -o libparmetis.so -shared ParMETISLib/*.o libmetis.so -lm
}

package() {
  cd $srcdir/ParMetis-$pkgver
  install -m755 -d $pkgdir${_prefix}/lib
  install -m644 lib{metis,parmetis}.{a,so} $pkgdir${_prefix}/lib
  install -m755 -d $pkgdir${_prefix}/include/metis
  install -m644 METISLib/*.h $pkgdir${_prefix}/include/metis
  install -m644 parmetis.h $pkgdir${_prefix}/include
  install -D -m644 COPYRIGHT $pkgdir/usr/share/licenses/parmetis/license.txt
}