POSTIN
/bin/sh
# Any and all upgrades/installs should remove all old dangling alternatives
# links except for the one case of openmpi-1.2.3 still installed because
# its %preun will fail if it can't remove the alternatives link itself.
# So, remove the links, and if 1.2.3 is installed, put it back.
/usr/sbin/alternatives --remove mpicc \
/usr/bin/opal_wrapper-64 >/dev/null 2>&1
/usr/sbin/alternatives --remove mpicc \
/usr/bin/opal_wrapper-1.2.3-gcc-64 >/dev/null 2>&1
rpm -q openmpi-libs-1.2.3.x86_64 > /dev/null 2>&1
if [ $? -eq 0 ]; then
# 1.2.3 is installed, recreate the link
/usr/sbin/alternatives --install /usr/bin/mpicc mpicc \
/usr/bin/opal_wrapper-1.2.3-gcc-64 11 >/dev/null 2>&1
fi
# We can't fail
/bin/true