#!/bin/sh

>$1.d

if file $1 | grep -q "shell script" && 
    grep -q "^. /usr/bin/localization *$" $1; then
    eval NAME="`sed -n '/^TEXTDOMAIN=/ {s/^TEXTDOMAIN=//;p;q}' $1`"
    [ -z "$NAME" ] && NAME="`basename "$1"`"
    cat >>$1.d <<EOF
$1.d po/$NAME.pot: $1
po/$NAME.po: po/$NAME.pot
po/$NAME.mo: po/$NAME.po
mo: po/$NAME.mo
EOF
fi
