From 28ff5530043e9e974032e313878ab168eb452ada Mon Sep 17 00:00:00 2001 From: Tomas Chvatal Date: Fri, 29 Mar 2013 10:02:23 +0000 Subject: Allow specification of directory where the extensions are. Also allow one package providing multiple oxts correctly. Wrt bug#463536. --- eclass/office-ext-r1.eclass | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'eclass/office-ext-r1.eclass') diff --git a/eclass/office-ext-r1.eclass b/eclass/office-ext-r1.eclass index 168205167b3a..f7d479096ced 100644 --- a/eclass/office-ext-r1.eclass +++ b/eclass/office-ext-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/office-ext-r1.eclass,v 1.3 2013/03/23 10:24:42 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/office-ext-r1.eclass,v 1.4 2013/03/29 10:02:23 scarabeus Exp $ # @ECLASS: office-ext-r1.eclass # @MAINTAINER: @@ -57,6 +57,16 @@ if [[ "$(declare -p OFFICE_EXTENSIONS 2>/dev/null 2>&1)" != "declare -a"* ]]; th die "OFFICE_EXTENSIONS variable is not an array." fi +# @ECLASS-VARIABLE: OFFICE_EXTENSIONS_LOCATION +# @DESCRIPTION: +# Path to the extensions location. Defaults to ${DISTDIR}. +# +# Example: +# @CODE +# OFFICE_EXTENSIONS_LOCATION="${S}/unpacked/" +# @CODE +: ${OFFICE_EXTENSIONS_LOCATION:=${DISTDIR}} + IUSE="" RDEPEND="" @@ -97,12 +107,15 @@ office-ext-r1_src_unpack() { for i in ${OFFICE_EXTENSIONS[@]}; do # Unpack the extensions where required and add case for oxt # which should be most common case for the extensions. - if [[ -f "${DISTDIR}/${i}" ]] ; then + if [[ -f "${OFFICE_EXTENSIONS_LOCATION}/${i}" ]] ; then case ${i} in *.oxt) - echo ">>> Unpacking "${DISTDIR}/${i}" to ${PWD}" - unzip -qo ${DISTDIR}/${i} - assert "failed unpacking ${DISTDIR}/${i}" + mkdir -p "${WORKDIR}/${i}/" + pushd "${WORKDIR}/${i}/" > /dev/null + echo ">>> Unpacking "${OFFICE_EXTENSIONS_LOCATION}/${i}" to ${PWD}" + unzip -qo ${OFFICE_EXTENSIONS_LOCATION}/${i} + assert "failed unpacking ${OFFICE_EXTENSIONS_LOCATION}/${i}" + popd > /dev/null ;; *) unpack ${i} ;; esac @@ -127,11 +140,15 @@ office-ext-r1_src_install() { # fixing it myself. insinto /usr/$(get_libdir)/${i}/share/extension/install for j in ${OFFICE_EXTENSIONS[@]}; do - doins ${DISTDIR}/${j} + doins ${OFFICE_EXTENSIONS_LOCATION}/${j} done else - insinto /usr/$(get_libdir)/${i}/share/extensions/${PN} - doins -r * + for j in ${OFFICE_EXTENSIONS[@]}; do + pushd "${WORKDIR}/${j}/" > /dev/null + insinto /usr/$(get_libdir)/${i}/share/extensions/${j/.oxt/} + doins -r * + popd > /dev/null + done fi fi done -- cgit v1.2.3-65-gdbad