1999-04-08 05:05:13 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2009-07-15 05:49:26 +08:00
|
|
|
# Distribution generator for SVN based packages.
|
1999-04-08 05:05:13 +08:00
|
|
|
# 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>
|
|
|
|
#
|
2009-07-15 05:49:26 +08:00
|
|
|
# where <package> is the package name and the SVN module
|
1999-04-08 05:05:13 +08:00
|
|
|
# and <version> s the version number with underscores instead of dots.
|
|
|
|
#
|
2009-07-15 05:49:26 +08:00
|
|
|
# For example: svn cp $PHPROOT/php/php-src/trunk $PHPROOT/php/php-src/tags/php_5_0_1
|
1999-04-08 05:05:13 +08:00
|
|
|
#
|
|
|
|
# The distribution ends up in a .tar.gz file that contains the distribution
|
|
|
|
# in a directory called <package>-<version>. The distribution contains all
|
2009-07-15 05:49:26 +08:00
|
|
|
# directories from the SVN module except the one called "nodist", but only
|
1999-04-08 05:05:13 +08:00
|
|
|
# the files INSTALL, README and config* are included.
|
2009-07-15 05:49:26 +08:00
|
|
|
# A .tar.bz2 file is also created.
|
1999-04-08 05:05:13 +08:00
|
|
|
#
|
|
|
|
# Usage: makedist <package> <version>
|
|
|
|
#
|
|
|
|
# Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
2000-06-26 06:48:02 +08:00
|
|
|
if test "$#" != "2"; then
|
|
|
|
echo "Usage: makedist <package> <version>" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
PKG=$1 ; shift
|
|
|
|
VER=$1 ; shift
|
|
|
|
|
|
|
|
old_IFS="$IFS"
|
|
|
|
IFS=.
|
2002-03-21 02:54:30 +08:00
|
|
|
eval set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'`
|
|
|
|
if test "${1}" = "1" -a "${2}" -lt "28"; then
|
|
|
|
echo "You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)"
|
2000-06-26 06:48:02 +08:00
|
|
|
exit 10
|
|
|
|
fi
|
|
|
|
IFS="$old_IFS"
|
2000-05-24 04:32:27 +08:00
|
|
|
|
2009-07-15 05:49:26 +08:00
|
|
|
PHPROOT=http://svn.php.net/repository
|
|
|
|
PHPMOD=php/php-src
|
1999-11-10 23:26:39 +08:00
|
|
|
LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'
|
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
|
|
|
|
|
1999-07-17 19:59:37 +08:00
|
|
|
MY_OLDPWD=`pwd`
|
1999-04-08 05:05:13 +08:00
|
|
|
|
|
|
|
# the destination .tar.gz file
|
2000-05-07 08:18:06 +08:00
|
|
|
ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar
|
1999-04-08 05:05:13 +08:00
|
|
|
|
2009-07-15 05:49:26 +08:00
|
|
|
# temporary directory used to check out files from SVN
|
1999-11-09 00:17:53 +08:00
|
|
|
DIR=$PKG-$VER
|
|
|
|
DIRPATH=$MY_OLDPWD/$DIR
|
1999-04-08 05:05:13 +08:00
|
|
|
|
1999-11-09 00:17:53 +08:00
|
|
|
if test -d "$DIRPATH"; then
|
|
|
|
echo "The directory $DIR"
|
1999-11-04 17:52:44 +08:00
|
|
|
echo "already exists, rename or remove it and run makedist again."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2009-07-15 05:49:26 +08:00
|
|
|
# version part of the SVN release tag
|
|
|
|
SVNVER=`echo $VER | sed -e 's/[\.\-]/_/g'`
|
1999-04-08 05:05:13 +08:00
|
|
|
|
2009-07-15 05:49:26 +08:00
|
|
|
# SVN release tag
|
|
|
|
if test "$VER" != "HEAD" -a "$VER" != "trunk"; then
|
|
|
|
SVNTAG=tags/${PKG}_$SVNVER
|
2003-01-28 10:49:35 +08:00
|
|
|
else
|
2009-07-15 05:49:26 +08:00
|
|
|
SVNTAG=trunk
|
2003-01-28 10:49:35 +08:00
|
|
|
fi
|
1999-04-08 05:05:13 +08:00
|
|
|
|
2009-07-15 05:49:26 +08:00
|
|
|
#if test ! -d $DIRPATH; then
|
|
|
|
# mkdir -p $DIRPATH || exit 2
|
|
|
|
#fi
|
1999-04-08 05:05:13 +08:00
|
|
|
|
1999-11-09 19:56:27 +08:00
|
|
|
# Export PHP
|
2009-07-15 05:49:26 +08:00
|
|
|
$ECHO_N "makedist: exporting tag '$SVNTAG' from '$PHPMOD'...$ECHO_C"
|
|
|
|
svn export $PHPROOT/$PHPMOD/$SVNTAG $DIRPATH || exit 4
|
1999-04-08 05:05:13 +08:00
|
|
|
echo ""
|
|
|
|
|
2009-07-15 05:49:26 +08:00
|
|
|
# remove SVN stuff...
|
2003-01-28 10:49:35 +08:00
|
|
|
cd $DIR || exit 5
|
2009-07-15 05:49:26 +08:00
|
|
|
find . \( -name .svn -type d \) -exec rm -rf {} \;
|
1999-04-08 05:05:13 +08:00
|
|
|
|
2000-05-05 01:52:14 +08:00
|
|
|
# The full ChangeLog is available separately from lxr.php.net
|
2003-01-28 10:49:35 +08:00
|
|
|
rm -f ChangeLog*
|
2000-05-05 01:49:10 +08:00
|
|
|
|
1999-11-10 23:26:39 +08:00
|
|
|
# hide away our own versions of libtool-generated files
|
|
|
|
for i in $LT_TARGETS; do
|
|
|
|
if test -f "$i"; then
|
|
|
|
mv $i $i.bak
|
|
|
|
cp $i.bak $i
|
|
|
|
fi
|
|
|
|
done
|
1999-11-10 00:57:26 +08:00
|
|
|
|
1999-04-08 05:05:13 +08:00
|
|
|
# generate some files so people don't need bison, flex and autoconf
|
|
|
|
# to install
|
|
|
|
set -x
|
2003-05-22 08:31:31 +08:00
|
|
|
./buildconf --copy --force
|
1999-10-05 22:12:43 +08:00
|
|
|
|
2000-08-25 03:23:11 +08:00
|
|
|
# remove buildmk.stamp. Otherwise, buildcheck.sh might not be run,
|
|
|
|
# when a user runs buildconf in the distribution.
|
|
|
|
rm -f buildmk.stamp
|
|
|
|
|
1999-10-05 22:12:43 +08:00
|
|
|
./genfiles
|
|
|
|
|
1999-11-10 23:26:39 +08:00
|
|
|
# now restore our versions of libtool-generated files
|
|
|
|
for i in $LT_TARGETS; do
|
|
|
|
test -f "$i" && mv $i.bak $i
|
|
|
|
done
|
1999-11-10 00:57:26 +08:00
|
|
|
|
2006-05-12 22:54:16 +08:00
|
|
|
# download pear
|
|
|
|
$ECHO_N "makedist: Attempting to download PEAR's phar archive"
|
|
|
|
if test ! -x wget; then
|
|
|
|
wget http://pear.php.net/install-pear-nozlib.phar -nd -P pear/
|
|
|
|
else
|
|
|
|
$ECHO_N "Missing wget binary needed for pear download";
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
|
1999-11-09 00:17:53 +08:00
|
|
|
cd $MY_OLDPWD
|
1999-04-08 05:05:13 +08:00
|
|
|
$ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
|
2002-10-11 03:01:34 +08:00
|
|
|
rm -f $ARCHIVE.gz
|
2000-05-07 08:18:06 +08:00
|
|
|
tar cf $ARCHIVE $PKG-$VER || exit 8
|
|
|
|
gzip -9 $ARCHIVE || exit 9
|
1999-04-08 05:05:13 +08:00
|
|
|
echo ""
|
|
|
|
|
2002-08-24 17:56:51 +08:00
|
|
|
$ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C"
|
2002-10-11 03:01:34 +08:00
|
|
|
rm -f $ARCHIVE.bz2
|
2002-08-24 17:56:51 +08:00
|
|
|
tar cf $ARCHIVE $PKG-$VER || exit 10
|
|
|
|
bzip2 -9 $ARCHIVE || exit 11
|
|
|
|
echo ""
|
|
|
|
|
1999-04-08 05:05:13 +08:00
|
|
|
$ECHO_N "makedist: cleaning up...$ECHO_C"
|
2002-08-24 17:56:51 +08:00
|
|
|
rm -rf $DIRPATH || exit 12
|
1999-04-08 05:05:13 +08:00
|
|
|
echo ""
|
|
|
|
|
|
|
|
exit 0
|