rpm/rpm-findlang-inject-metainfo.patch

56 lines
1.5 KiB
Diff
Raw Normal View History

--- scripts/find-lang.sh.orig 2018-01-31 13:37:22.810352621 +0000
+++ scripts/find-lang.sh 2018-01-31 13:39:38.117990971 +0000
@@ -32,6 +32,7 @@ Additional options:
--with-man find localized man pages
--all-name match all package/domain names
--without-mo do not find locale files
+ --metainfo create a metainfo.xml file for AppStream
EOF
exit 1
}
@@ -62,6 +63,7 @@ ALL_NAME=#
NO_ALL_NAME=
ONLY_C=#
NO_C=#
+METAINFO=#
while test $# -gt 0 ; do
case "${1}" in
--with-gnome )
@@ -113,6 +115,11 @@ while test $# -gt 0 ; do
NO_C=
shift
;;
+ --metainfo )
+ METAINFO=
+ METADESKID=${2}
+ shift 2
+ ;;
* )
if [ $MO_NAME != ${NAMES[$#]}.lang ]; then
NAMES[${#NAMES[@]}]=$MO_NAME
@@ -323,6 +330,24 @@ if ! grep -q / $MO_NAME_NEW; then
exit 1
fi
+if [ -z "${METAINFO}" ] ; then
+ # create a metainfo.xml file for METADESKID
+ mkdir -p ${TOP_DIR}/usr/share/appdata
+ cat > ${TOP_DIR}/usr/share/appdata/${METADESKID}-lang.metainfo.xml <<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2016 openSUSE - file is auto-generated -->
+<component type="addon">
+ <id>${METADESKID}-lang</id>
+ <extends>${METADESKID}.desktop</extends>
+ <name>Translations</name>
+ <summary>Translate the user interface</summary>
+ <metadata_license>CC0-1.0</metadata_license>
+ <updatecontact>https://bugzilla.opensuse.org</updatecontact>
+</component>
+EOF
+ echo /usr/share/appdata/${METADESKID}-lang.metainfo.xml >> $MO_NAME_NEW
+fi
+
sort -u $MO_NAME_NEW >> $MO_NAME
rm -f $MO_NAME_NEW