summaryrefslogtreecommitdiff
path: root/eclass/libreoffice-l10n-2.eclass
diff options
context:
space:
mode:
authorBlackNoxis <steven.darklight@gmail.com>2014-02-15 23:47:31 +0200
committerBlackNoxis <steven.darklight@gmail.com>2014-02-15 23:47:31 +0200
commit4200824066cf7bd05d5896539db5b675e306031d (patch)
treee0694905906e7f9030fb8a2eb46e41eae300bedf /eclass/libreoffice-l10n-2.eclass
parent539ab2c329ef87cb855c5965a4e3995af9b1cad3 (diff)
overwriting and upgrading current eclasses
Diffstat (limited to 'eclass/libreoffice-l10n-2.eclass')
-rw-r--r--eclass/libreoffice-l10n-2.eclass42
1 files changed, 28 insertions, 14 deletions
diff --git a/eclass/libreoffice-l10n-2.eclass b/eclass/libreoffice-l10n-2.eclass
index 79d74359..05a912e8 100644
--- a/eclass/libreoffice-l10n-2.eclass
+++ b/eclass/libreoffice-l10n-2.eclass
@@ -36,20 +36,36 @@ LANGPACK_AVAIL="${LANGPACK_AVAIL:-1}"
DESCRIPTION="LibreOffice.org ${L10N_LANG} localisation"
HOMEPAGE="http://www.documentfoundation.org"
-RESTRICT="nomirror"
+RESTRICT="mirror"
L10N_VER="$(get_version_component_range 1-3)"
-L10N_RC_VERSION="rc2"
+L10N_RC_VERSION="$(get_version_component_range 4)"
LO_BRANCH=$(get_version_component_range 1-2)
-BASE_SRC_URI="http://download.documentfoundation.org/libreoffice/stable/${L10N_VER}/rpm"
+if [ -n "${L10N_RC_VERSION}" ]; then
+ # this is a RC, thus testing
+ BASE_SRC_URI="http://download.documentfoundation.org/libreoffice/testing/${L10N_VER}/rpm"
+ TARBALL_VERSION="${L10N_VER}.${L10N_RC_VERSION}"
+else
+ BASE_SRC_URI="http://download.documentfoundation.org/libreoffice/stable/${L10N_VER}/rpm"
+ TARBALL_VERSION="${L10N_VER}"
+fi
SRC_URI=""
+if [ "$(get_version_component_range 1)" = "3" ]; then
+ URI_PREFIX="LibO"
+ RPM_SUFFIX_LANG="langpack-rpm"
+ RPM_SUFFIX_HELP="helppack-rpm"
+else
+ URI_PREFIX="LibreOffice"
+ RPM_SUFFIX_LANG="rpm_langpack"
+ RPM_SUFFIX_HELP="rpm_helppack"
+fi
# try guessing
if [ "${LANGPACK_AVAIL}" = "1" ]; then
- SRC_URI+="${BASE_SRC_URI}/x86/LibO_${L10N_VER}_Linux_x86_langpack-rpm_${MY_LANG}.tar.gz"
+ SRC_URI+="${BASE_SRC_URI}/x86/${URI_PREFIX}_${TARBALL_VERSION}_Linux_x86_${RPM_SUFFIX_LANG}_${MY_LANG}.tar.gz"
fi
if [ "${HELPPACK_AVAIL}" = "1" ]; then
- SRC_URI+=" ${BASE_SRC_URI}/x86/LibO_${L10N_VER}_Linux_x86_helppack-rpm_${MY_LANG}.tar.gz"
+ SRC_URI+=" ${BASE_SRC_URI}/x86/${URI_PREFIX}_${TARBALL_VERSION}_Linux_x86_${RPM_SUFFIX_HELP}_${MY_LANG}.tar.gz"
fi
IUSE=""
@@ -83,22 +99,20 @@ libreoffice-l10n-2_src_unpack() {
local dir=${lang/_/-}
# for english we provide just helppack, as translation is always there
if [[ "${LANGPACK_AVAIL}" == "1" ]]; then
- rpmdir="LibO_${L10N_VER}${L10N_RC_VERSION}_Linux_x86_langpack-rpm_${dir}/RPMS/"
- [[ -d ${rpmdir} ]] || die "Missing directory: \"${rpmdir}\""
+ rpmdir="${URI_PREFIX}_${TARBALL_VERSION}"*"_Linux_x86_${RPM_SUFFIX_LANG}_${dir}/RPMS/"
# First remove dictionaries, we want to use system ones.
rm -rf "${S}/${rpmdir}/"*dict*.rpm
einfo "Unpacking Langpack"
- rpm_unpack "./${rpmdir}/"*.rpm
+ rpm_unpack ./${rpmdir}/*.rpm
fi
if [[ "${HELPPACK_AVAIL}" == "1" ]]; then
- rpmdir="LibO_${L10N_VER}${L10N_RC_VERSION}_Linux_x86_helppack-rpm_${dir}/RPMS/"
- [[ -d ${rpmdir} ]] || die "Missing directory: \"${rpmdir}\""
+ rpmdir="${URI_PREFIX}_${TARBALL_VERSION}"*"_Linux_x86_${RPM_SUFFIX_HELP}_${dir}/RPMS/"
einfo "Unpacking Helppack"
- rpm_unpack ./"${rpmdir}/"*.rpm
+ rpm_unpack ./${rpmdir}/*.rpm
fi
if [[ -n "${TDEPEND}" ]]; then
if use templates; then
- for i in ${OO_EXTENSIONS[@]}; do
+ for i in "${OO_EXTENSIONS[@]}"; do
if [[ ! -f "${S}/${i}" ]]; then
cp -v "${DISTDIR}/${i}" "${S}"
ooextused+=( "${i}" )
@@ -107,8 +121,8 @@ libreoffice-l10n-2_src_unpack() {
fi
fi
OO_EXTENSIONS=()
- for i in ${ooextused[@]}; do
- OO_EXTENSIONS+=( ${i} )
+ for i in "${ooextused[@]}"; do
+ OO_EXTENSIONS+=( "${i}" )
done
}