Explicitly request literal mode after .Xr.
[netbsd-mini2440.git] / gnu / usr.bin / gettext / gettextize / gettextize
blobcd3ed00e2053e196b10fd709f59eb871bb37d333
1 #! /bin/sh
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)
8 # any later version.
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.
24 echo=echo
25 progname=$0
26 force=0
27 configstatus=0
28 origdir=`pwd`
29 usage="\
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>."
36 package=gettext
37 version=0.10.35
38 aclocal_version=
39 try_ln_s=:
41 while test $# -gt 0; do
42 case "$1" in
43 -c | --copy | --c* )
44 shift
45 try_ln_s=false ;;
46 -f | --force | --f* )
47 shift
48 force=1 ;;
49 -r | --run | --r* )
50 shift
51 configstatus=1 ;;
52 --help | --h* )
53 $echo "$usage"; exit 0 ;;
54 --version | --v* )
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"
60 exit 0 ;;
61 -- ) # Stop option prcessing
62 shift; break ;;
63 -* )
64 $echo "gettextize: unknown option $1"
65 $echo "Try \`gettextize --help' for more information."; exit 1 ;;
66 * )
67 break ;;
68 esac
69 done
71 if test $# -gt 1; then
72 $echo "$usage"
73 exit 1
76 # Fill in the command line options value.
77 if test $# -eq 1; then
78 srcdir=$1
79 if cd $srcdir; then
80 srcdir=`pwd`
81 else
82 $echo "Cannot change directory to \`$srcdir'"
83 exit 1
85 else
86 srcdir=$origdir
89 # Directory where the sources are stored.
90 prefix=/usr/pkg
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."
96 exit 1
99 if test -d intl && test $force -eq 0; then
100 $echo "\
101 intl/ subdirectory exists: use option -f if you really want to delete it."
102 exit 1
105 if test -f po/Makefile.in.in && test $force -eq 0; then
106 $echo "\
107 po/Makefile.in.in exists: use option -f if you really want to delete it."
108 exit 1
111 if test -f NLS && test $force -eq 0; then
112 $echo "NLS exists: use option -f if you really want to delete it."
113 exit 1
116 rm -fr intl
117 mkdir intl || {
118 $echo "failed to create intl/ subdirectory"
119 exit 1;
122 test -d po || mkdir po || {
123 $echo "failed to create po/ subdirectory"
124 exit 1
127 # For simplicity we changed to the gettext source directory.
128 cd $gettext_dir
130 # Now copy all files. Take care for the destination directories.
131 for file in *; do
132 case $file in
133 intl | po | demo)
136 rm -f $srcdir/$file
137 ($try_ln_s && ln -s $gettext_dir/$file $srcdir/$file) 2>/dev/null ||
138 cp $file $srcdir/$file
140 esac
141 done
143 # Copy files to intl/ subdirectory.
144 cd intl
145 for file in *; do
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
149 done
151 # Copy files to po/ subdirectory.
152 cd ../po
153 for file in *; do
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
157 done
160 # Check whether we can run config.status to produce intl/Makefile.in.
161 cd $origdir
162 if test -f ./config.status; then
163 if test $configstatus -eq 0; then
164 echo "Shall I run config.status? (y/N)"
165 read ans
166 case "$ans" in
167 y* | Y* | 1* )
168 configstatus=1 ;;
171 esac
174 test $configstatus -ne 0 &&
175 (CONFIG_FILES=intl/Makefile CONFIG_HEADERS= ./config.status)
178 merge=no
179 OLD_IFS="$IFS"
180 IFS="."
181 cntr=0
182 major=0; minor=0; subminor=0
183 for num in $aclocal_version; do
184 case $cntr in
185 0) major=$num;;
186 1) minor=$num;;
187 2) subminor=$num;;
188 esac
189 cntr=`expr $cntr + 1`
190 done
191 IFS="$OLD_IFS"
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
197 merge=yes
198 else
199 here_major=$1; here_minor=$2
200 if test $# -eq 2; then
201 here_subminor=0
202 else
203 here_subminor=$3
206 if test $major -eq $here_major; then
207 if test $minor -eq $here_minor; then
208 if test $subminor -lt $here_subminor; then
209 merge=gettext
210 elif test $subminor -gt $here_subminor; then
211 merge=yes
213 else
214 if test $minor -lt $here_minor; then
215 merge=gettext
216 else
217 merge=yes
220 else
221 if test $major -lt $here_major; then
222 merge=gettext
223 else
224 merge=yes
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."
238 exit 0