Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 146 lines (119 sloc) 3.565 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=.
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
85682d5 - Fix makedist
Derick Rethans authored
48 ZENDROOT=:pserver:cvsread@cvs.php.net:/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"
5ed9e75 - Update makedist script
Derick Rethans authored
92 cvs -z 9 -d $PHPROOT 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
98 # remove CVS stuff...
99 find . \( \( -name CVS -type d \) -o -name .cvsignore \) -exec rm -rf {} \;
100
ec6c171 Typo.
Andrei Zmievski authored
101 # The full ChangeLog is available separately from lxr.php.net
0abd719 don't include old changelogs in distribution, either
jim winstead authored
102 rm ChangeLog*
61b88ae Don't distribute ChangeLog. You can download it from lxr.php.net
Sascha Schumann authored
103
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
104 # hide away our own versions of libtool-generated files
105 for i in $LT_TARGETS; do
106 if test -f "$i"; then
107 mv $i $i.bak
108 cp $i.bak $i
109 fi
110 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored
111
aceaabc @zsuraski PHP 4.0
zsuraski authored
112 # generate some files so people don't need bison, flex and autoconf
113 # to install
114 set -x
3736b9b use optional copy
Sascha Schumann authored
115 ./buildconf --copy
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored
116
b224dd9 Don't distribute buildmk.stamp to the end user. Otherwise, buildcheck.sh
Sascha Schumann authored
117 # remove buildmk.stamp. Otherwise, buildcheck.sh might not be run,
118 # when a user runs buildconf in the distribution.
119 rm -f buildmk.stamp
120
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored
121 ./genfiles
122
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored
123 # now restore our versions of libtool-generated files
124 for i in $LT_TARGETS; do
125 test -f "$i" && mv $i.bak $i
126 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored
127
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored
128 cd $MY_OLDPWD
aceaabc @zsuraski PHP 4.0
zsuraski authored
129 $ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
5ed9e75 - Update makedist script
Derick Rethans authored
130 rm -f $ARCHIVEt.tar.gz
679bcde Avoid relying on non-standard tar `z' option.
Sascha Schumann authored
131 tar cf $ARCHIVE $PKG-$VER || exit 8
132 gzip -9 $ARCHIVE || exit 9
aceaabc @zsuraski PHP 4.0
zsuraski authored
133 echo ""
134
4d28335 - Also make bz2 archives
Derick Rethans authored
135 $ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C"
5ed9e75 - Update makedist script
Derick Rethans authored
136 rm -f $ARCHIVEt.tar.bz2
4d28335 - Also make bz2 archives
Derick Rethans authored
137 tar cf $ARCHIVE $PKG-$VER || exit 10
138 bzip2 -9 $ARCHIVE || exit 11
139 echo ""
140
aceaabc @zsuraski PHP 4.0
zsuraski authored
141 $ECHO_N "makedist: cleaning up...$ECHO_C"
4d28335 - Also make bz2 archives
Derick Rethans authored
142 rm -rf $DIRPATH || exit 12
aceaabc @zsuraski PHP 4.0
zsuraski authored
143 echo ""
144
145 exit 0
Something went wrong with that request. Please try again.