Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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