#!/bin/sh

set -e

if [ "$1" = "configure" ]; then

update-alternatives \
	--install /usr/include/@TRIPLET@/mpi mpi-@TRIPLET@ /usr/lib/@TRIPLET@/openmpi/include 50 \
	--slave /usr/lib/@TRIPLET@/libmpi.so libmpi.so-@TRIPLET@ /usr/lib/@TRIPLET@/openmpi/lib/libmpi.so \
	--slave /usr/lib/@TRIPLET@/libmpi++.so libmpi++.so-@TRIPLET@ /usr/lib/@TRIPLET@/openmpi/lib/libmpi_cxx.so \
	--slave /usr/lib/@TRIPLET@/pkgconfig/mpi.pc mpi.pc-@TRIPLET@ /usr/lib/@TRIPLET@/pkgconfig/ompi.pc \
	--slave /usr/lib/@TRIPLET@/pkgconfig/mpi-fort.pc mpi-fort.pc-@TRIPLET@ /usr/lib/@TRIPLET@/pkgconfig/ompi-fort.pc \
	--slave /usr/lib/@TRIPLET@/pkgconfig/mpi-c.pc mpi-c.pc-@TRIPLET@ /usr/lib/@TRIPLET@/pkgconfig/ompi-c.pc \
	--slave /usr/lib/@TRIPLET@/pkgconfig/mpi-cxx.pc mpi-cxx.pc-@TRIPLET@ /usr/lib/@TRIPLET@/pkgconfig/ompi-cxx.pc

fi

#DEBHELPER#
