3 # Bootstrap 'tar' from CVS.
5 # Copyright (C) 2003, 2004, 2005 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 and Sergey Poznyakoff.
24 # URL of our text domain page in Translation Project
25 TP_URL
="http://www.iro.umontreal.ca/translation/maint/tar/"
27 # Ensure file names are sorted consistently across platforms;
28 # e.g., m4/ulonglong_gl.m4 should follow m4/ulonglong.m4.
34 usage: $0 [--gnulib-srcdir=DIR][--paxutils-srcdir=DIR][--cvs-auth=AUTH-METHOD][--cvs-user=USERNAME][--no-po]
36 --paxutils-srcdir=DIRNAME Specify the local directory where paxutils
37 sources reside. Use this if you already
38 have paxutils sources on your machine, and
39 do not want to waste your bandwidth dowloading
41 --gnulib-srcdir=DIRNAME Specify the local directory where gnulib
42 sources reside. Use this if you already
43 have gnulib sources on your machine, and
44 do not want to waste your bandwidth dowloading
46 --cvs-auth=METHOD Set the CVS access method used for downloading
47 gnulib files. METHOD is one of the keywords
48 accepted by cvs -d option (see info cvs
50 --cvs-user=USERNAME Set the CVS username to be used when accessing
51 the gnulib repository.
52 --no-po Do not download po files.
53 --update-po[=LANG] Update po file(s) and exit.
55 Running without arguments will suffice in most cases. It is equivalent
58 ./bootstrap --cvs-auth=ext --cvs-user=anoncvs
69 echo "$0: getting translation for $1..."
70 wget
-r -C off
$TP_URL/$POFILE
72 echo "$0: getting translations into po..."
74 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
75 wget
-nv -nd -r -l 1 -A .po
-C off
$TP_URL &&
76 rm -f index.html index.html.
[0-9]*
77 ls *.po
| sed 's/\.po$//' >LINGUAS
92 GNULIB_SRCDIR
=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
94 PAXUTILS_SRCDIR
=`expr "$option" : '--paxutils-srcdir=\(.*\)'`;;
96 CVS_AUTH
=`expr "$option" : '--cvs-auth=\(.*\)'`;;
98 CVS_USER
=`expr "$option" : '--cvs-user=\(.*\)'`;;
102 DOWNLOAD_PO
=`expr "$option" : '--update-po=\(.*\)'`;;
106 echo >&2 "$0: $option: unknown option"
116 *) update_po
$DOWNLOAD_PO
120 echo "$0: Bootstrapping CVS tar..."
124 if [ "${2}" != - ]; then
125 CVS_PREFIX
=${CVS_PREFIX}${2}@
127 if [ "$1" = "ext" ]; then
128 if [ -z "${CVS_RSH}" ]; then
138 echo "$0: getting $1 files..."
141 trap 'rm -fr $1; exit 1' 0
143 case "${CVS_AUTH--}" in
144 -) build_cvs_prefix ext anoncvs
146 pserver
) build_cvs_prefix
$CVS_AUTH ${CVS_USER:-anoncvs}
149 build_cvs_prefix
$CVS_AUTH ${CVS_USER--}
151 ext
) build_cvs_prefix
$CVS_AUTH ${CVS_USER--}
153 *) echo "$0: Unknown CVS access method" >&2
156 if [ "${CVS_AUTH--}" = "pserver" ]; then
157 cvs
-d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/$1 login
|| exit
159 cvs
-q -d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/$1 co
$1 || exit
165 # Prepare temporary module list
166 cat /dev
/null
> modlist.tmp
167 trap 'rm -f modlist.tmp' 0 1 2 13 15
170 sed '/^[ ]*#/d;/^[ ]*$/d' $
* >> modlist.tmp
174 case ${PAXUTILS_SRCDIR--} in
176 PAXUTILS_SRCDIR
=paxutils
179 if [ -r $PAXUTILS_SRCDIR/gnulib.modules
]; then
180 get_modules
$PAXUTILS_SRCDIR/gnulib.modules
183 # copy_files srcdir dstdir
185 for file in `cat $1/DISTFILES`
190 echo "$0: Copying file $1/$file"
191 cp -p $1/$file $2/`expr $file : '.*/\(.*\)'`
195 copy_files
${PAXUTILS_SRCDIR}/m4 m4
196 echo "$0: Creating m4/paxutils.m4"
197 (echo "# This file is generated automatically. Please, do not edit."
199 echo "AC_DEFUN([tar_PAXUTILS],["
200 cat ${PAXUTILS_SRCDIR}/m
4/DISTFILES
| sed '/^#/d;s/\(.*\)\.m4/pu_\1/' | tr a
-z A
-Z
201 echo "])") > .
/m
4/paxutils.
m4
209 copy_files
${PAXUTILS_SRCDIR}/rmt rmt
211 copy_files
${PAXUTILS_SRCDIR}/lib lib
213 copy_files
${PAXUTILS_SRCDIR}/tests tests
217 case ${GNULIB_SRCDIR--} in
222 <$GNULIB_SRCDIR/gnulib
-tool || exit
224 get_modules gnulib.modules
226 gnulib_modules
=`sort -u modlist.tmp`
227 previous_gnulib_modules
=
228 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
229 previous_gnulib_modules
=$gnulib_modules
231 (echo "$gnulib_modules"
232 for gnulib_module in $gnulib_modules; do
233 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
239 (for gnulib_module in $gnulib_modules; do
240 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
244 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
245 mkdir -p $gnulib_dirs || exit
247 for gnulib_file
in $gnulib_files; do
251 m
4/codeset.
m4) continue;;
252 m
4/intdiv0.
m4) continue;;
253 m
4/inttypes
-pri.
m4) continue;;
254 m
4/isc
-posix.
m4) continue;;
255 m
4/lcmessage.
m4) continue;;
256 m
4/onceonly_2_57.
m4) dest
=m
4/onceonly.
m4;;
257 # These will be overwritten by autopoint, which still uses
258 # old jm_.* macro names, so we have to keep both copies.
259 m
4/gettext.
m4 | m
4/glibc21.
m4 | m
4/inttypes_h.
m4 | m
4/lib
-ld.
m4 | \
260 m
4/lib
-prefix.
m4 | m
4/po.
m4 | m
4/stdint_h.
m4 | m
4/uintmax_t.
m4 | \
262 dest
=`expr $gnulib_file : '\(.*\).m4'`_gl.
m4;;
266 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
267 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
270 echo "$0: Creating m4/gnulib.m4"
271 (echo "# This file is generated automatically. Please, do not edit."
273 echo "AC_DEFUN([tar_GNULIB],["
274 for gnulib_module
in $gnulib_modules; do
275 echo "# $gnulib_module"
276 $GNULIB_SRCDIR/gnulib
-tool --extract-autoconf-snippet $gnulib_module
277 done | sed '/AM_GNU_GETTEXT/d'
278 echo "])") > .
/m
4/gnulib.
m4
280 echo "$0: Creating lib/Makefile.am"
281 (echo "# This file is generated automatically from lib/Makefile.am. Do not edit!"
282 cat lib
/Makefile.tmpl
284 for gnulib_module
in $gnulib_modules; do
285 echo "# $gnulib_module"
286 $GNULIB_SRCDIR/gnulib
-tool --extract-automake-snippet $gnulib_module
287 done | sed 's/lib_SOURCES/libtar_a_SOURCES/g' ) > lib
/Makefile.am
290 if test "$DOWNLOAD_PO" = "yes"; then
294 # Reconfigure, getting other files.
296 echo "$0: autoreconf --verbose --install --force ..."
297 autoreconf
--verbose --install --force || exit 1
300 echo "$0: done. Now you can run './configure'."