Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 127 lines (103 sloc) 2.943 kb
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
1 #!/bin/sh
2 #
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
3 # Distribution generator for git
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
4 #
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
5 # Usage: makedist version
6 # Example: makedist 5.4.1
7 # Example: makedist 5.3.5-RC1
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
8 #
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
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 Zeev Suraski PHP 4.0
zsuraski authored
11 #
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
12 # PHP-X.Y.Z[-sub]
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
13 #
14 # The distribution ends up in a .tar.gz file that contains the distribution
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
15 # in a directory called php-<version>.
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
16 # A .tar.bz2 file is also created.
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
17 #
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
18 # Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
19 # Adapted to git by Stanislav Malyshev <stas@php.net>
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
20
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
21
22 if test "$#" != "1"; then
23 echo "Usage: makedist <version>" >&2
2573a50 Fix Bison version check
Sascha Schumann authored
24 exit 1
25 fi
26
27 VER=$1 ; shift
28
29 old_IFS="$IFS"
30 IFS=.
85682d5 - Fix makedist
Derick Rethans authored
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}).)"
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
34 exit 2
2573a50 Fix Bison version check
Sascha Schumann authored
35 fi
36 IFS="$old_IFS"
773e306 Add check for Bison. A recent version is required when in ZTS mode.
Sascha Schumann authored
37
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
38 PHPROOT=git@git.php.net:php-src.git
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
39 LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
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 Zeev Suraski Oki doki
zsuraski authored
50 MY_OLDPWD=`pwd`
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
51
52 # the destination .tar.gz file
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
53 ARCHIVE=$MY_OLDPWD/php-$VER.tar
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
54
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
55 # temporary directory used to check out files from SVN
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
56 DIR=php-$VER
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
57 DIRPATH=$MY_OLDPWD/$DIR
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
58
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
59 if test -d "$DIRPATH"; then
60 echo "The directory $DIR"
aa3123e # Updated to work with the new build system.
Stig Bakken authored
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
65 # Export PHP
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
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 Zeev Suraski PHP 4.0
zsuraski authored
68 echo ""
69
9a0f988 - Removed unnecessary makedist.ZendEngine2
foobar authored
70 cd $DIR || exit 5
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
71
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
72 # hide away our own versions of libtool-generated files
73 for i in $LT_TARGETS; do
74 if test -f "$i"; then
75 mv $i $i.bak
76 cp $i.bak $i
77 fi
78 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored
79
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
80 # generate some files so people don't need bison, flex and autoconf
81 # to install
82 set -x
8338bea Wez Furlong --force here too for release packages
wez authored
83 ./buildconf --copy --force
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored
84
b224dd9 Don't distribute buildmk.stamp to the end user. Otherwise, buildcheck.sh
Sascha Schumann authored
85 # remove buildmk.stamp. Otherwise, buildcheck.sh might not be run,
86 # when a user runs buildconf in the distribution.
87 rm -f buildmk.stamp
88
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored
89 ./genfiles
90
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
91 # now restore our versions of libtool-generated files
92 for i in $LT_TARGETS; do
93 test -f "$i" && mv $i.bak $i
94 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored
95
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
96 # removing junk files
97 find . -name \*.orig -print0 | xargs -0 rm
98 rm -fr autom4te.cache/
99
aa19f65 Download pear phar file when making a distribution package
Ilia Alshanetsky authored
100 # download pear
101 $ECHO_N "makedist: Attempting to download PEAR's phar archive"
102 if test ! -x wget; then
103 wget http://pear.php.net/install-pear-nozlib.phar -nd -P pear/
104 else
105 $ECHO_N "Missing wget binary needed for pear download";
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
106 exit 7
aa19f65 Download pear phar file when making a distribution package
Ilia Alshanetsky authored
107 fi
108
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
109 cd $MY_OLDPWD
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
110 $ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
38b52fd - Argh... test before commit
Derick Rethans authored
111 rm -f $ARCHIVE.gz
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
112 tar cf $ARCHIVE php-$VER || exit 8
679bcde Avoid relying on non-standard tar `z' option.
Sascha Schumann authored
113 gzip -9 $ARCHIVE || exit 9
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
114 echo ""
115
4d28335 - Also make bz2 archives
Derick Rethans authored
116 $ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C"
38b52fd - Argh... test before commit
Derick Rethans authored
117 rm -f $ARCHIVE.bz2
cb4e82a Stanislav Malyshev adapt makedist to git
smalyshev authored
118 tar cf $ARCHIVE php-$VER || exit 10
4d28335 - Also make bz2 archives
Derick Rethans authored
119 bzip2 -9 $ARCHIVE || exit 11
120 echo ""
121
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
122 $ECHO_N "makedist: cleaning up...$ECHO_C"
4d28335 - Also make bz2 archives
Derick Rethans authored
123 rm -rf $DIRPATH || exit 12
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
124 echo ""
125
126 exit 0
Something went wrong with that request. Please try again.