#!/bin/sh # # Distribution generator for CVS based packages. # To work, this script needs a consistent tagging of all releases. # Each release of a package should have a tag of the form # # _ # # where is the package name and the CVS module # and s the version number with underscores instead of dots. # # For example: cvs tag php_3_0a1 # # The distribution ends up in a .tar.gz file that contains the distribution # in a directory called -. The distribution contains all # directories from the CVS module except the one called "nodist", but only # the files INSTALL, README and config* are included. # # Since you can no longer set the CVS password via an env variable, you # need to have previously done a cvs login for the server and user id # this script uses so it will have an entry in your ~/.cvspasswd file. # # Usage: makedist # # Written by Stig Bakken 1997-05-28. # Modified by Andrei Zmievski 2001-03-01 # # $Id: makedist,v 1.6 2002/03/29 21:03:10 andrei Exp $ # if test "$#" != "2"; then echo "Usage: makedist " >&2 exit 1 fi PKG=$1 ; shift VER=$1 ; shift PHPROOT=:pserver:cvsread@cvs.php.net:/repository PHPGTKMOD=php-gtk if echo '\c' | grep -s c >/dev/null 2>&1 then ECHO_N="echo -n" ECHO_C="" else ECHO_N="echo" ECHO_C='\c' fi MY_OLDPWD=`pwd` # the destination .tar.gz file ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar # temporary directory used to check out files from CVS DIR=$PKG-$VER DIRPATH=$MY_OLDPWD/$DIR if test -d "$DIRPATH"; then echo "The directory $DIR" echo "already exists, rename or remove it and run makedist again." exit 1 fi # version part of the CVS release tag CVSVER=`echo $VER | sed -e 's/[\.\-]/_/g'` CVSPKG=`echo $PKG | sed -e 's/[^a-zA-Z_]/_/g'` # CVS release tag CVSTAG=${CVSPKG}_$CVSVER if test ! -d $DIRPATH; then mkdir -p $DIRPATH || exit 2 fi # Export PHP-GTK $ECHO_N "makedist: exporting tag '$CVSTAG' from '$PHPGTKMOD'...$ECHO_C" cvs -z 9 -d $PHPROOT -Q export -d $DIR -r $CVSTAG $PHPGTKMOD || exit 4 echo "" cd $DIR || exit 3 # remove CVS stuff... find . \( -name CVS -o -name makedist -o -name .cvsignore \) -exec rm -rf {} \; cd $MY_OLDPWD $ECHO_N "makedist: making gzipped tar archive...$ECHO_C" tar cf $ARCHIVE $PKG-$VER || exit 4 gzip -9 $ARCHIVE || exit 5 echo "" $ECHO_N "makedist: cleaning up...$ECHO_C" rm -rf $DIRPATH || exit 6 echo "" exit 0