Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 149 lines (121 sloc) 3.61 kb
aceaabc @zsuraski 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 #
12 # For example: cvs tag php_3_0a1
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=.
40 eval set `bison -V|sed "s/GNU Bison version //"`
41 if test "$1" = "1" && test "28" -gt "$2"; then
42 echo "Please use Bison 1.28 or higher"
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
9bb36e9 @zsuraski Some work on makedist
zsuraski authored
48 ZENDROOT=:pserver:cvsread@cvs.zend.com:/repository
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored
49 PHPMOD=php4
4d2b071 @zsuraski libzend -> Zend
zsuraski authored
50 ZENDMOD=Zend
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored
51 TSRMMOD=TSRM
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
52 LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'
aceaabc @zsuraski PHP 4.0
zsuraski authored
53
54 if echo '\c' | grep -s c >/dev/null 2>&1
55 then
56 ECHO_N="echo -n"
57 ECHO_C=""
58 else
59 ECHO_N="echo"
60 ECHO_C='\c'
61 fi
62
7af3ce6 @zsuraski Oki doki
zsuraski authored
63 MY_OLDPWD=`pwd`
aceaabc @zsuraski PHP 4.0
zsuraski authored
64
65 # the destination .tar.gz file
679bcde Avoid relying on non-standard tar `z' option.
Sascha Schumann authored
66 ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar
aceaabc @zsuraski PHP 4.0
zsuraski authored
67
68 # temporary directory used to check out files from CVS
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
69 DIR=$PKG-$VER
70 DIRPATH=$MY_OLDPWD/$DIR
aceaabc @zsuraski PHP 4.0
zsuraski authored
71
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
72 if test -d "$DIRPATH"; then
73 echo "The directory $DIR"
aa3123e # Updated to work with the new build system.
Stig Bakken authored
74 echo "already exists, rename or remove it and run makedist again."
75 exit 1
76 fi
77
aceaabc @zsuraski PHP 4.0
zsuraski authored
78 # version part of the CVS release tag
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
79 CVSVER=`echo $VER | sed -e 's/[\.\-]/_/g'`
aceaabc @zsuraski PHP 4.0
zsuraski authored
80
81 # CVS release tag
82 CVSTAG=${PKG}_$CVSVER
83
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
84 if test ! -d $DIRPATH; then
85 mkdir -p $DIRPATH || exit 2
aceaabc @zsuraski PHP 4.0
zsuraski authored
86 fi
87
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
88 #cd $DIRPATH || exit 3
aceaabc @zsuraski PHP 4.0
zsuraski authored
89
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored
90 # Export PHP
91 $ECHO_N "makedist: exporting tag '$CVSTAG' from '$PHPMOD'...$ECHO_C"
8419dc3 @zsuraski Use compression for makedist
zsuraski authored
92 cvs -z 9 -d $PHPROOT -Q export -d $DIR -r $CVSTAG $PHPMOD || exit 4
aceaabc @zsuraski PHP 4.0
zsuraski authored
93 echo ""
94
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored
95 # Export the other modules inside the PHP directory
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
96 cd $DIR || exit 5
aceaabc @zsuraski PHP 4.0
zsuraski authored
97
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored
98 # Export Zend
9bb36e9 @zsuraski Some work on makedist
zsuraski authored
99 $ECHO_N "makedist: exporting tag '$CVSTAG' from '$ZENDMOD'...$ECHO_C"
8419dc3 @zsuraski Use compression for makedist
zsuraski authored
100 cvs -z 9 -d $ZENDROOT -Q export -r $CVSTAG $ZENDMOD || exit 4
7af3ce6 @zsuraski Oki doki
zsuraski authored
101 echo ""
9bb36e9 @zsuraski Some work on makedist
zsuraski authored
102
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored
103 # Export TSRM
9bb36e9 @zsuraski Some work on makedist
zsuraski authored
104 $ECHO_N "makedist: exporting tag '$CVSTAG' from '$TSRMMOD'...$ECHO_C"
8419dc3 @zsuraski Use compression for makedist
zsuraski authored
105 cvs -z 9 -d $ZENDROOT -Q export -r $CVSTAG $TSRMMOD || exit 4
7af3ce6 @zsuraski Oki doki
zsuraski authored
106 echo ""
9bb36e9 @zsuraski Some work on makedist
zsuraski authored
107
aceaabc @zsuraski PHP 4.0
zsuraski authored
108 # remove CVS stuff...
109 find . \( \( -name CVS -type d \) -o -name .cvsignore \) -exec rm -rf {} \;
110
ec6c171 Typo.
Andrei Zmievski authored
111 # The full ChangeLog is available separately from lxr.php.net
61b88ae Don't distribute ChangeLog. You can download it from lxr.php.net
Sascha Schumann authored
112 rm ChangeLog
113
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
114 # hide away our own versions of libtool-generated files
115 for i in $LT_TARGETS; do
116 if test -f "$i"; then
117 mv $i $i.bak
118 cp $i.bak $i
119 fi
120 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored
121
aceaabc @zsuraski PHP 4.0
zsuraski authored
122 # generate some files so people don't need bison, flex and autoconf
123 # to install
124 set -x
3736b9b use optional copy
Sascha Schumann authored
125 ./buildconf --copy
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored
126
b224dd9 Don't distribute buildmk.stamp to the end user. Otherwise, buildcheck.sh
Sascha Schumann authored
127 # remove buildmk.stamp. Otherwise, buildcheck.sh might not be run,
128 # when a user runs buildconf in the distribution.
129 rm -f buildmk.stamp
130
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored
131 ./genfiles
132
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
133 # now restore our versions of libtool-generated files
134 for i in $LT_TARGETS; do
135 test -f "$i" && mv $i.bak $i
136 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored
137
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
138 cd $MY_OLDPWD
aceaabc @zsuraski PHP 4.0
zsuraski authored
139 $ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
679bcde Avoid relying on non-standard tar `z' option.
Sascha Schumann authored
140 tar cf $ARCHIVE $PKG-$VER || exit 8
141 gzip -9 $ARCHIVE || exit 9
aceaabc @zsuraski PHP 4.0
zsuraski authored
142 echo ""
143
144 $ECHO_N "makedist: cleaning up...$ECHO_C"
679bcde Avoid relying on non-standard tar `z' option.
Sascha Schumann authored
145 rm -rf $DIRPATH || exit 10
aceaabc @zsuraski PHP 4.0
zsuraski authored
146 echo ""
147
148 exit 0
Something went wrong with that request. Please try again.