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