Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 149 lines (123 sloc) 3.574 kb
aceaabc @zsuraski PHP 4.0
zsuraski authored
1 #!/bin/sh
2 #
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
3 # Distribution generator for SVN based packages.
aceaabc @zsuraski PHP 4.0
zsuraski authored
4 # To work, this script needs a consistent tagging of all releases.
5 # Each release of a package should have a tag of the form
6 #
7 # <package>_<version>
8 #
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
9 # where <package> is the package name and the SVN module
aceaabc @zsuraski PHP 4.0
zsuraski authored
10 # and <version> s the version number with underscores instead of dots.
11 #
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
12 # For example: svn cp $PHPROOT/php/php-src/trunk $PHPROOT/php/php-src/tags/php_5_0_1
aceaabc @zsuraski PHP 4.0
zsuraski authored
13 #
14 # The distribution ends up in a .tar.gz file that contains the distribution
15 # in a directory called <package>-<version>. The distribution contains all
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
16 # directories from the SVN module except the one called "nodist", but only
aceaabc @zsuraski PHP 4.0
zsuraski authored
17 # the files INSTALL, README and config* are included.
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
18 # A .tar.bz2 file is also created.
aceaabc @zsuraski PHP 4.0
zsuraski authored
19 #
20 # Usage: makedist <package> <version>
21 #
22 # Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
23 #
24 # $Id$
25 #
26
2573a50 Fix Bison version check
Sascha Schumann authored
27 if test "$#" != "2"; then
28 echo "Usage: makedist <package> <version>" >&2
29 exit 1
30 fi
31
32 PKG=$1 ; shift
33 VER=$1 ; shift
34
35 old_IFS="$IFS"
36 IFS=.
85682d5 - Fix makedist
Derick Rethans authored
37 eval set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'`
38 if test "${1}" = "1" -a "${2}" -lt "28"; then
39 echo "You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)"
2573a50 Fix Bison version check
Sascha Schumann authored
40 exit 10
41 fi
42 IFS="$old_IFS"
773e306 Add check for Bison. A recent version is required when in ZTS mode.
Sascha Schumann authored
43
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
44 PHPROOT=http://svn.php.net/repository
45 PHPMOD=php/php-src
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
46 LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'
aceaabc @zsuraski PHP 4.0
zsuraski authored
47
48 if echo '\c' | grep -s c >/dev/null 2>&1
49 then
50 ECHO_N="echo -n"
51 ECHO_C=""
52 else
53 ECHO_N="echo"
54 ECHO_C='\c'
55 fi
56
7af3ce6 @zsuraski Oki doki
zsuraski authored
57 MY_OLDPWD=`pwd`
aceaabc @zsuraski PHP 4.0
zsuraski authored
58
59 # the destination .tar.gz file
679bcde Avoid relying on non-standard tar `z' option.
Sascha Schumann authored
60 ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar
aceaabc @zsuraski PHP 4.0
zsuraski authored
61
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
62 # temporary directory used to check out files from SVN
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
63 DIR=$PKG-$VER
64 DIRPATH=$MY_OLDPWD/$DIR
aceaabc @zsuraski PHP 4.0
zsuraski authored
65
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
66 if test -d "$DIRPATH"; then
67 echo "The directory $DIR"
aa3123e # Updated to work with the new build system.
Stig Bakken authored
68 echo "already exists, rename or remove it and run makedist again."
69 exit 1
70 fi
71
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
72 # version part of the SVN release tag
73 SVNVER=`echo $VER | sed -e 's/[\.\-]/_/g'`
aceaabc @zsuraski PHP 4.0
zsuraski authored
74
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
75 # SVN release tag
76 if test "$VER" != "HEAD" -a "$VER" != "trunk"; then
77 SVNTAG=tags/${PKG}_$SVNVER
9a0f988 - Removed unnecessary makedist.ZendEngine2
foobar authored
78 else
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
79 SVNTAG=trunk
9a0f988 - Removed unnecessary makedist.ZendEngine2
foobar authored
80 fi
aceaabc @zsuraski PHP 4.0
zsuraski authored
81
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
82 #if test ! -d $DIRPATH; then
83 # mkdir -p $DIRPATH || exit 2
84 #fi
aceaabc @zsuraski PHP 4.0
zsuraski authored
85
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored
86 # Export PHP
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
87 $ECHO_N "makedist: exporting tag '$SVNTAG' from '$PHPMOD'...$ECHO_C"
88 svn export $PHPROOT/$PHPMOD/$SVNTAG $DIRPATH || exit 4
aceaabc @zsuraski PHP 4.0
zsuraski authored
89 echo ""
90
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
91 # remove SVN stuff...
9a0f988 - Removed unnecessary makedist.ZendEngine2
foobar authored
92 cd $DIR || exit 5
1020d90 MFH: CVS->SVN
Gwynne Raskind authored
93 find . \( -name .svn -type d \) -exec rm -rf {} \;
aceaabc @zsuraski PHP 4.0
zsuraski authored
94
ec6c171 Typo.
Andrei Zmievski authored
95 # The full ChangeLog is available separately from lxr.php.net
9a0f988 - Removed unnecessary makedist.ZendEngine2
foobar authored
96 rm -f ChangeLog*
61b88ae Don't distribute ChangeLog. You can download it from lxr.php.net
Sascha Schumann authored
97
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
98 # hide away our own versions of libtool-generated files
99 for i in $LT_TARGETS; do
100 if test -f "$i"; then
101 mv $i $i.bak
102 cp $i.bak $i
103 fi
104 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored
105
aceaabc @zsuraski PHP 4.0
zsuraski authored
106 # generate some files so people don't need bison, flex and autoconf
107 # to install
108 set -x
8338bea @wez --force here too for release packages
wez authored
109 ./buildconf --copy --force
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored
110
b224dd9 Don't distribute buildmk.stamp to the end user. Otherwise, buildcheck.sh
Sascha Schumann authored
111 # remove buildmk.stamp. Otherwise, buildcheck.sh might not be run,
112 # when a user runs buildconf in the distribution.
113 rm -f buildmk.stamp
114
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored
115 ./genfiles
116
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
117 # now restore our versions of libtool-generated files
118 for i in $LT_TARGETS; do
119 test -f "$i" && mv $i.bak $i
120 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored
121
aa19f65 Download pear phar file when making a distribution package
Ilia Alshanetsky authored
122 # download pear
123 $ECHO_N "makedist: Attempting to download PEAR's phar archive"
124 if test ! -x wget; then
125 wget http://pear.php.net/install-pear-nozlib.phar -nd -P pear/
126 else
127 $ECHO_N "Missing wget binary needed for pear download";
128 exit 0;
129 fi
130
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
131 cd $MY_OLDPWD
aceaabc @zsuraski PHP 4.0
zsuraski authored
132 $ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
38b52fd - Argh... test before commit
Derick Rethans authored
133 rm -f $ARCHIVE.gz
679bcde Avoid relying on non-standard tar `z' option.
Sascha Schumann authored
134 tar cf $ARCHIVE $PKG-$VER || exit 8
135 gzip -9 $ARCHIVE || exit 9
aceaabc @zsuraski PHP 4.0
zsuraski authored
136 echo ""
137
4d28335 - Also make bz2 archives
Derick Rethans authored
138 $ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C"
38b52fd - Argh... test before commit
Derick Rethans authored
139 rm -f $ARCHIVE.bz2
4d28335 - Also make bz2 archives
Derick Rethans authored
140 tar cf $ARCHIVE $PKG-$VER || exit 10
141 bzip2 -9 $ARCHIVE || exit 11
142 echo ""
143
aceaabc @zsuraski PHP 4.0
zsuraski authored
144 $ECHO_N "makedist: cleaning up...$ECHO_C"
4d28335 - Also make bz2 archives
Derick Rethans authored
145 rm -rf $DIRPATH || exit 12
aceaabc @zsuraski PHP 4.0
zsuraski authored
146 echo ""
147
148 exit 0
Something went wrong with that request. Please try again.