#!/bin/bash
# Script executed after (successful only?) installation into $PKG_ROOT/perl
#
# Ideally, caller has specified $PKG_ROOT as /mnt/pkgs and there is nothing to
# do, but it's unlikely. Perl is built with knowledge of where its internals are
# and it needs to be able to find them under /mnt/pkgs/perl/perl5.8.0

PKGSROOT=/mnt/pkgs
RUNROOT=$PKGSROOT/perl

# First, ensure we have a $PKGSROOT. Don't care if already exists. Perhaps we
# should have have a standard that specifies location of external "packages"
# anyway. Check to documentation for GNU's "graft" to see how this works.
# $PKGSROOT is my vote for a standard place.
#
[ -d "$PKGSROOT" ] || mkdir -p $PKGSROOT

# Use a link to make reality live up to runtime expectation.
#
[ -a "$RUNROOT" ] || ln -s $PKG_ROOT/perl $RUNROOT

# All is well.
exit 0
