]> sjero.net Git - wget/blob - util/dist-wget
459e10f9ee63a366d0582ab360f42d90ee9114f5
[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 DEBUG=no
32 CHECKOUT=yes
33
34 for arg; do
35   case "$arg" in
36     -d)
37       DEBUG=yes
38       ;;
39     --no-checkout)
40       CHECKOUT=no
41       ;;
42     *)
43       echo "Usage: $0 [-d] [--no-checkout]" >&2
44       exit 1
45   esac
46 done
47
48 # Resolve echo -n incompatibilities.
49 e_n=-n
50 e_c=
51 if test "`(echo foo; echo -n bar) | tr '[\012]' x`" != fooxbar; then
52   e_n=
53   e_c='\c'
54 fi
55
56 # File for output/errors redirection.
57 O=$DIR/dist-output
58
59 cd $DIR
60
61 echo "Building wget dist in $DIR."
62 echo "Output from commands is in $DIR/dist-output."
63
64 echo "-----------" >$O
65
66 if test $CHECKOUT = yes; then
67   # Checkout clean sources from the repository.
68   echo $e_n "Checking out CVS sources from the repository... $e_c"
69   rm -rf wget 1>>$O 2>&1
70   cvs -d $CVSROOT checkout wget 1>>$O 2>&1
71   echo "done."
72 fi
73
74 cd wget
75
76 # Remove the dummy `Branches' directory.
77 rm -rf Branches 1>>$O 2>&1
78
79 # Create configure and friends.
80 if ! test -f configure; then
81   echo $e_n "Creating \`configure' from \`configure.in'... $e_c"
82   make -f Makefile.cvs 1>>$O 2>&1
83   echo "done."
84 fi
85
86 # Remove `Makefile' if it already exists.
87 if test -f Makefile; then
88   echo $e_n "Cleaning old Makefiles with \`make distclean'... $e_c"
89   make distclean 1>>$O 2>&1
90   echo "done."
91 fi
92
93 # Create a new `Makefile'.
94 echo $e_n "Running configure... $e_c"
95 CFLAGS=-g ./configure 1>>$O 2>&1
96 echo "done."
97
98 # Now build the MO files.
99 echo $e_n "Building MO files out of PO files... $e_c"
100 cd po
101 make 1>>$O 2>&1
102 cd ..
103 echo "done."
104
105 # Now build the Info documentation and the man page.
106 echo $e_n "Building Info and man documentation... $e_c"
107 cd doc
108 make 1>>$O 2>&1
109 cd ..
110 echo "done."
111
112 # Create the distribution file.
113 echo $e_n "Creating distribution tarball... $e_c"
114 make dist 1>>$O 2>&1
115 mv wget-*.tar.gz ../
116 echo "done."
117
118 cd ..
119
120 if test $DEBUG = no && test $CHECKOUT = yes; then
121   rm -rf wget 1>>$O 2>&1
122 fi