File: makedist

package info (click to toggle)
php3 3%3A3.0.18-31
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 17,860 kB
  • ctags: 11,260
  • sloc: ansic: 108,487; sh: 2,439; php: 2,024; yacc: 1,887; makefile: 1,056; perl: 537; pascal: 238; awk: 90; cpp: 28; sql: 11
file content (134 lines) | stat: -rwxr-xr-x 3,350 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/sh
#
# Distribution generator for CVS based packages.
# To work, this script needs a consistent tagging of all releases.
# Each release of a package should have a tag of the form
#
#  <package>_<version>
#
# where <package> is the package name and the CVS module
# and <version> is the version number with underscores instead of dots.
#
# For example: cvs tag php_3_0a1
#
# The distribution ends up in a .tar.gz file that contains the distribution
# in a directory called <package>-<version>.  The distribution contains all
# directories from the CVS module except the one called "nodist", but only
# the files INSTALL, README and config* are included.
#
# Since you can no longer set the CVS password via an env variable, you
# need to have previously done a cvs login for the server and user id
# this script uses so it will have an entry in your ~/.cvspasswd file.
#
# Usage: makedist <package> <version>
#
# Written by Stig Bakken <ssb@fast.no>     1997-05-28.
#
# $Id: makedist,v 1.31 2000/01/06 15:37:01 rasmus Exp $
#

CVSROOT=:pserver:cvsread@cvs.php.net:/repository
export CVSROOT

if echo '\c' | grep -s c >/dev/null 2>&1
then
    ECHO_N="echo -n"
    ECHO_C=""
else
    ECHO_N="echo"
    ECHO_C='\c'
fi

if test "$#" != "2"; then
    echo "Usage: makedist <package> <version>" >&2
    exit 1
fi

PKG=$1 ; shift
VER=$1 ; shift

OLDPWD=`pwd`

if [ "$VER" = "snapshot" ]; then
    VER=`date -u '+%Y%m%d%k%M'`
    CVSTAG="-D today"
else
    # version part of the CVS release tag
    CVSVER=`echo $VER | sed -e 's/\./_/g'`
    # CVS release tag
    CVSTAG="-r ${PKG}_$CVSVER"
fi

# the destination .tar.gz file
ARCHIVE=$OLDPWD/$PKG-$VER.tar.gz

# temporary directory used to check out files from CVS
TMPDIR=$OLDPWD/cvstmp-$PKG-$VER

# should become "php3"
CVSMOD=`cat CVS/Repository | sed -e 's!^/[^/]*/!!'`

if test ! -d $TMPDIR; then
    mkdir -p $TMPDIR || exit 2
fi

cd $TMPDIR || exit 3

$ECHO_N "makedist: exporting '$CVSTAG' from '$CVSMOD'...$ECHO_C"
cvs -Q export $CVSTAG $CVSMOD || exit 4
echo ""

cd $CVSMOD || exit 5

INC=""

# remove CVS stuff...
find . \( \( -name CVS -type d \) -o -name .cvsignore \) -exec rm -rf {} \;

for file in *; do
    case $file in
	$PKG-$VER|web_update);; # ignore these
	*) INC="$INC $file";; # include the rest
    esac
done

# generate some files so people don't need bison, flex and autoconf
# to install
set -x
make -f build.mk
bison -p php -v -d language-parser.y
flex -Pphp -olanguage-scanner.c -i language-scanner.lex
bison -p cfg -v -d configuration-parser.y
flex -Pcfg -oconfiguration-scanner.c -i configuration-scanner.lex
cd convertor
flex -i -Pphp -olanguage-scanner.c language-scanner.lex
bison -p php -v -d language-parser.y
cd ..
bison -v -d functions/parsedate.y -o functions/parsedate.c

# pull down the latest version of the documentation
rsync -avzC rsync.php.net::phpweb/manual/html/ doc/

#perl -i -p -e 's/\r\n/\n/' *.dsw *.dsp
set +x

INC="$INC \
configuration-scanner.c \
configuration-parser.tab.c configuration-parser.tab.h \
language-scanner.c \
language-parser.tab.c language-parser.tab.h \
configure config.h.in"

mkdir $PKG-$VER || exit 6
mv $INC $PKG-$VER || exit 7

$ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
tar czf $ARCHIVE $PKG-$VER || exit 8
echo ""

$ECHO_N "makedist: cleaning up...$ECHO_C"
cd $OLDPWD
rm -rf $TMPDIR || exit 9
echo ""

exit 0