~ubuntu-branches/ubuntu/breezy/gettext/breezy

« back to all changes in this revision

Viewing changes to misc/gettextize.in

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2004-03-14 17:40:02 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314174002-p1ad5ldve1hqzhye
Tags: 0.14.1-2
* Added libexpat1-dev to Build-Depends, for glade support.
* Added libc0.1-dev to Build-Depends, for GNU/kFreeBSD.
* Removed special-casing of knetbsd-gnu in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
#
3
 
# Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
4
 
#
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.
9
 
#
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.
14
 
#
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.
18
 
#
19
 
 
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.
23
 
 
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@gnu.org>."
36
 
package=@PACKAGE@
37
 
version=@VERSION@
38
 
try_ln_s=:
39
 
 
40
 
while test $# -gt 0; do
41
 
  case "$1" in
42
 
    -c | --copy | --c* )
43
 
      shift
44
 
      try_ln_s=false ;;
45
 
    -f | --force | --f* )
46
 
      shift
47
 
      force=1 ;;
48
 
    -r | --run | --r* )
49
 
      shift
50
 
      configstatus=1 ;;
51
 
    --help | --h* )
52
 
      $echo "$usage"; exit 0 ;;
53
 
    --version | --v* )
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"
59
 
      exit 0 ;;
60
 
    -- )        # Stop option prcessing
61
 
      shift; break ;;
62
 
    -* )
63
 
      $echo "gettextize: unknown option $1"
64
 
      $echo "Try \`gettextize --help' for more information."; exit 1 ;;
65
 
    * )
66
 
      break ;;
67
 
  esac
68
 
done
69
 
 
70
 
if test $# -gt 1; then
71
 
  $echo "$usage"
72
 
  exit 1
73
 
fi
74
 
 
75
 
# Fill in the command line options value.
76
 
if test $# -eq 1; then
77
 
  srcdir=$1
78
 
  if cd $srcdir; then
79
 
    srcdir=`pwd`
80
 
  else
81
 
    $echo "Cannot change directory to \`$srcdir'"
82
 
    exit 1
83
 
  fi
84
 
else
85
 
  srcdir=$origdir
86
 
fi
87
 
 
88
 
# Directory where the sources are stored.
89
 
prefix=@prefix@
90
 
gettext_dir=@datadir@/gettext
91
 
 
92
 
test -f configure.in || test -f configure.ac || {
93
 
  $echo "Missing configure.in or configure.ac, please cd to your package first."
94
 
  exit 1
95
 
}
96
 
 
97
 
if test -d intl && test $force -eq 0; then
98
 
  $echo "\
99
 
intl/ subdirectory exists: use option -f if you really want to delete it."
100
 
  exit 1
101
 
fi
102
 
 
103
 
if test -f po/Makefile.in.in && test $force -eq 0; then
104
 
  $echo "\
105
 
po/Makefile.in.in exists: use option -f if you really want to delete it."
106
 
  exit 1
107
 
fi
108
 
 
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."
111
 
  exit 1
112
 
fi
113
 
 
114
 
if test -d intl; then
115
 
  # Remove everything inside intl except for RCS and CVS subdirs and invisible
116
 
  # files.
117
 
  $echo "Wiping out intl/ subdirectory"
118
 
  (cd intl &&
119
 
   for f in *; do
120
 
     if test CVS != "$f" && test RCS != "$f"; then
121
 
       rm -rf "$f"
122
 
     fi
123
 
   done)
124
 
else
125
 
  $echo "Creating intl/ subdirectory"
126
 
  mkdir intl || {
127
 
    $echo "failed to create intl/ subdirectory"
128
 
    exit 1;
129
 
  }
130
 
fi
131
 
 
132
 
test -d po || {
133
 
  $echo "Creating po/ subdirectory"
134
 
  mkdir po || {
135
 
    $echo "failed to create po/ subdirectory"
136
 
    exit 1
137
 
  }
138
 
}
139
 
 
140
 
# For simplicity we changed to the gettext source directory.
141
 
cd $gettext_dir || {
142
 
   $echo "gettext source directory '${gettext_dir}' doesn't exist"
143
 
   exit 1
144
 
}
145
 
 
146
 
# Now copy all files.  Take care for the destination directories.
147
 
for file in *; do
148
 
  case $file in
149
 
    intl | po)
150
 
      ;;
151
 
    *)
152
 
      rm -f $srcdir/$file
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; }
155
 
      ;;
156
 
  esac
157
 
done
158
 
 
159
 
# Copy files to intl/ subdirectory.
160
 
cd intl
161
 
for file in *; do
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; }
167
 
    else
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
171
 
    fi
172
 
  fi
173
 
done
174
 
 
175
 
# Copy files to po/ subdirectory.
176
 
cd ../po
177
 
for file in *; do
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; }
181
 
done
182
 
DATE=`date +%Y-%m-%d`
183
 
cat > $srcdir/po/ChangeLog.tmp <<EOF
184
 
$DATE  gettextize  <bug-gnu-utils@gnu.org>
185
 
 
186
 
        * Makefile.in.in: Upgrade to gettext-${version}.
187
 
EOF
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
192
 
fi
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
197
 
fi
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~
203
 
else
204
 
  $echo "Creating po/ChangeLog"
205
 
fi
206
 
cp $srcdir/po/ChangeLog.tmp $srcdir/po/ChangeLog
207
 
rm -f $srcdir/po/ChangeLog.tmp
208
 
 
209
 
echo
210
 
echo "Please add the files"
211
 
echo "  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4"
212
 
echo "  progtest.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/."
217
 
echo
218
 
 
219
 
exit 0