3 # Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
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, or (at your option)
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # This file is meant for authors or maintainers which want to
21 # internationalize their package with the help of GNU gettext. For
22 # further information how to use it consult the GNU gettext manual.
30 Usage: gettextize [OPTION]... [package-dir]
31 --help print this help and exit
32 --version print version information and exit
33 -c, --copy copy files instead of making symlinks
34 -f, --force force writing of new files even if old exist
35 Report bugs to <bug-gnu-utils@prep.ai.mit.edu>."
41 while test $# -gt 0; do
53 $echo "$usage"; exit 0 ;;
55 echo "$progname (GNU $package) $version"
56 $echo "Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
57 This is free software; see the source for copying conditions. There is NO
58 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
59 $echo "Written by" "Ulrich Drepper"
61 -- ) # Stop option prcessing
64 $echo "gettextize: unknown option $1"
65 $echo "Try \`gettextize --help' for more information."; exit 1 ;;
71 if test $# -gt 1; then
76 # Fill in the command line options value.
77 if test $# -eq 1; then
82 $echo "Cannot change directory to \`$srcdir'"
89 # Directory where the sources are stored.
91 gettext_dir
=${prefix}/share
/gettext
92 aclocal_dir
=${datadir}/aclocal
94 test -f configure.
in ||
{
95 $echo "Missing configure.in, please cd to your package first."
99 if test -d intl
&& test $force -eq 0; then
101 intl/ subdirectory exists: use option -f if you really want to delete it."
105 if test -f po
/Makefile.
in.
in && test $force -eq 0; then
107 po/Makefile.in.in exists: use option -f if you really want to delete it."
111 if test -f NLS
&& test $force -eq 0; then
112 $echo "NLS exists: use option -f if you really want to delete it."
118 $echo "failed to create intl/ subdirectory"
122 test -d po || mkdir po ||
{
123 $echo "failed to create po/ subdirectory"
127 # For simplicity we changed to the gettext source directory.
130 # Now copy all files. Take care for the destination directories.
137 ($try_ln_s && ln -s $gettext_dir/$file $srcdir/$file) 2>/dev
/null ||
138 cp $file $srcdir/$file
143 # Copy files to intl/ subdirectory.
146 rm -f $srcdir/intl
/$file
147 ($try_ln_s && ln -s $gettext_dir/intl
/$file $srcdir/intl
/$file) 2>/dev
/null ||
148 cp $file $srcdir/intl
/$file
151 # Copy files to po/ subdirectory.
154 rm -f $srcdir/po
/$file
155 ($try_ln_s && ln -s $gettext_dir/po
/$file $srcdir/po
/$file) 2>/dev
/null ||
156 cp $file $srcdir/po
/$file
160 # Check whether we can run config.status to produce intl/Makefile.in.
162 if test -f .
/config.status
; then
163 if test $configstatus -eq 0; then
164 echo "Shall I run config.status? (y/N)"
174 test $configstatus -ne 0 &&
175 (CONFIG_FILES
=intl
/Makefile CONFIG_HEADERS
= .
/config.status
)
182 major
=0; minor
=0; subminor
=0
183 for num
in $aclocal_version; do
189 cntr
=`expr $cntr + 1`
193 set `sed -e 's/.*Last updated for gettext-\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]\)*.*/\1 \2 \3/p' -e d aclocal.m4` >/dev
/null
196 if test $# -lt 2 ||
test $# -gt 3; then
199 here_major
=$1; here_minor
=$2
200 if test $# -eq 2; then
206 if test $major -eq $here_major; then
207 if test $minor -eq $here_minor; then
208 if test $subminor -lt $here_subminor; then
210 elif test $subminor -gt $here_subminor; then
214 if test $minor -lt $here_minor; then
221 if test $major -lt $here_major; then
229 if test "$merge" = "yes"; then
230 $echo "You should update your own \`aclocal.m4' by adding the necessary"
231 $echo "macro packages gettext.m4, lcmessage.m4 and progtest.m4 from"
232 $echo "the directory \`$aclocal_dir'"
233 elif test "$merge" = "gettext"; then
234 $echo "Your \`aclocal.m4' file is newer than the installed gettext"
235 $echo "program. Consider upgrading to a recent GNU gettext version."