3 # Bootstrap 'tar' from CVS.
5 # Copyright (C) 2003, 2004 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 # Written by Paul Eggert.
24 # URL of our text domain page in Translation Project
25 TP_URL
="http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/"
29 usage: $0 [--gnulib-srcdir=DIR][--cvs-auth=AUTH-METHOD][--cvs-user=USERNAME][--no-po]
31 --gnulib-srcdir=DIRNAME Specify the local directory where gnulib
32 sources reside. Use this if you already
33 have gnulib sources on your machine, and
34 do not want to waste your bandwidth dowloading
36 --cvs-auth=METHOD Set the CVS access method used for downloading
37 gnulib files. METHOD is one of the keywords
38 accepted by cvs -d option (see info cvs
40 --cvs-user=USERNAME Set the CVS username to be used when accessing
41 the gnulib repository.
42 --no-po Do not download po files.
43 --update-po[=LANG] Update po file(s) and exit.
45 Running without arguments will suffice in most cases. It is equivalent
48 ./bootstrap --cvs-auth=ext --cvs-user=anoncvs
59 echo "$0: getting translation for $1..."
60 wget
-C off
$TP_URL/$POFILE
62 echo "$0: getting translations into po..."
64 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
65 wget
-nv -nd -r -l 1 -A .po
-C off
$TP_URL &&
66 ls *.po
| sed 's/\.po$//' >LINGUAS
81 GNULIB_SRCDIR
=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
83 CVS_AUTH
=`expr "$option" : '--cvs-auth=\(.*\)'`;;
85 CVS_USER
=`expr "$option" : '--cvs-user=\(.*\)'`;;
89 DOWNLOAD_PO
=`expr "$option" : '--update-po=\(.*\)'`;;
93 echo >&2 "$0: $option: unknown option"
103 *) update_po
$DOWNLOAD_PO
107 echo "$0: Bootstrapping CVS tar..."
111 if [ "${2}" != - ]; then
112 CVS_PREFIX
=${CVS_PREFIX}${2}@
114 if [ "$1" = "ext" ]; then
115 if [ -z "${CVS_RSH}" ]; then
124 case ${GNULIB_SRCDIR--} in
126 if [ ! -d gnulib
]; then
127 echo "$0: getting gnulib files..."
130 trap 'rm -fr gnulib; exit 1' 0
132 case "${CVS_AUTH--}" in
133 -) build_cvs_prefix ext anoncvs
;;
134 pserver
) build_cvs_prefix
$CVS_AUTH ${CVS_USER:-anoncvs};;
136 build_cvs_prefix
$CVS_AUTH ${CVS_USER--};;
137 ext
) build_cvs_prefix
$CVS_AUTH ${CVS_USER--};;
138 *) echo "$0: Unknown CVS access method" >&2
141 if [ "${CVS_AUTH--}" = "pserver" ]; then
142 cvs
-d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/gnulib login
|| exit
144 cvs
-q -d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/gnulib co gnulib
|| exit
151 <$GNULIB_SRCDIR/gnulib
-tool || exit
196 previous_gnulib_modules
=
197 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
198 previous_gnulib_modules
=$gnulib_modules
200 (echo "$gnulib_modules"
201 for gnulib_module in $gnulib_modules; do
202 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
208 (for gnulib_module in $gnulib_modules; do
209 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
213 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
214 mkdir -p $gnulib_dirs || exit
216 for gnulib_file
in $gnulib_files; do
220 m
4/codeset.
m4) continue;;
221 m
4/intdiv0.
m4) continue;;
222 m
4/inttypes
-pri.
m4) continue;;
223 m
4/isc
-posix.
m4) continue;;
224 m
4/lcmessage.
m4) continue;;
225 m
4/onceonly_2_57.
m4) dest
=m
4/onceonly.
m4;;
226 # These will be overwritten by autopoint, which still uses
227 # old jm_.* macro names, so we have to keep both copies.
228 m
4/ulonglong.
m4) dest
=m
4/ulonglong_gl.
m4;;
229 m
4/inttypes_h.
m4) dest
=m
4/inttypes_h_gl.
m4;;
230 m
4/stdint_h.
m4) dest
=m
4/stdint_h_gl.
m4;;
231 m
4/uintmax_t.
m4) dest
=m
4/uintmax_t_gl.
m4;;
235 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
236 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
239 echo "$0: Creating m4/gnulib.m4"
240 (echo "# This file is generated automatically. Please, do not edit."
242 echo "AC_DEFUN([tar_GNULIB],["
243 for gnulib_module
in $gnulib_modules; do
244 echo "# $gnulib_module"
245 $GNULIB_SRCDIR/gnulib
-tool --extract-autoconf-snippet $gnulib_module
246 done | sed '/AM_GNU_GETTEXT/d'
247 echo "])") > .
/m
4/gnulib.
m4
249 echo "$0: Creating lib/Makefile.am"
250 (cat lib
/Makefile.tmpl
252 for gnulib_module
in $gnulib_modules; do
253 echo "# $gnulib_module"
254 $GNULIB_SRCDIR/gnulib
-tool --extract-automake-snippet $gnulib_module
255 done | sed 's/lib_SOURCES/libtar_a_SOURCES/g' ) > lib
/Makefile.am
258 if test "$DOWNLOAD_PO" = "yes"; then
262 # Reconfigure, getting other files.
264 echo "$0: autoreconf --verbose --install --force ..."
265 autoreconf
--verbose --install --force
268 echo "$0: done. Now you can run './configure'."