#!/bin/sh -e # # find-lang - generate list of language specific files. # Inspired by tool with same name from W. L. Estes . # # $Id$ # Copyright (C) 2000,2003 Dmitry V. Levin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # : ${RPMCONFIGDIR:=@RPMCONFIGDIR@} . "$RPMCONFIGDIR/functions" Usage() { [ "$1" = 0 ] || exec >&2 cat <"$OUTFILE" echo '%defattr(644,root,root,755)' >>"$OUTFILE" if [ -n "$FIND_MO" ]; then find "$TOPDIR" -type f |sed ' s:'"$TOPDIR"':: s:\(.*/share/locale/\)\([^/_]\+\)\(.*'"$NAME"'\.mo$\):%lang(\2) \1\2\3: s:^\([^%].*\):: ' |grep -v '^$' >> "$OUTFILE" ||: fi if [ -n "$FIND_MAN" ]; then find "$TOPDIR" -type f |sed ' s:'"$TOPDIR"':: s:\(.*/share/man/\)\([^/_]\+\)\(.*'"$NAME"'\..\)\(\.[^/]*\)\?$:%lang(\2) \1\2\3*: s:^\([^%].*\):: s:^%lang(man.*) .*:: ' |grep -v '^$' >> "$OUTFILE" ||: fi if [ -n "$FIND_GNOME" ]; then find $TOPDIR -type d |sed ' s:'"$TOPDIR"':: s:\(.*/gnome/help/'"$NAME"'\)$:%dir \1: s:\(.*/gnome/help/'"$NAME"'/\)\([^/_]\+\):%dir %lang(\2) \1\2: s:^\([^%].*\):: s:%lang(C) :: ' |grep -v '^$' >> "$OUTFILE" ||: find "$TOPDIR" -type f |sed ' s:'"$TOPDIR"':: s:\(.*/gnome/help/'"$NAME"'/\)\([^/_]\+\):%lang(\2) \1\2: s:^\([^%].*\):: s:%lang(C) :: ' |grep -v '^$' >> "$OUTFILE" ||: find $TOPDIR -type d |sed ' s:'"$TOPDIR"':: s:\(.*/share/omf/'"$NAME"'\)$:%dir \1: s:^\([^%].*\):: ' |grep -v '^$' >> "$OUTFILE" ||: find "$TOPDIR" -type f |sed ' s:'"$TOPDIR"':: s:\(.*/share/omf/'"$NAME"'/\)\([^/]*-\)\(.*\)\(\.omf\)$:%lang(\3) \1\2\3\4: s:^\([^%].*\):: s:%lang(C) :: ' |grep -v '^$' >> "$OUTFILE" ||: fi } for NAME in "$@"; do if [ -n "$OUTPUT" ]; then OUTFILE="$OUTPUT" [ "$NAME" = "$1" ] || APPEND=1 else OUTFILE="$NAME.lang" fi FindLang done