/[gentoo-x86]/eclass/office-ext-r1.eclass
Gentoo

Diff of /eclass/office-ext-r1.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.4
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/office-ext-r1.eclass,v 1.3 2013/03/23 10:24:42 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/office-ext-r1.eclass,v 1.4 2013/03/29 10:02:23 scarabeus Exp $
4 4
5# @ECLASS: office-ext-r1.eclass 5# @ECLASS: office-ext-r1.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# The office team <openoffice@gentoo.org> 7# The office team <openoffice@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
54# @CODE 54# @CODE
55[[ -z ${OFFICE_EXTENSIONS} ]] && die "OFFICE_EXTENSIONS variable is unset." 55[[ -z ${OFFICE_EXTENSIONS} ]] && die "OFFICE_EXTENSIONS variable is unset."
56if [[ "$(declare -p OFFICE_EXTENSIONS 2>/dev/null 2>&1)" != "declare -a"* ]]; then 56if [[ "$(declare -p OFFICE_EXTENSIONS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
57 die "OFFICE_EXTENSIONS variable is not an array." 57 die "OFFICE_EXTENSIONS variable is not an array."
58fi 58fi
59
60# @ECLASS-VARIABLE: OFFICE_EXTENSIONS_LOCATION
61# @DESCRIPTION:
62# Path to the extensions location. Defaults to ${DISTDIR}.
63#
64# Example:
65# @CODE
66# OFFICE_EXTENSIONS_LOCATION="${S}/unpacked/"
67# @CODE
68: ${OFFICE_EXTENSIONS_LOCATION:=${DISTDIR}}
59 69
60IUSE="" 70IUSE=""
61RDEPEND="" 71RDEPEND=""
62 72
63for i in ${OFFICE_IMPLEMENTATIONS[@]}; do 73for i in ${OFFICE_IMPLEMENTATIONS[@]}; do
95 default 105 default
96 106
97 for i in ${OFFICE_EXTENSIONS[@]}; do 107 for i in ${OFFICE_EXTENSIONS[@]}; do
98 # Unpack the extensions where required and add case for oxt 108 # Unpack the extensions where required and add case for oxt
99 # which should be most common case for the extensions. 109 # which should be most common case for the extensions.
100 if [[ -f "${DISTDIR}/${i}" ]] ; then 110 if [[ -f "${OFFICE_EXTENSIONS_LOCATION}/${i}" ]] ; then
101 case ${i} in 111 case ${i} in
102 *.oxt) 112 *.oxt)
113 mkdir -p "${WORKDIR}/${i}/"
114 pushd "${WORKDIR}/${i}/" > /dev/null
103 echo ">>> Unpacking "${DISTDIR}/${i}" to ${PWD}" 115 echo ">>> Unpacking "${OFFICE_EXTENSIONS_LOCATION}/${i}" to ${PWD}"
104 unzip -qo ${DISTDIR}/${i} 116 unzip -qo ${OFFICE_EXTENSIONS_LOCATION}/${i}
105 assert "failed unpacking ${DISTDIR}/${i}" 117 assert "failed unpacking ${OFFICE_EXTENSIONS_LOCATION}/${i}"
118 popd > /dev/null
106 ;; 119 ;;
107 *) unpack ${i} ;; 120 *) unpack ${i} ;;
108 esac 121 esac
109 fi 122 fi
110 done 123 done
125 # OOO needs to use uno because direct deployment segfaults. 138 # OOO needs to use uno because direct deployment segfaults.
126 # This is bug by their side, but i don't want to waste time 139 # This is bug by their side, but i don't want to waste time
127 # fixing it myself. 140 # fixing it myself.
128 insinto /usr/$(get_libdir)/${i}/share/extension/install 141 insinto /usr/$(get_libdir)/${i}/share/extension/install
129 for j in ${OFFICE_EXTENSIONS[@]}; do 142 for j in ${OFFICE_EXTENSIONS[@]}; do
130 doins ${DISTDIR}/${j} 143 doins ${OFFICE_EXTENSIONS_LOCATION}/${j}
131 done 144 done
132 else 145 else
146 for j in ${OFFICE_EXTENSIONS[@]}; do
147 pushd "${WORKDIR}/${j}/" > /dev/null
133 insinto /usr/$(get_libdir)/${i}/share/extensions/${PN} 148 insinto /usr/$(get_libdir)/${i}/share/extensions/${j/.oxt/}
134 doins -r * 149 doins -r *
150 popd > /dev/null
151 done
135 fi 152 fi
136 fi 153 fi
137 done 154 done
138} 155}
139 156

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20