Skip to content
Newer
Older
100755 135 lines (109 sloc) 3.19 KB
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
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
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored Nov 9, 1999
30 PHPROOT=:pserver:cvsread@cvs.php.net:/repository
9bb36e9 @zsuraski Some work on makedist
zsuraski authored Jul 17, 1999
31 ZENDROOT=:pserver:cvsread@cvs.zend.com:/repository
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored Nov 9, 1999
32 PHPMOD=php4
33 ZENDMOD=libzend
34 TSRMMOD=TSRM
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored Nov 10, 1999
35 LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
36
37 if echo '\c' | grep -s c >/dev/null 2>&1
38 then
39 ECHO_N="echo -n"
40 ECHO_C=""
41 else
42 ECHO_N="echo"
43 ECHO_C='\c'
44 fi
45
46 if test "$#" != "2"; then
47 echo "Usage: makedist <package> <version>" >&2
48 exit 1
49 fi
50
51 PKG=$1 ; shift
52 VER=$1 ; shift
53
7af3ce6 @zsuraski Oki doki
zsuraski authored Jul 17, 1999
54 MY_OLDPWD=`pwd`
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
55
56 # the destination .tar.gz file
7af3ce6 @zsuraski Oki doki
zsuraski authored Jul 17, 1999
57 ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar.gz
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
58
59 # temporary directory used to check out files from CVS
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
60 DIR=$PKG-$VER
61 DIRPATH=$MY_OLDPWD/$DIR
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
62
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
63 if test -d "$DIRPATH"; then
64 echo "The directory $DIR"
aa3123e # Updated to work with the new build system.
Stig Bakken authored Nov 4, 1999
65 echo "already exists, rename or remove it and run makedist again."
66 exit 1
67 fi
68
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
69 # version part of the CVS release tag
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
70 CVSVER=`echo $VER | sed -e 's/[\.\-]/_/g'`
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
71
72 # CVS release tag
73 CVSTAG=${PKG}_$CVSVER
74
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
75 if test ! -d $DIRPATH; then
76 mkdir -p $DIRPATH || exit 2
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
77 fi
78
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
79 #cd $DIRPATH || exit 3
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
80
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored Nov 9, 1999
81 # Export PHP
82 $ECHO_N "makedist: exporting tag '$CVSTAG' from '$PHPMOD'...$ECHO_C"
83 cvs -d $PHPROOT -Q export -d $DIR -r $CVSTAG $PHPMOD || exit 4
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
84 echo ""
85
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored Nov 9, 1999
86 # Export the other modules inside the PHP directory
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
87 cd $DIR || exit 5
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
88
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored Nov 9, 1999
89 # Export Zend
9bb36e9 @zsuraski Some work on makedist
zsuraski authored Jul 17, 1999
90 $ECHO_N "makedist: exporting tag '$CVSTAG' from '$ZENDMOD'...$ECHO_C"
91 cvs -d $ZENDROOT -Q export -r $CVSTAG $ZENDMOD || exit 4
7af3ce6 @zsuraski Oki doki
zsuraski authored Jul 17, 1999
92 echo ""
9bb36e9 @zsuraski Some work on makedist
zsuraski authored Jul 17, 1999
93
60766ef Makedist can now be run from outside the CVS tree.
Stig Bakken authored Nov 9, 1999
94 # Export TSRM
9bb36e9 @zsuraski Some work on makedist
zsuraski authored Jul 17, 1999
95 $ECHO_N "makedist: exporting tag '$CVSTAG' from '$TSRMMOD'...$ECHO_C"
96 cvs -d $ZENDROOT -Q export -r $CVSTAG $TSRMMOD || exit 4
7af3ce6 @zsuraski Oki doki
zsuraski authored Jul 17, 1999
97 echo ""
9bb36e9 @zsuraski Some work on makedist
zsuraski authored Jul 17, 1999
98
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
99 # remove CVS stuff...
100 find . \( \( -name CVS -type d \) -o -name .cvsignore \) -exec rm -rf {} \;
101
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored Nov 10, 1999
102 # hide away our own versions of libtool-generated files
103 for i in $LT_TARGETS; do
104 if test -f "$i"; then
105 mv $i $i.bak
106 cp $i.bak $i
107 fi
108 done
2204607 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
Stig Bakken authored Nov 9, 1999
109
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
110 # generate some files so people don't need bison, flex and autoconf
111 # to install
112 set -x
3736b9b use optional copy
Sascha Schumann authored Jul 17, 1999
113 ./buildconf --copy
693207a Generate files for distribution (also adds parsedate.c)
Sascha Schumann authored Oct 5, 1999
114
115 ./genfiles
116
e19abb9 @zsuraski *** empty log message ***
zsuraski authored Jul 19, 1999
117 echo "/* Dummy File */" > ext/bcmath/number.c
118 echo "/* Dummy File */" > ext/bcmath/number.h
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
119
6e4114d "import" libtool file preservation code from build.mk
Stig Bakken authored Nov 10, 1999
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 Nov 9, 1999
124
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
125 cd $MY_OLDPWD
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
126 $ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
127 tar czf $ARCHIVE $PKG-$VER || exit 8
128 echo ""
129
130 $ECHO_N "makedist: cleaning up...$ECHO_C"
ecf8373 Cleaned up makedist a bit more.
Stig Bakken authored Nov 8, 1999
131 rm -rf $DIRPATH || exit 9
aceaabc @zsuraski PHP 4.0
zsuraski authored Apr 7, 1999
132 echo ""
133
134 exit 0
Something went wrong with that request. Please try again.