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