Annotation of embedaddon/php/makedist, revision 1.1.1.2

1.1       misho       1: #!/bin/sh
                      2: #
1.1.1.2 ! misho       3: # Distribution generator for git
1.1       misho       4: #
1.1.1.2 ! misho       5: # Usage: makedist version
        !             6: # Example: makedist 5.4.1
        !             7: # Example: makedist 5.3.5-RC1
1.1       misho       8: #
1.1.1.2 ! misho       9: # To work, this script needs a consistent tagging of all releases.
        !            10: # Each release of a package should have a tag of the form
1.1       misho      11: #
1.1.1.2 ! misho      12: #  PHP-X.Y.Z[-sub]
1.1       misho      13: #
                     14: # The distribution ends up in a .tar.gz file that contains the distribution
1.1.1.2 ! misho      15: # in a directory called php-<version>.  
1.1       misho      16: # A .tar.bz2 file is also created.
1.1.1.2 ! misho      17: # 
1.1       misho      18: # Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
1.1.1.2 ! misho      19: # Adapted to git by Stanislav Malyshev <stas@php.net>
1.1       misho      20: 
1.1.1.2 ! misho      21: 
        !            22: if test "$#" != "1"; then
        !            23:     echo "Usage: makedist <version>" >&2
1.1       misho      24:     exit 1
                     25: fi
                     26: 
                     27: VER=$1 ; shift
                     28: 
                     29: old_IFS="$IFS"
                     30: IFS=.
                     31: eval set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'`
                     32: if test "${1}" = "1" -a "${2}" -lt "28"; then
                     33:   echo "You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)"
1.1.1.2 ! misho      34:   exit 2
1.1       misho      35: fi
                     36: IFS="$old_IFS"
                     37: 
1.1.1.2 ! misho      38: PHPROOT=git@git.php.net:php-src.git
1.1       misho      39: LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'
                     40: 
                     41: if echo '\c' | grep -s c >/dev/null 2>&1
                     42: then
                     43:     ECHO_N="echo -n"
                     44:     ECHO_C=""
                     45: else
                     46:     ECHO_N="echo"
                     47:     ECHO_C='\c'
                     48: fi
                     49: 
                     50: MY_OLDPWD=`pwd`
                     51: 
                     52: # the destination .tar.gz file
1.1.1.2 ! misho      53: ARCHIVE=$MY_OLDPWD/php-$VER.tar
1.1       misho      54: 
                     55: # temporary directory used to check out files from SVN
1.1.1.2 ! misho      56: DIR=php-$VER
1.1       misho      57: DIRPATH=$MY_OLDPWD/$DIR
                     58: 
                     59: if test -d "$DIRPATH"; then
                     60:     echo "The directory $DIR"
                     61:     echo "already exists, rename or remove it and run makedist again."
                     62:     exit 1
                     63: fi
                     64: 
                     65: # Export PHP
1.1.1.2 ! misho      66: $ECHO_N "makedist: exporting tag 'PHP-$VER' from '$PHPROOT'...$ECHO_C"
        !            67: git archive --format=tar --remote=$PHPROOT refs/tags/PHP-$VER --prefix=php-$VER/ | (cd $MY_OLDPWD; tar xvf -) || exit 4
1.1       misho      68: echo ""
                     69: 
                     70: cd $DIR || exit 5
                     71: 
                     72: # The full ChangeLog is available separately from lxr.php.net
                     73: rm -f ChangeLog*
                     74: 
                     75: # hide away our own versions of libtool-generated files
                     76: for i in $LT_TARGETS; do
                     77:   if test -f "$i"; then
                     78:     mv $i $i.bak
                     79:     cp $i.bak $i
                     80:   fi
                     81: done
                     82: 
                     83: # generate some files so people don't need bison, flex and autoconf
                     84: # to install
                     85: set -x
                     86: ./buildconf --copy --force
                     87: 
                     88: # remove buildmk.stamp. Otherwise, buildcheck.sh might not be run,
                     89: # when a user runs buildconf in the distribution.
                     90: rm -f buildmk.stamp
                     91: 
                     92: ./genfiles
                     93: 
                     94: # now restore our versions of libtool-generated files
                     95: for i in $LT_TARGETS; do
                     96:   test -f "$i" && mv $i.bak $i
                     97: done
                     98: 
1.1.1.2 ! misho      99: # removing junk files
        !           100: find . -name \*.orig -print0 | xargs -0 rm
        !           101: rm -fr autom4te.cache/
        !           102: 
1.1       misho     103: # download pear 
                    104: $ECHO_N "makedist: Attempting to download PEAR's phar archive"
                    105: if test ! -x wget; then
                    106:        wget http://pear.php.net/install-pear-nozlib.phar -nd -P pear/
                    107: else
                    108:        $ECHO_N "Missing wget binary needed for pear download";
1.1.1.2 ! misho     109:        exit 7
1.1       misho     110: fi
                    111: 
                    112: cd $MY_OLDPWD
                    113: $ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
                    114: rm -f $ARCHIVE.gz
1.1.1.2 ! misho     115: tar cf $ARCHIVE php-$VER || exit 8
1.1       misho     116: gzip -9 $ARCHIVE || exit 9
                    117: echo ""
                    118: 
                    119: $ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C"
                    120: rm -f $ARCHIVE.bz2
1.1.1.2 ! misho     121: tar cf $ARCHIVE php-$VER || exit 10
1.1       misho     122: bzip2 -9 $ARCHIVE || exit 11
                    123: echo ""
                    124: 
                    125: $ECHO_N "makedist: cleaning up...$ECHO_C"
                    126: rm -rf $DIRPATH || exit 12
                    127: echo ""
                    128: 
                    129: exit 0

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>