• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#
3# Copyright (C) 2003-2005, 2012-2014, 2018-2019 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 3 of the License, or
8# (at your option) 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, see <https://www.gnu.org/licenses/>.
17
18# Usage: xsmallpot.sh srcdir hello-foo [hello-foobar.pot]
19
20set -e
21
22# Nuisances.
23(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
24
25test $# = 2 || test $# = 3 || { echo "Usage: xsmallpot.sh srcdir hello-foo [hello-foobar.pot]" 1>&2; exit 1; }
26srcdir=$1
27directory=$2
28potfile=${3-$directory.pot}
29
30abs_srcdir=`cd "$srcdir" && pwd`
31
32cd ..
33rm -rf tmp-$directory
34cp -p -r "$abs_srcdir"/../$directory tmp-$directory
35chmod -R u+w tmp-$directory
36cd tmp-$directory
37case $directory in
38  hello-c++-kde)
39    cat > configure.ac <<EOF
40AC_INIT
41AC_CONFIG_AUX_DIR(admin)
42AM_INIT_AUTOMAKE([$directory], 0)
43AC_PROG_CXX
44AM_GNU_GETTEXT([external])
45AM_GNU_GETTEXT_VERSION([0.19.8])
46AC_CONFIG_FILES([po/Makefile.in])
47AC_CONFIG_FILES([Makefile])
48AC_CONFIG_FILES([m4/Makefile])
49AC_OUTPUT
50EOF
51    autopoint -f
52    aclocal -I m4
53    autoconf
54    automake -a -c
55    ./configure
56    ;;
57  hello-objc-gnustep)
58    ./autogen.sh
59    ;;
60  hello-pascal)
61    ./autogen.sh
62    ./configure
63    # Build hello.rsj.
64    make hello.rsj
65    ;;
66  *)
67    grep '^\(AC_INIT\|AC_CONFIG\|AC_PROG_\|AC_SUBST(.*OBJC\|AM_INIT\|AM_CONDITIONAL\|AM_GNU_GETTEXT\|AM_PO_SUBDIRS\|AC_OUTPUT\)' configure.ac > tmp-configure.ac
68    mv -f tmp-configure.ac configure.ac
69    ./autogen.sh
70    ./configure
71    ;;
72esac
73cd po
74make $potfile
75sed -e "/^#:/ {
76s, \\([^ ]\\), $directory/\\1,g
77}" < $potfile > "$abs_srcdir"/$potfile
78cd ..
79cd ..
80rm -rf tmp-$directory
81