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

Diff of /eclass/office-ext.eclass

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

Revision 1.2 Revision 1.7
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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.eclass,v 1.2 2011/11/12 12:03:05 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/office-ext.eclass,v 1.7 2012/09/27 16:35:41 axs Exp $
4 4
5# @ECLASS: office-ext.eclass 5# @ECLASS: office-ext.eclass
6# @MAINTAINER:
7# The office team <openoffice@gentoo.org>
6# @AUTHOR: 8# @AUTHOR:
7# Tomáš Chvátal <scarabeus@gentoo.org> 9# Tomáš Chvátal <scarabeus@gentoo.org>
8# @MAINTAINER:
9# The office team <openoffice@gentoo.org>
10# @BLURB: Eclass for installing libreoffice/openoffice extensions 10# @BLURB: Eclass for installing libreoffice/openoffice extensions
11# @DESCRIPTION: 11# @DESCRIPTION:
12# Eclass for easing maitenance of libreoffice/openoffice extensions. 12# Eclass for easing maitenance of libreoffice/openoffice extensions.
13 13
14case "${EAPI:-0}" in 14case "${EAPI:-0}" in
15 4) OEXT_EXPORTED_FUNCTIONS="src_install pkg_postinst pkg_prerm" ;; 15 4|5) OEXT_EXPORTED_FUNCTIONS="src_unpack src_install pkg_postinst pkg_prerm" ;;
16 *) die "EAPI=${EAPI} is not supported" ;; 16 *) die "EAPI=${EAPI} is not supported" ;;
17esac 17esac
18 18
19inherit eutils multilib 19inherit eutils multilib
20 20
29 die "OO_EXTENSIONS variable is not an array." 29 die "OO_EXTENSIONS variable is not an array."
30fi 30fi
31 31
32DEPEND="virtual/ooo" 32DEPEND="virtual/ooo"
33RDEPEND="virtual/ooo" 33RDEPEND="virtual/ooo"
34
35# Most projects actually do not provide any workdir and we do not unpack the
36# .oxt file at all.
37S="${WORKDIR}"
38
39# @FUNCTION: office-ext_src_unpack
40# @DESCRIPTION:
41# Flush the cache after removal of an extension.
42office-ext_src_unpack() {
43 debug-print-function ${FUNCNAME} "$@"
44 local i
45
46 default
47
48 for i in ${OO_EXTENSIONS[@]}; do
49 # Copy only if the oxt is present, sometimes they are in tarballs
50 # so we want to fail only when we do need to do the cp.
51 if [[ -f "${DISTDIR}/${i}" ]] ; then
52 debug-print "${FUNCNAME}: cp -v \"${DISTDIR}/${i}\" \"${S}\""
53 cp -v "${DISTDIR}/${i}" "${S}" || die
54 fi
55 done
56}
34 57
35# @FUNCTION: office-ext_flush_unopkg_cache 58# @FUNCTION: office-ext_flush_unopkg_cache
36# @DESCRIPTION: 59# @DESCRIPTION:
37# Flush the cache after removal of an extension. 60# Flush the cache after removal of an extension.
38office-ext_flush_unopkg_cache() { 61office-ext_flush_unopkg_cache() {
72 local ext=$1 95 local ext=$1
73 local tmpdir=$(mktemp -d --tmpdir="${T}") 96 local tmpdir=$(mktemp -d --tmpdir="${T}")
74 97
75 debug-print "${FUNCNAME}: ${UNOPKG_BINARY} add --shared \"${ext}\"" 98 debug-print "${FUNCNAME}: ${UNOPKG_BINARY} add --shared \"${ext}\""
76 ebegin "Adding office extension: \"${ext}\"" 99 ebegin "Adding office extension: \"${ext}\""
77 ${UNOPKG_BINARY} add --shared "${ext}" \ 100 ${UNOPKG_BINARY} add --suppress-license \
101 --shared "${ext}" \
78 "-env:UserInstallation=file:///${tmpdir}" \ 102 "-env:UserInstallation=file:///${tmpdir}" \
79 "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1" 103 "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
80 eend $? 104 eend $?
81 rm -rf "${tmpdir}" 105 rm -rf "${tmpdir}"
82} 106}
89 local ext=$1 113 local ext=$1
90 local tmpdir=$(mktemp -d --tmpdir="${T}") 114 local tmpdir=$(mktemp -d --tmpdir="${T}")
91 115
92 debug-print "${FUNCNAME}: ${UNOPKG_BINARY} remove --shared \"${ext}\"" 116 debug-print "${FUNCNAME}: ${UNOPKG_BINARY} remove --shared \"${ext}\""
93 ebegin "Removing office extension: \"${ext}\"" 117 ebegin "Removing office extension: \"${ext}\""
94 ${UNOPKG_BINARY} remove --shared "${ext}" \ 118 ${UNOPKG_BINARY} remove --suppress-license \
119 --shared "${ext}" \
95 "-env:UserInstallation=file:///${tmpdir}" \ 120 "-env:UserInstallation=file:///${tmpdir}" \
96 "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1" 121 "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
97 eend $? 122 eend $?
98 office-ext_flush_unopkg_cache 123 office-ext_flush_unopkg_cache
99 rm -rf "${tmpdir}" 124 rm -rf "${tmpdir}"

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20