]> sjero.net Git - wget/blob - util/dist-wget
[svn] Use test ! -f foo instead of ! test -f foo.
[wget] / util / dist-wget
1 #!/bin/sh -e
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
30 CVSROOT=:pserver:cvs@sunsite.dk:/pack/anoncvs
31 SUBDIR=wget.cvs.$$
32 DEBUG=no
33
34 EXPORT_TAG='-D now'
35 VERSION=
36
37 if test x"$TMPDIR" = x
38 then
39   TMPDIR=/tmp
40 fi
41 DEST_DIR=`pwd`
42
43 while test x"$*" != x
44 do
45   case "$1" in
46     -d)
47       DEBUG=yes
48       ;;
49     -D)
50       shift
51       EXPORT_TAG="-D '$1'"
52       ;;
53     -r)
54       shift
55       EXPORT_TAG="-r $1"
56       ;;
57     --force-version)
58       shift
59       VERSION=$1
60       ;;
61     *)
62       echo "Usage: $0 [-d] [-r TAG | -D DATE]" >&2
63       exit 1
64   esac
65   shift
66 done
67
68 # Resolve echo -n incompatibilities.
69 e_n=-n
70 e_c=
71 if test "`(echo foo; echo -n bar) | tr '[\012]' x`" != fooxbar; then
72   e_n=
73   e_c='\c'
74 fi
75
76 # File for output/errors redirection.
77 O=$DEST_DIR/dist-output
78
79 cd $TMPDIR
80
81 echo "Building wget dist in $TMPDIR/$SUBDIR."
82 echo "Output from commands is in $O."
83
84 echo "-----------" >$O
85
86 # Checkout clean sources from the repository.
87 echo $e_n "Exporting ($EXPORT_TAG) out the CVS tree to $SUBDIR... $e_c"
88 cvs -d $CVSROOT export $EXPORT_TAG -d $SUBDIR wget 1>>$O 2>&1
89 echo "done."
90
91 cd $SUBDIR
92
93 # Remove the dummy `Branches' directory.
94 rm -rf Branches 1>>$O 2>&1
95
96 # Force the version if required.
97 if test x"$VERSION" != x
98 then
99   echo "char *version_string = \"$VERSION\";" > src/version.c
100   echo "Forcing version to $VERSION."
101 fi
102
103 # Create configure and friends.
104 if test ! -f configure; then
105   echo $e_n "Creating \`configure' from \`configure.in'... $e_c"
106   make -f Makefile.cvs 1>>$O 2>&1
107   echo "done."
108 fi
109
110 # Remove `Makefile' if it already exists.
111 if test -f Makefile; then
112   echo $e_n "Cleaning old Makefiles with \`make distclean'... $e_c"
113   make distclean 1>>$O 2>&1
114   echo "done."
115 fi
116
117 # Create a new `Makefile'.
118 echo $e_n "Running configure... $e_c"
119 CFLAGS=-g ./configure 1>>$O 2>&1
120 echo "done."
121
122 # Now build the MO files.
123 echo $e_n "Building MO files out of PO files... $e_c"
124 cd po
125 make 1>>$O 2>&1
126 cd ..
127 echo "done."
128
129 # Now build the Info documentation and the man page.
130 echo $e_n "Building Info and man documentation... $e_c"
131 cd doc
132 make 1>>$O 2>&1
133 cd ..
134 echo "done."
135
136 # Create the distribution file.
137 echo $e_n "Creating distribution tarball... $e_c"
138 make dist 1>>$O 2>&1
139 mv wget-*.tar.gz $DEST_DIR
140 echo "done."
141
142 cd ..
143
144 if test $DEBUG = no; then
145   rm -rf $SUBDIR 1>>$O 2>&1
146 fi