--- ./scripts/find-lang.sh.orig 2017-01-19 13:48:53.548472521 +0000 +++ ./scripts/find-lang.sh 2017-01-19 13:53:09.922690409 +0000 @@ -11,6 +11,8 @@ #in tact and are included with any redistribution of this file or any #work based on this file. +# 2016-05-19 Dominique Leuenberger +# * Add support to create a metainfo.xml for -lang packages # 2011-11-16 Per Øyvind Karlsen # * add support for HTML files (from Mandriva) # 2004-06-20 Arkadiusz Miśkiewicz @@ -41,6 +43,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 } @@ -72,6 +75,7 @@ ALL_NAME=# NO_ALL_NAME= ONLY_C=# NO_C=# +METAINFO=# while test $# -gt 0 ; do case "${1}" in @@ -128,6 +132,11 @@ while test $# -gt 0 ; do NO_C= shift ;; + --metainfo ) + METAINFO= + METADESKID=${2} + shift 2 + ;; * ) MO_NAME=${1} shift @@ -330,6 +339,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 < + + + ${METADESKID}-lang + ${METADESKID}.desktop + Translations + Translate the user interface + CC0-1.0 + https://bugzilla.opensuse.org + +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