3
# Copyright (C) 1995-1998, 2000, 2001 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@gnu.org>."
40
while test $# -gt 0; do
52
$echo "$usage"; exit 0 ;;
54
echo "$progname (GNU $package) $version"
55
$echo "Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
56
This is free software; see the source for copying conditions. There is NO
57
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
58
$echo "Written by" "Ulrich Drepper"
60
-- ) # Stop option prcessing
63
$echo "gettextize: unknown option $1"
64
$echo "Try \`gettextize --help' for more information."; exit 1 ;;
70
if test $# -gt 1; then
75
# Fill in the command line options value.
76
if test $# -eq 1; then
81
$echo "Cannot change directory to \`$srcdir'"
88
# Directory where the sources are stored.
90
gettext_dir=@datadir@/gettext
92
test -f configure.in || test -f configure.ac || {
93
$echo "Missing configure.in or configure.ac, please cd to your package first."
97
if test -d intl && test $force -eq 0; then
99
intl/ subdirectory exists: use option -f if you really want to delete it."
103
if test -f po/Makefile.in.in && test $force -eq 0; then
105
po/Makefile.in.in exists: use option -f if you really want to delete it."
109
if test -f ABOUT-NLS && test $force -eq 0; then
110
$echo "ABOUT-NLS exists: use option -f if you really want to delete it."
114
if test -d intl; then
115
# Remove everything inside intl except for RCS and CVS subdirs and invisible
117
$echo "Wiping out intl/ subdirectory"
120
if test CVS != "$f" && test RCS != "$f"; then
125
$echo "Creating intl/ subdirectory"
127
$echo "failed to create intl/ subdirectory"
133
$echo "Creating po/ subdirectory"
135
$echo "failed to create po/ subdirectory"
140
# For simplicity we changed to the gettext source directory.
142
$echo "gettext source directory '${gettext_dir}' doesn't exist"
146
# Now copy all files. Take care for the destination directories.
153
($try_ln_s && ln -s $gettext_dir/$file $srcdir/$file && $echo "Symlinking file $file") 2>/dev/null ||
154
{ $echo "Copying file $file"; cp $file $srcdir/$file; }
159
# Copy files to intl/ subdirectory.
162
if test $file != COPYING.LIB-2 && test $file != COPYING.LIB-2.1; then
163
rm -f $srcdir/intl/$file
164
if test $file != plural.c; then
165
($try_ln_s && ln -s $gettext_dir/intl/$file $srcdir/intl/$file && $echo "Symlinking file intl/$file") 2>/dev/null ||
166
{ $echo "Copying file intl/$file"; cp $file $srcdir/intl/$file; }
168
# plural.c is a generated file; it must be copied and touched.
169
$echo "Copying file intl/$file"; cp $file $srcdir/intl/$file
170
sleep 2; touch $srcdir/intl/$file
175
# Copy files to po/ subdirectory.
178
rm -f $srcdir/po/$file
179
($try_ln_s && ln -s $gettext_dir/po/$file $srcdir/po/$file && $echo "Symlinking file po/$file") 2>/dev/null ||
180
{ $echo "Copying file po/$file"; cp $file $srcdir/po/$file; }
182
DATE=`date +%Y-%m-%d`
183
cat > $srcdir/po/ChangeLog.tmp <<EOF
184
$DATE gettextize <bug-gnu-utils@gnu.org>
186
* Makefile.in.in: Upgrade to gettext-${version}.
188
if test -f $srcdir/po/cat-id-tbl.c; then
189
$echo "Removing po/cat-id-tbl.c"
190
rm -f $srcdir/po/cat-id-tbl.c
191
$echo " * cat-id-tbl.c: Remove file." >> $srcdir/po/ChangeLog.tmp
193
if test -f $srcdir/po/stamp-cat-id; then
194
$echo "Removing po/stamp-cat-id"
195
rm -f $srcdir/po/stamp-cat-id
196
$echo " * stamp-cat-id: Remove file." >> $srcdir/po/ChangeLog.tmp
198
$echo >> $srcdir/po/ChangeLog.tmp
199
if test -f $srcdir/po/ChangeLog; then
200
$echo "Adding an entry to po/ChangeLog (backup is in po/ChangeLog~)"
201
cat $srcdir/po/ChangeLog >> $srcdir/po/ChangeLog.tmp
202
cp -p $srcdir/po/ChangeLog $srcdir/po/ChangeLog~
204
$echo "Creating po/ChangeLog"
206
cp $srcdir/po/ChangeLog.tmp $srcdir/po/ChangeLog
207
rm -f $srcdir/po/ChangeLog.tmp
210
echo "Please add the files"
211
echo " codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4"
213
echo "from the @datadir@/aclocal directory to your autoconf macro directory"
214
echo "or directly to your aclocal.m4 file."
215
echo "You will also need config.guess and config.sub, which you can get from"
216
echo "ftp://ftp.gnu.org/pub/gnu/config/."