if [ -e /etc/rpm/macros.dist ]; then
    LTSPDIST=`cat /etc/rpm/macros.dist |grep %dist |awk {'print $2'} | sed 's/\.//'`
fi
if [ -z "$LTSPDIST" ]; then
    # Fallback to Fedora 9 chroot if host OS is not detected.
    LTSPDIST=fc9
fi
case "$LTSPDIST" in
    fc9)
        export VENDORDEF="Fedora"
        export RELEASEDEF=9
        export TFTPDIR=/var/lib/tftpboot
    ;;
    fc10)
        export VENDORDEF="Fedora"
        export RELEASEDEF=10
        export TFTPDIR=/var/lib/tftpboot
    ;;
    fc11)
        export VENDORDEF="Fedora"
        export RELEASEDEF=11
        export TFTPDIR=/var/lib/tftpboot
    ;;
    el5)
        export VENDORDEF="Fedora"
        export RELEASEDEF=9
        export TFTPDIR=/tftpboot
    ;;
    *)
        echo "ERROR: $LTSPDIST is unsupported."
        exit 1
    ;;
esac
