1
1
#! /bin/sh
2
2
#
3
- # Distribution generator for SVN 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
3
+ # Distribution generator for git
6
4
#
7
- # <package>_<version>
5
+ # Usage: makedist version
6
+ # Example: makedist 5.4.1
7
+ # Example: makedist 5.3.5-RC1
8
8
#
9
- # where <package> is the package name and the SVN module
10
- # and <version> s the version number with underscores instead of dots.
9
+ # To work, this script needs a consistent tagging of all releases.
10
+ # Each release of a package should have a tag of the form
11
11
#
12
- # For example: svn cp $PHPROOT/php/php-src/trunk $PHPROOT/php/php-src/tags/php_5_0_1
12
+ # PHP-X.Y.Z[-sub]
13
13
#
14
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 SVN module except the one called "nodist", but only
17
- # the files INSTALL, README and config* are included.
15
+ # in a directory called php-<version>.
18
16
# A .tar.bz2 file is also created.
19
- #
20
- # Usage: makedist <package> <version>
21
- #
17
+ #
22
18
# Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
23
- #
24
- # $Id$
25
- #
19
+ # Adapted to git by Stanislav Malyshev <stas@php.net>
26
20
27
- if test " $# " ! = " 2" ; then
28
- echo " Usage: makedist <package> <version>" >&2
21
+
22
+ if test " $# " ! = " 1" ; then
23
+ echo " Usage: makedist <version>" >&2
29
24
exit 1
30
25
fi
31
26
32
- PKG=$1 ; shift
33
27
VER=$1 ; shift
34
28
35
29
old_IFS=" $IFS "
36
30
IFS=.
37
31
eval set ` bison --version| grep ' GNU Bison' | cut -d ' ' -f 4 | sed -e ' s/\./ /' `
38
32
if test " ${1} " = " 1" -a " ${2} " -lt " 28" ; then
39
33
echo " You will need bison 1.28 if you want to regenerate the Zend parser (found ${1} .${2} ).)"
40
- exit 10
34
+ exit 2
41
35
fi
42
36
IFS=" $old_IFS "
43
37
44
- PHPROOT=http://svn.php.net/repository
45
- PHPMOD=php/php-src
38
+ PHPROOT=git@git.php.net:php-src.git
46
39
LT_TARGETS=' ltconfig ltmain.sh config.guess config.sub'
47
40
48
41
if echo ' \c' | grep -s c > /dev/null 2>&1
57
50
MY_OLDPWD=` pwd`
58
51
59
52
# the destination .tar.gz file
60
- ARCHIVE=$MY_OLDPWD /$PKG -$VER .tar
53
+ ARCHIVE=$MY_OLDPWD /php -$VER .tar
61
54
62
55
# temporary directory used to check out files from SVN
63
- DIR=$PKG -$VER
56
+ DIR=php -$VER
64
57
DIRPATH=$MY_OLDPWD /$DIR
65
58
66
59
if test -d " $DIRPATH " ; then
@@ -69,28 +62,12 @@ if test -d "$DIRPATH"; then
69
62
exit 1
70
63
fi
71
64
72
- # version part of the SVN release tag
73
- SVNVER=` echo $VER | sed -e ' s/[\.\-]/_/g' `
74
-
75
- # SVN release tag
76
- if test " $VER " ! = " HEAD" -a " $VER " ! = " trunk" ; then
77
- SVNTAG=tags/${PKG} _$SVNVER
78
- else
79
- SVNTAG=trunk
80
- fi
81
-
82
- # if test ! -d $DIRPATH; then
83
- # mkdir -p $DIRPATH || exit 2
84
- # fi
85
-
86
65
# Export PHP
87
- $ECHO_N " makedist: exporting tag '$SVNTAG ' from '$PHPMOD '...$ECHO_C "
88
- svn export $PHPROOT / $PHPMOD / $SVNTAG $DIRPATH || exit 4
66
+ $ECHO_N " makedist: exporting tag 'PHP- $VER ' from '$PHPROOT '...$ECHO_C "
67
+ git archive --format=tar --remote= $PHPROOT refs/tags/PHP- $VER --prefix=php- $VER / | (cd $MY_OLDPWD ; tar xvf -) || exit 4
89
68
echo " "
90
69
91
- # remove SVN stuff...
92
70
cd $DIR || exit 5
93
- find . \( -name .svn -type d \) -exec rm -rf {} \;
94
71
95
72
# The full ChangeLog is available separately from lxr.php.net
96
73
rm -f ChangeLog*
@@ -119,25 +96,29 @@ for i in $LT_TARGETS; do
119
96
test -f " $i " && mv $i .bak $i
120
97
done
121
98
99
+ # removing junk files
100
+ find . -name \* .orig -print0 | xargs -0 rm
101
+ rm -fr autom4te.cache/
102
+
122
103
# download pear
123
104
$ECHO_N " makedist: Attempting to download PEAR's phar archive"
124
105
if test ! -x wget; then
125
106
wget http://pear.php.net/install-pear-nozlib.phar -nd -P pear/
126
107
else
127
108
$ECHO_N " Missing wget binary needed for pear download" ;
128
- exit 0 ;
109
+ exit 7
129
110
fi
130
111
131
112
cd $MY_OLDPWD
132
113
$ECHO_N " makedist: making gzipped tar archive...$ECHO_C "
133
114
rm -f $ARCHIVE .gz
134
- tar cf $ARCHIVE $PKG -$VER || exit 8
115
+ tar cf $ARCHIVE php -$VER || exit 8
135
116
gzip -9 $ARCHIVE || exit 9
136
117
echo " "
137
118
138
119
$ECHO_N " makedist: making bz2zipped tar archive...$ECHO_C "
139
120
rm -f $ARCHIVE .bz2
140
- tar cf $ARCHIVE $PKG -$VER || exit 10
121
+ tar cf $ARCHIVE php -$VER || exit 10
141
122
bzip2 -9 $ARCHIVE || exit 11
142
123
echo " "
143
124
0 commit comments