libreoffice-i18n: skip pre-installed languages

Closes #4737
This commit is contained in:
Juergen Buchmueller 2016-09-09 08:12:48 +02:00
parent 5619174eed
commit 87239c8d96
1 changed files with 27 additions and 20 deletions

View File

@ -1,7 +1,7 @@
# Template file for 'libreoffice-i18n' # Template file for 'libreoffice-i18n'
pkgname=libreoffice-i18n pkgname=libreoffice-i18n
version=5.2.0 version=5.2.0
revision=1 revision=2
build_style=meta build_style=meta
nocross=yes nocross=yes
hostmakedepends="rpmextract" hostmakedepends="rpmextract"
@ -10,6 +10,7 @@ maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="LGPL-3" license="LGPL-3"
homepage="http://www.documentfoundation.org/" homepage="http://www.documentfoundation.org/"
_url="http://download.documentfoundation.org/libreoffice/stable/${version}/rpm/x86" _url="http://download.documentfoundation.org/libreoffice/stable/${version}/rpm/x86"
_skiplang="en-US de es fr it pl pt"
distfiles=" distfiles="
${_url}/LibreOffice_${version}_Linux_x86_rpm_helppack_am.tar.gz ${_url}/LibreOffice_${version}_Linux_x86_rpm_helppack_am.tar.gz
${_url}/LibreOffice_${version}_Linux_x86_rpm_helppack_ast.tar.gz ${_url}/LibreOffice_${version}_Linux_x86_rpm_helppack_ast.tar.gz
@ -292,7 +293,8 @@ do_build() {
_tarbname="${i##*/}" _tarbname="${i##*/}"
_tarbname="${_tarbname%*.tar.gz}" _tarbname="${_tarbname%*.tar.gz}"
_lang="${_tarbname##*_}" _lang="${_tarbname##*_}"
echo "Unpacking ${_tarbname}..." if [ "${_skiplang/${_lang}/}" = "${_skiplang}" ]; then
echo "Unpacking ${_tarbname} ${_lang}..."
# We create a directory using p_${_lang}, for example p_zh-TW, containing # We create a directory using p_${_lang}, for example p_zh-TW, containing
# opt/libreofficeX.Y/out, with helppack and/or langpack # opt/libreofficeX.Y/out, with helppack and/or langpack
# extracted inside it. # extracted inside it.
@ -305,8 +307,11 @@ do_build() {
rpmextract ${wrksrc}/LibreOffice_${_localver}_Linux_x86_rpm_langpack_${_lang}/RPMS/*.rpm rpmextract ${wrksrc}/LibreOffice_${_localver}_Linux_x86_rpm_langpack_${_lang}/RPMS/*.rpm
fi fi
mkdir -p out mkdir -p out
cp -pRv opt/libreoffice${version%.*}/* out/ cp -pR opt/libreoffice${version%.*}/* out/
rm -rf opt rm -rf opt
else
echo "Skipping ${_lang}..."
fi
done done
} }
do_install() { do_install() {
@ -318,6 +323,7 @@ depends="libreoffice>=${version} ${subpackages}"
for _lang in "${_languages[@]}"; do for _lang in "${_languages[@]}"; do
_locale=${_lang%% *} _locale=${_lang%% *}
if [ "${_skiplang/$_locale/}" = "${_skiplang}" ]; then
_pkgname=libreoffice-i18n-${_locale} _pkgname=libreoffice-i18n-${_locale}
depends+=" ${_pkgname}>=${version}" depends+=" ${_pkgname}>=${version}"
@ -325,6 +331,7 @@ for _lang in "${_languages[@]}"; do
eval "${_pkgname}_package() { eval "${_pkgname}_package() {
_pkgtmpl ${_lang} ${version%.*} _pkgtmpl ${_lang} ${version%.*}
}" }"
fi
done done
_pkgtmpl() { _pkgtmpl() {