#!/usr/local/bin/perl
# Geoffrey Furnish
# 8 November 1995
#
# A Perl script to manage preparation of PLplot releases.

print "PLplot release preparation.\n\n";

$tag = `date +%y%m%d`;
chop $tag;

print "Enter tag for release (default=$tag) : ";
$ans = <STDIN>;
chop $ans;

$tag = $ans if $ans ne "";

print "Constructing PLplot release with tag $tag.\n";

$dir = "/tmp/plplot-$tag";

# Make space in /tmp for building this release.  Delete any vestiges
# of a prior build (like while this script is under development).

system( "rm -rf $dir $dir.tar $dir.tar.gz" );

# Now construct the release file tree.

system( "(cd /tmp; cvs checkout plplot; mv plplot $dir)" );

system( "rm $dir/PROBLEMS" );
system( "rm $dir/mkrel" );
system( "rm -rf $dir/private" );

# Should do something to stuff the LGPL copyright notice into each
# file.

# Now tar it up and compress it.

system( "(cd $dir; plexp)" );

# Inform release coordinator of the status.

print "Constructed PLplot distribution file in /tmp:\n";
system( "ls -l /tmp/plplot-$tag.tar.gz" );
print "Moving to final location.\n";

system( "cp /tmp/plplot-$tag.tar.gz ~ftp/plplot/snapshots" );
system( "ls -l ~ftp/plplot/snapshots" );

# Send mail to the list ???

# Notify that the release has been done.

print "Release of PLplot (tag $tag) is complete.\n";
