php-src/makedist

141 lines
3.3 KiB
Plaintext
Raw Normal View History

1999-04-08 05:05:13 +08:00
#!/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
#
# <package>_<version>
#
# where <package> is the package name and the CVS module
# and <version> 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 <package>-<version>. 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 <package> <version>
#
# Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
#
# $Id$
#
CVSROOT=:pserver:cvsread@cvs.php.net:/repository
export CVSROOT
1999-07-17 19:22:17 +08:00
ZENDROOT=:pserver:cvsread@cvs.zend.com:/repository
export ZENDROOT
1999-04-08 05:05:13 +08:00
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
if test "$#" != "2"; then
echo "Usage: makedist <package> <version>" >&2
exit 1
fi
PKG=$1 ; shift
VER=$1 ; shift
1999-07-17 19:59:37 +08:00
MY_OLDPWD=`pwd`
1999-04-08 05:05:13 +08:00
# the destination .tar.gz file
1999-07-17 19:59:37 +08:00
ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar.gz
1999-04-08 05:05:13 +08:00
# temporary directory used to check out files from CVS
1999-07-17 19:59:37 +08:00
TMPDIR=$MY_OLDPWD/cvstmp-$PKG-$VER
1999-04-08 05:05:13 +08:00
# version part of the CVS release tag
CVSVER=`echo $VER | sed -e 's/\./_/g'`
# CVS release tag
CVSTAG=${PKG}_$CVSVER
1999-07-17 19:22:17 +08:00
# should become "php4"
1999-04-08 05:05:13 +08:00
CVSMOD=`cat CVS/Repository | sed -e 's!^/[^/]*/!!'`
1999-07-17 19:22:17 +08:00
# should become "libzend"
ZENDMOD=`cat libzend/CVS/Repository | sed -e 's!^/[^/]*/!!'`
# should become "TSRM"
TSRMMOD=`cat TSRM/CVS/Repository | sed -e 's!^/[^/]*/!!'`
1999-04-08 05:05:13 +08:00
if test ! -d $TMPDIR; then
mkdir -p $TMPDIR || exit 2
fi
cd $TMPDIR || exit 3
$ECHO_N "makedist: exporting tag '$CVSTAG' from '$CVSMOD'...$ECHO_C"
cvs -Q export -r $CVSTAG $CVSMOD || exit 4
echo ""
cd $CVSMOD || exit 5
1999-07-17 19:22:17 +08:00
# Check out Zend
$ECHO_N "makedist: exporting tag '$CVSTAG' from '$ZENDMOD'...$ECHO_C"
cvs -d $ZENDROOT -Q export -r $CVSTAG $ZENDMOD || exit 4
1999-07-17 19:59:37 +08:00
echo ""
1999-07-17 19:22:17 +08:00
# Check out TSRM
$ECHO_N "makedist: exporting tag '$CVSTAG' from '$TSRMMOD'...$ECHO_C"
cvs -d $ZENDROOT -Q export -r $CVSTAG $TSRMMOD || exit 4
1999-07-17 19:59:37 +08:00
echo ""
1999-07-17 19:22:17 +08:00
1999-04-08 05:05:13 +08:00
INC=""
# remove CVS stuff...
find . \( \( -name CVS -type d \) -o -name .cvsignore \) -exec rm -rf {} \;
for file in *; do
case $file in
$PKG-$VER|web_update);; # ignore these
*) INC="$INC $file";; # include the rest
esac
done
# generate some files so people don't need bison, flex and autoconf
# to install
set -x
1999-07-17 20:28:17 +08:00
./buildconf --copy
./genfiles
1999-07-20 01:58:51 +08:00
echo "/* Dummy File */" > ext/bcmath/number.c
echo "/* Dummy File */" > ext/bcmath/number.h
1999-04-08 05:05:13 +08:00
#perl -i -p -e 's/\r\n/\n/' *.dsw *.dsp
set +x
INC="$INC \
configuration-scanner.c \
1999-07-17 19:22:17 +08:00
configuration-parser.c configuration-parser.h \
acconfig.h aclocal.m4 configure.in missing mkinstalldirs \
ltconfig ltmain.sh config.sub config.guess php_config.h.in \
1999-04-08 05:05:13 +08:00
configure"
1999-07-17 19:59:37 +08:00
1999-04-08 05:05:13 +08:00
mkdir $PKG-$VER || exit 6
mv $INC $PKG-$VER || exit 7
$ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
tar czf $ARCHIVE $PKG-$VER || exit 8
echo ""
$ECHO_N "makedist: cleaning up...$ECHO_C"
1999-07-17 19:59:37 +08:00
cd $MY_OLDPWD
1999-04-08 05:05:13 +08:00
rm -rf $TMPDIR || exit 9
echo ""
exit 0