#!/bin/sh
#
# File: pltar
# Usage: pltar
# 
# Builds tar archive of plplot files for distribution.
# No binary or CVS files should be included.

# Build archive from parent directory.  It must also be unpacked from there.

pldir="`basename $PWD`"
tarfile=${pldir}.tar
cd ..

# top level text files & scripts

tar cf ${tarfile} ${pldir}/README
tar rf ${tarfile} ${pldir}/README.1st
tar rf ${tarfile} ${pldir}/COPYRIGHTS
tar rf ${tarfile} ${pldir}/Changes.log
tar rf ${tarfile} ${pldir}/ToDo
tar rf ${tarfile} ${pldir}/pltar*
tar rf ${tarfile} ${pldir}/plzoo*
tar rf ${tarfile} ${pldir}/plzip*

# Make sure tar creates these subdirectories to make installation easier.

tar rf ${tarfile} ${pldir}/tmp/.dummy

# Font files

tar rf ${tarfile} ${pldir}/lib/*.fnt

# Subdirectories

tar rf ${tarfile} `find ${pldir}/doc      ! -path \*CVS\* -only -type f`
tar rf ${tarfile} `find ${pldir}/drivers  ! -path \*CVS\* -only -type f`
tar rf ${tarfile} `find ${pldir}/examples ! -path \*CVS\* -only -type f`
tar rf ${tarfile} `find ${pldir}/fonts    ! -path \*CVS\* -only -type f`
tar rf ${tarfile} `find ${pldir}/include  ! -path \*CVS\* -only -type f`
tar rf ${tarfile} `find ${pldir}/new      ! -path \*CVS\* -only -type f`
tar rf ${tarfile} `find ${pldir}/utils    ! -path \*CVS\* -only -type f`
tar rf ${tarfile} `find ${pldir}/src      ! -path \*CVS\* -only -type f`
tar rf ${tarfile} `find ${pldir}/sys      ! -path \*CVS\* -only -type f`
