1#!/bin/sh 2# Usage: xsmallpot.sh srcdir hello-foo [hello-foobar.pot] 3 4set -e 5 6# Nuisances. 7(unset CDPATH) >/dev/null 2>&1 && unset CDPATH 8 9test $# = 2 || test $# = 3 || { echo "Usage: xsmallpot.sh srcdir hello-foo [hello-foobar.pot]" 1>&2; exit 1; } 10srcdir=$1 11directory=$2 12potfile=${3-$directory.pot} 13 14abs_srcdir=`cd "$srcdir" && pwd` 15 16cd .. 17rm -rf tmp-$directory 18cp -p -r "$abs_srcdir"/../$directory tmp-$directory 19chmod -R u+w tmp-$directory 20cd tmp-$directory 21case $directory in 22 hello-c++-kde) 23 ./autogen.sh 24 sed -e 's,tmp-,,' < configure.in > configure.ac 25 grep '^\(AC_INIT\|AC_CONFIG\|AC_PROG_\|AC_SUBST(.*OBJC\|AM_INIT\|AM_CONDITIONAL\|AM_GNU_GETTEXT\|AM_PO_SUBDIRS\|AC_OUTPUT\)' configure.ac > configure.in 26 rm -f configure.ac 27 autoconf 28 ./configure 29 ;; 30 hello-objc-gnustep) 31 ./autogen.sh 32 ;; 33 *) 34 grep '^\(AC_INIT\|AC_CONFIG\|AC_PROG_\|AC_SUBST(.*OBJC\|AM_INIT\|AM_CONDITIONAL\|AM_GNU_GETTEXT\|AM_PO_SUBDIRS\|AC_OUTPUT\)' configure.ac > configure.in 35 rm -f configure.ac 36 ./autogen.sh 37 ./configure 38 ;; 39esac 40cd po 41make $potfile 42sed -e "/^#:/ { 43s, \\([^ ]\\), $directory/\\1,g 44}" < $potfile > ../../po/$potfile 45cd .. 46cd .. 47rm -rf tmp-$directory 48