rpm/rpm-5.2.1-find_lang_support_localized_qt_and_man_files.patch

84 lines
2.2 KiB
Diff

--- rpm-5.2.1/scripts/find-lang.sh.orig 2014-10-07 23:35:04.000000000 +0200
+++ rpm-5.2.1/scripts/find-lang.sh 2015-03-31 21:37:57.890482158 +0200
@@ -32,6 +32,8 @@
Additional options:
--with-gnome find GNOME help files
--with-kde find KDE help files
+ --with-qt find Qt translation files
+ --with-man find localized man pages
--all-name match all package/domain names
--without-mo not find locales files
EOF
@@ -54,6 +56,8 @@
GNOME=#
KDE=#
+QT=#
+MAN=#
MO=
MO_NAME=$NAME.lang
ALL_NAME=#
@@ -69,6 +73,14 @@
KDE=
shift
;;
+ --with-qt )
+ QT=
+ shift
+ ;;
+ --with-man )
+ MAN=
+ shift
+ ;;
--without-mo )
MO=#
shift
@@ -93,6 +105,14 @@
s:%lang(C) ::
/^$/d' > $MO_NAME
+find "$TOP_DIR" -type d|sed '
+s:'"$TOP_DIR"'::
+'"$NO_ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/'"$NAME"'\)$:%lang(\2) %doc \1\2\3\4/:
+'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3\4/:
+s:^\([^%].*\)::
+s:%lang(C) ::
+/^$/d' >> $MO_NAME
+
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir \1:
@@ -123,6 +143,32 @@
s:^\([^%].*\)::
s:%lang(C) ::
/^$/d' >> $MO_NAME
+
+find "$TOP_DIR" -type f -o -type l|sed '
+s:'"$TOP_DIR"'::
+'"$NO_ALL_NAME$QT"'s:\(.*/'"$NAME"'_\([a-zA-Z]\{2\}\([_@].*\)\?\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QT"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QT"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
+s:^[^%].*::
+s:%lang(C) ::
+/^$/d' >> $MO_NAME
+
+find "$TOP_DIR" -type d|sed '
+s:'"$TOP_DIR"'::
+'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\)::
+'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
+s:^\([^%].*\)::
+s:%lang(C) ::
+/^$/d' >> $MO_NAME
+
+find "$TOP_DIR" -type f -o -type l|sed '
+s:'"$TOP_DIR"'::
+'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
+s:^\([^%].*\)::
+s:%lang(C) ::
+/^$/d' >> $MO_NAME
if ! grep -q / $MO_NAME; then
echo "No translations found for ${NAME} in ${TOP_DIR}"