]> sjero.net Git - wget/blob - util/dist-wget
[svn] Synch doc/version.texi with src/version.c.
[wget] / util / dist-wget
1 #!/bin/sh
2
3 # Copyright (C) 2001 Free Software Foundation, Inc.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 # In addition, as a special exception, the Free Software Foundation
20 # gives permission to link the code of its release of Wget with the
21 # OpenSSL project's "OpenSSL" library (or with modified versions of it
22 # that use the same license as the "OpenSSL" library), and distribute
23 # the linked executables.  You must obey the GNU General Public License
24 # in all respects for all of the code used other than "OpenSSL".  If you
25 # modify this file, you may extend this exception to your version of the
26 # file, but you are not obligated to do so.  If you do not wish to do
27 # so, delete this exception statement from your version.
28
29 set -e
30
31 CVSROOT=:pserver:cvs@sunsite.dk:/pack/anoncvs
32 SUBDIR=wget.cvs.$$
33 DEBUG=no
34
35 EXPORT_TAG='-r HEAD'
36 VERSION=
37 MAKE=${MAKE-make}
38
39 if test x"$TMPDIR" = x
40 then
41   TMPDIR=/tmp
42 fi
43 DEST_DIR=`pwd`
44
45 while test x"$*" != x
46 do
47   case "$1" in
48     -d)
49       DEBUG=yes
50       ;;
51     -D)
52       shift
53       EXPORT_TAG="-D '$1'"
54       ;;
55     -r)
56       shift
57       EXPORT_TAG="-r '$1'"
58       ;;
59     --force-version)
60       shift
61       VERSION=$1
62       ;;
63     *)
64       echo "Usage: $0 [-d] [-r TAG | -D DATE]" >&2
65       exit 1
66   esac
67   shift
68 done
69
70 # Resolve echo -n incompatibilities.
71 e_n=-n
72 e_c=
73 if test x"`(echo -n foo; echo bar)`" != xfoobar; then
74   e_n=
75   e_c='\c'
76 fi
77
78 # File for output/errors redirection.
79 O=$DEST_DIR/dist-output
80
81 cd $TMPDIR
82
83 echo "Building wget dist in $TMPDIR/$SUBDIR."
84 echo "Output from commands is in $O."
85
86 echo "-----------" >$O
87
88 # Checkout clean sources from the repository.
89 echo $e_n "Exporting ($EXPORT_TAG) out the CVS tree to $TMPDIR/$SUBDIR... $e_c"
90 cvs -d $CVSROOT export $EXPORT_TAG -d $SUBDIR wget 1>>$O 2>&1
91 echo "done."
92
93 cd $SUBDIR
94
95 # Remove the dummy `Branches' directory.
96 rm -rf Branches 1>>$O 2>&1
97
98 # Force the version if required.
99 if test x"$VERSION" != x
100 then
101   echo "Forcing version to $VERSION."
102   echo "char *version_string = \"$VERSION\";" > src/version.c
103   echo "@set VERSION $VERSION" > doc/version.texi
104 fi
105
106 # Create configure and friends.
107 if test ! -f configure; then
108   echo $e_n "Creating \`configure' from \`configure.in'... $e_c"
109   $MAKE -f Makefile.cvs 1>>$O 2>&1
110   echo "done."
111 fi
112
113 # Remove `Makefile' if it already exists.
114 if test -f Makefile; then
115   echo $e_n "Cleaning old Makefiles with \`$MAKE distclean'... $e_c"
116   $MAKE distclean 1>>$O 2>&1
117   echo "done."
118 fi
119
120 # Create a new `Makefile'.
121 echo $e_n "Running configure... $e_c"
122 CFLAGS=-g ./configure 1>>$O 2>&1
123 echo "done."
124
125 # Now build the MO files.
126 echo $e_n "Building MO files out of PO files... $e_c"
127 cd po
128 $MAKE 1>>$O 2>&1
129 cd ..
130 echo "done."
131
132 # Now build the Info documentation and the man page.
133 echo $e_n "Building Info and man documentation... $e_c"
134 cd doc
135 $MAKE 1>>$O 2>&1
136 cd ..
137 echo "done."
138
139 # Create the distribution file.
140 echo $e_n "Creating distribution tarball... $e_c"
141 $MAKE dist 1>>$O 2>&1
142 archive=`echo wget-*.tar.gz`
143 mv "$archive" $DEST_DIR
144 echo "$archive"
145
146 cd ..
147
148 if test $DEBUG = no; then
149   rm -rf $SUBDIR 1>>$O 2>&1
150 fi