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