find-lang.sh: support Qt translation files and localized man pages [release 5.2.1-27mamba;Tue Mar 31 2015]

This commit is contained in:
Davide Madrisan 2024-01-05 17:29:04 +01:00
parent 0d60b72420
commit 4f3469686d
2 changed files with 89 additions and 1 deletions

View File

@ -0,0 +1,83 @@
--- 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}"

View File

@ -33,7 +33,7 @@
Name: rpm
Version: 5.2.1
Release: 26mamba
Release: 27mamba
Summary: The RPM package management system
Group: System/Management
Vendor: openmamba
@ -101,6 +101,7 @@ Patch62: rpm-5.2.1-python-2.7.patch
Patch63: rpm-5.2.1-sourcepackage-rpm4.patch
Patch64: rpm-5.2.1-build-from-tarball.patch
Patch65: rpm-5.2.1-build-fix-arm.patch
Patch66: rpm-5.2.1-find_lang_support_localized_qt_and_man_files.patch
License: LGPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
@ -305,6 +306,7 @@ This package should be installed if you want to develop Python programs that wil
%patch63 -p1
%patch64 -p1
%patch65 -p1
%patch66 -p1
mkdir platform-macros
cd platform-macros
@ -626,6 +628,9 @@ fi
%endif
%changelog
* Tue Mar 31 2015 Davide Madrisan <davide.madrisan@gmail.com> 5.2.1-27mamba
- find-lang.sh: support Qt translation files and localized man pages
* Tue Oct 07 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 5.2.1-26mamba
- rebuilt with --with-xz to support rpmlib(PayloadIsXz)