Skip to content
Newer
Older
100755 130 lines (105 sloc) 2.95 KB
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
1 #!/bin/sh
2 #
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 19, 2012
3 # Distribution generator for git
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
4 #
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
5 # Usage: makedist version
6 # Example: makedist 5.4.1
7 # Example: makedist 5.3.5-RC1
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
8 #
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
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
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
11 #
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
12 # PHP-X.Y.Z[-sub]
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
13 #
14 # The distribution ends up in a .tar.gz file that contains the distribution
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
15 # in a directory called php-<version>.
1020d90 MFH: CVS->SVN
Gwynne Raskind authored Jul 14, 2009
16 # A .tar.bz2 file is also created.
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
17 #
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
18 # Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
19 # Adapted to git by Stanislav Malyshev <stas@php.net>
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
20
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
21
22 if test "$#" != "1"; then
23 echo "Usage: makedist <version>" >&2
2573a50 Fix Bison version check
Sascha Schumann authored Jun 25, 2000
24 exit 1
25 fi
26
27 VER=$1 ; shift
28
29 old_IFS="$IFS"
30 IFS=.
85682d5 - Fix makedist
Derick Rethans authored Mar 20, 2002
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}).)"
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
34 exit 2
2573a50 Fix Bison version check
Sascha Schumann authored Jun 25, 2000
35 fi
36 IFS="$old_IFS"
773e306 Add check for Bison. A recent version is required when in ZTS mode.
Sascha Schumann authored May 23, 2000
37
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
38 PHPROOT=git@git.php.net:php-src.git
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored Nov 10, 1999
39 LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
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
7af3ce6 @zsuraski Oki doki
zsuraski authored Jul 17, 1999
50 MY_OLDPWD=`pwd`
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
51
52 # the destination .tar.gz file
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
53 ARCHIVE=$MY_OLDPWD/php-$VER.tar
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
54
1020d90 MFH: CVS->SVN
Gwynne Raskind authored Jul 14, 2009
55 # temporary directory used to check out files from SVN
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
56 DIR=php-$VER
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
57 DIRPATH=$MY_OLDPWD/$DIR
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
58
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
59 if test -d "$DIRPATH"; then
60 echo "The directory $DIR"
aa3123e # Updated to work with the new build system.
Stig Bakken authored Nov 4, 1999
61 echo "already exists, rename or remove it and run makedist again."
62 exit 1
63 fi
64
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored Nov 9, 1999
65 # Export PHP
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
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
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
68 echo ""
69
9a0f988 - Removed unnecessary makedist.ZendEngine2
foobar authored Jan 28, 2003
70 cd $DIR || exit 5
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
71
ec6c171 Typo.
Andrei Zmievski authored May 4, 2000
72 # The full ChangeLog is available separately from lxr.php.net
9a0f988 - Removed unnecessary makedist.ZendEngine2
foobar authored Jan 28, 2003
73 rm -f ChangeLog*
61b88ae Don't distribute ChangeLog. You can download it from lxr.php.net
Sascha Schumann authored May 4, 2000
74
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored Nov 10, 1999
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
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored Nov 9, 1999
82
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
83 # generate some files so people don't need bison, flex and autoconf
84 # to install
85 set -x
8338bea @wez --force here too for release packages
wez authored May 22, 2003
86 ./buildconf --copy --force
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored Oct 5, 1999
87
b224dd9 Don't distribute buildmk.stamp to the end user. Otherwise, buildcheck.sh
Sascha Schumann authored Aug 24, 2000
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
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored Oct 5, 1999
92 ./genfiles
93
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored Nov 10, 1999
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
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored Nov 9, 1999
98
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
99 # removing junk files
100 find . -name \*.orig -print0 | xargs -0 rm
101 rm -fr autom4te.cache/
102
aa19f65 Download pear phar file when making a distribution package
Ilia Alshanetsky authored May 12, 2006
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";
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
109 exit 7
aa19f65 Download pear phar file when making a distribution package
Ilia Alshanetsky authored May 12, 2006
110 fi
111
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
112 cd $MY_OLDPWD
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
113 $ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
38b52fd - Argh... test before commit
Derick Rethans authored Oct 10, 2002
114 rm -f $ARCHIVE.gz
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
115 tar cf $ARCHIVE php-$VER || exit 8
679bcde Avoid relying on non-standard tar `z' option.
Sascha Schumann authored May 7, 2000
116 gzip -9 $ARCHIVE || exit 9
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
117 echo ""
118
4d28335 - Also make bz2 archives
Derick Rethans authored Aug 24, 2002
119 $ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C"
38b52fd - Argh... test before commit
Derick Rethans authored Oct 10, 2002
120 rm -f $ARCHIVE.bz2
44d9489 @smalyshev adapt makedist to git
smalyshev authored Mar 20, 2012
121 tar cf $ARCHIVE php-$VER || exit 10
4d28335 - Also make bz2 archives
Derick Rethans authored Aug 24, 2002
122 bzip2 -9 $ARCHIVE || exit 11
123 echo ""
124
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
125 $ECHO_N "makedist: cleaning up...$ECHO_C"
4d28335 - Also make bz2 archives
Derick Rethans authored Aug 24, 2002
126 rm -rf $DIRPATH || exit 12
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
127 echo ""
128
129 exit 0
Something went wrong with that request. Please try again.