5 # -r Build and commit a release (tags the sources and updates version info).
6 # -w Disable -Werror in compiler flags.
7 # -R Increase release number after building (2.3.29 -> 3.0.0).
8 # -M Increase major number after building (2.3.29 -> 2.4.0).
9 # -N Your name for the ChangeLog.
11 # environment variables:
14 # The name that will show up in the ChangeLog (only with -r).
15 # If omitted a your gcos name is used. Can also be set with -N.
17 # The email address that will show up in the ChangeLog (only with -r).
18 # FVWMRELPRECVSCOMMAND
19 # A command that will be executed before the first cvs command. Can be used
20 # to bring up the network prior to network access. (only with -r)
21 # FVWMRELPOSTCVSCOMMAND
22 # Same as above, but executed after the last cvs command.
26 CHECK_STRING2
="Robert Nation"
27 CHECK_VERSION_STRING
="AM_INIT_AUTOMAKE"
29 VERSION_POST
=".tar.gz"
30 READY_STRING
=" is ready for distribution"
31 CFLAGSE
="-g -O2 -Wall -Werror"
32 CFLAGSW
="-g -O2 -Wall"
42 while [ ! x
$1 = x
] ; do
45 -R) IS_MINOR
=0; IS_MAJOR
=0 ;;
46 -M) IS_MINOR
=0; IS_MAJOR
=1 ;;
47 -w) CFLAGS
="$CFLAGSW" ;;
48 -N) FVWMRELNAME
=$2;shift;;
53 if [ $IS_RELEASE = 1 ] ; then
54 echo "Your name and email address will show up in the ChangeLog."
55 if [ -z "$FVWMRELNAME" ] ; then
56 FVWMRELNAME
=`perl -e 'print ((split(/,/, ((getpwnam(((getpwuid($<))[0])))[6])))[0]);'`
57 echo "Please enter your name or press return to use \"$FVWMRELNAME\""
59 if [ ! "$ANSWER" = "" ] ; then
63 echo "Name: $FVWMRELNAME"
65 if [ -z "$FVWMRELEMAIL" ] ; then
66 echo "Please enter your emailaddress (or set FVWMRELEMAIL variable)"
69 echo "Email: $FVWMRELEMAIL"
71 echo "Your name will show up in the ChangeLog as $FVWMRELNAME"
72 echo "Your email address will show up in the ChangeLog as $FVWMRELEMAIL"
76 if [ -r "$CHECK_FILE" ] ; then
77 if grep "$CHECK_STRING1" "$CHECK_FILE" > /dev
/null
2> /dev
/null
; then
78 if grep "$CHECK_STRING2" "$CHECK_FILE" > /dev
/null
2> /dev
/null
; then
84 if [ $wrong_dir = 1 ] ; then
85 echo "The fvwm sources are not present in the current directory."
86 echo "Looked for "$CHECK_FILE" containing \""$CHECK_STRING1"\" and \""$CHECK_STRING2"\". exit."
91 VERSION
=`grep $CHECK_VERSION_STRING configure.in 2>&1 |
93 perl -pe 's/[[:space:]]*([0-9]+\.[0-9]+\.[0-9]+).$/$1/g'`
94 VRELEASE
=`echo $VERSION | cut -f 1 -d "."`
95 VMAJOR
=`echo $VERSION | cut -f 2 -d "."`
96 VMINOR
=`echo $VERSION | cut -f 3 -d "."`
97 if [ -z "$VRELEASE" -o -z "$VMAJOR" ] ; then
98 echo "Failed to fetch version number from configure.in."
101 if [ x
$VMINOR = x
] ; then
104 if [ "$IS_MINOR" = 1 ] ; then
108 VMINORP
=`echo $VMINOR | perl -pe 's/(.+)/@{[$1+1]}/g'`
109 elif [ "$IS_MAJOR" = 1 ] ; then
112 VMAJORP
=`echo $VMAJOR | perl -pe 's/(.+)/@{[$1+1]}/g'`
115 VRELEASEP
=`echo $VRELEASE | perl -pe 's/(.+)/@{[$1+1]}/g'`
119 VRELNUM
=$VRELEASE.
$VMAJOR.
$VMINOR
120 VRELNUMP
=$VRELEASEP.
$VMAJORP.
$VMINORP
121 VERSION_STRING
=$VERSION_PRE$VRELNUM$VERSION_POST
122 echo "***** building $VERSION_STRING *****"
126 for i
in gnumake gmake
make; do
127 VER
=`(echo 'all:;@echo $(MAKE_VERSION)' | $i -f -) 2>/dev/null`
129 3.
*) MAKE
=$i; break 2 ;;
133 ?
*) : OK
, found one
;;
134 *) echo "Can't find GNU make version 3 on the PATH!"; exit 12 ;;
137 # find compiler (prefer gcc)
140 VER
=`(gcc --version) 2>/dev/null`
141 if [ x
$VER = x
] ; then
148 echo removing old configure files ...
149 if [ -f configure
] ; then
150 rm configure ||
exit 21
152 if [ -f config.cache
] ; then
153 rm config.cache ||
exit 22
155 if [ -f config.log
] ; then
156 rm config.log ||
exit 23
158 if [ -f config.status
] ; then
159 rm config.status ||
exit 24
162 # build the distribution
163 echo running automake ...
164 automake
--add-missing ||
exit 31
165 if [ -f config.h.
in ]; then
166 echo running autoreconf ...
167 autoreconf ||
exit 32
169 echo running autoreconf ...
170 autoreconf ||
exit 33
171 echo running automake again ...
172 automake
--add-missing ||
exit 34
173 echo running autoconf again ...
176 echo running configure ...
177 .
/configure ||
exit 35
178 echo running
make clean ...
179 $MAKE clean ||
exit 37
180 echo running
make ...
181 $MAKE CC
="$CC" CFLAGS
="$CFLAGS" ||
exit 38
182 echo running
make distcheck2 ...
183 $MAKE CC
="$CC" distcheck2
2>&1 |
grep "$VERSION_STRING$READY_STRING" ||
exit 39
185 echo "distribution file is ready"
188 # update some files and commit changes
189 if [ $IS_RELEASE = 0 ] ; then
190 echo "If this is to be an official release:"
191 echo " . Tag the source tree:"
192 echo " cvs tag version-x_y_z"
193 echo " . Increase the version number in configure.in and commit this change"
194 echo " . Create entries in ChangeLog and NEWS files indicating the release"
196 echo updating NEWS
file
198 perl
-pe '$hr = "-" x 67; s/^(.*) '$VRELNUM' (\(not released yet\))$/$1 '$VRELNUMP' $2\n\n$hr\n\n$1 '$VRELNUM' (@{[substr(`date "+%d-%b-%Y"`,0,11)]})/' \
199 < NEWS
> $NNEWS ||
exit 41
200 mv $NNEWS NEWS ||
exit 42
201 echo updating FAQ
file
203 if [ $IS_MINOR = 1 ]; then
204 perl
-pe 's/(Last updated).*(for unstable release) '$VRELNUM' (and stable)$/$1 @{[substr(`date "+%b %d, %Y"`,0,12)]} $2 '$VRELNUMP' $3/' \
205 < docs
/FAQ
> docs
/$NFAQ ||
exit 43
207 perl
-pe 's/(Last updated).*(for unstable release .* and stable release) [0-9]*\.[0-9*]\.[0-9*]\.$/$1 @{[substr(`date "+%b %d, %Y"`,0,12)]} $2 '$VRELNUMP'\./' \
208 < docs
/FAQ
> docs
/$NFAQ ||
exit 44
210 mv docs
/$NFAQ docs
/FAQ ||
exit 45
211 echo tagging CVS
source
212 if [ ! "$FVWMRELPRECVSCOMMAND" = "" ] ; then
213 $FVWMRELPRECVSCOMMAND
215 cvs tag version-
${VRELEASE}_${VMAJOR}_${VMINOR} ||
exit 46
216 echo increasing version number
in configure.
in
217 NCFG
="new-configure.in"
218 touch $NCFG ||
exit 47
220 perl
-pe 's/'$VRELNUM'/'$VRELNUMP'/g' \
222 mv $NCFG configure.
in ||
exit 49
223 echo generating ChangeLog entry ...
224 NCLOG
="new-ChangeLog"
225 touch $NCLOG ||
exit 50
226 echo `date +%Y-%m-%d`" $FVWMRELNAME <$FVWMRELEMAIL>" > $NCLOG
228 echo " * NEWS, configure.in:" >> $NCLOG
229 echo " changed version to $VRELNUMP" >> $NCLOG
231 cat ChangeLog
>> $NCLOG
232 mv $NCLOG ChangeLog ||
exit 51
233 echo committing configure.
in and ChangeLog
235 "* Set development version to $VRELNUMP." \
236 NEWS configure.
in ChangeLog ||
exit 52
237 if [ ! "$FVWMRELPOSTCVSCOMMAND" = "" ] ; then
238 $FVWMRELPOSTCVSCOMMAND
243 echo " . Upload the distribution to ftp://ftp.fvwm.org/pub/incoming/fvwm"
244 echo " . Notify fvwm-owner@fvwm.org of the upload"
245 echo " . Update the version numbers in fvwm-web/download.html and"
246 echo " fvwm-web/index.html."
247 echo " . If releasing the stable branch, update NEWS in the beta branch to"
248 echo " identify the latest stable release and describe the changes."
249 echo " . Use fvwm-web generated/txt2html.sh to update the NEWS file:"
250 echo " $ cd fvwm-web/generated && ./txt2html.sh ../../fvwm/NEWS"