#!/bin/bash

. ./config-settings.bash

# Fix up the shebang lines to the scripts in the perl/bin directory
"$PWD/dist/perl-$version/bin/change-shebang" -f dist/perl-$version/bin/*

export PATH="$PWD/dist/perl-$version/bin:$PATH"

perl_archname=$( echo 'use Config; print $Config{"archname"};' | perl - )

cd dist \
    && tar cvzf perl-$version-$perl_archname.tar.gz perl-$version \
    && cd ..

echo ""
echo "----"
echo "To commit the generate perl-with-cpan for Greenstone use into the SVN repo, next run"
echo "  ./GS-PERL-DIST-SVN-COMMIT.sh"

echo "----"
echo ""
