/[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.1 Revision 1.2
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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/Attic/office-ext.eclass,v 1.1 2011/09/05 08:25:58 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/office-ext.eclass,v 1.2 2011/11/12 12:03:05 scarabeus Exp $
4 4
5# @ECLASS: office-ext.eclass 5# @ECLASS: office-ext.eclass
6# @AUTHOR: 6# @AUTHOR:
7# Tomáš Chvátal <scarabeus@gentoo.org> 7# Tomáš Chvátal <scarabeus@gentoo.org>
8# @MAINTAINER: 8# @MAINTAINER:
13 13
14case "${EAPI:-0}" in 14case "${EAPI:-0}" in
15 4) OEXT_EXPORTED_FUNCTIONS="src_install pkg_postinst pkg_prerm" ;; 15 4) OEXT_EXPORTED_FUNCTIONS="src_install pkg_postinst pkg_prerm" ;;
16 *) die "EAPI=${EAPI} is not supported" ;; 16 *) die "EAPI=${EAPI} is not supported" ;;
17esac 17esac
18
19EXPORT_FUNCTIONS ${OEXT_EXPORTED_FUNCTIONS}
20unset OEXT_EXPORTED_FUNCTIONS
21 18
22inherit eutils multilib 19inherit eutils multilib
23 20
24UNOPKG_BINARY="${EPREFIX}/usr/bin/unopkg" 21UNOPKG_BINARY="${EPREFIX}/usr/bin/unopkg"
25 22
74 debug-print-function ${FUNCNAME} "$@" 71 debug-print-function ${FUNCNAME} "$@"
75 local ext=$1 72 local ext=$1
76 local tmpdir=$(mktemp -d --tmpdir="${T}") 73 local tmpdir=$(mktemp -d --tmpdir="${T}")
77 74
78 debug-print "${FUNCNAME}: ${UNOPKG_BINARY} add --shared \"${ext}\"" 75 debug-print "${FUNCNAME}: ${UNOPKG_BINARY} add --shared \"${ext}\""
79 ebegin "Adding extension: \"${ext}\"" 76 ebegin "Adding office extension: \"${ext}\""
80 ${UNOPKG_BINARY} add --shared "${ext}" \ 77 ${UNOPKG_BINARY} add --shared "${ext}" \
81 "-env:UserInstallation=file:///${tmpdir}" \ 78 "-env:UserInstallation=file:///${tmpdir}" \
82 "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1" 79 "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
83 eend $? 80 eend $?
84 rm -rf "${tmpdir}" 81 rm -rf "${tmpdir}"
91 debug-print-function ${FUNCNAME} "$@" 88 debug-print-function ${FUNCNAME} "$@"
92 local ext=$1 89 local ext=$1
93 local tmpdir=$(mktemp -d --tmpdir="${T}") 90 local tmpdir=$(mktemp -d --tmpdir="${T}")
94 91
95 debug-print "${FUNCNAME}: ${UNOPKG_BINARY} remove --shared \"${ext}\"" 92 debug-print "${FUNCNAME}: ${UNOPKG_BINARY} remove --shared \"${ext}\""
96 ebegin "Removing extension: \"${ext}\"" 93 ebegin "Removing office extension: \"${ext}\""
97 ${UNOPKG_BINARY} remove --shared "${ext}" \ 94 ${UNOPKG_BINARY} remove --shared "${ext}" \
98 "-env:UserInstallation=file:///${tmpdir}" \ 95 "-env:UserInstallation=file:///${tmpdir}" \
99 "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1" 96 "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
100 eend $? 97 eend $?
101 flush_unopkg_cache 98 office-ext_flush_unopkg_cache
102 rm -rf "${tmpdir}" 99 rm -rf "${tmpdir}"
103} 100}
104 101
105# @FUNCTION: office-ext_src_install 102# @FUNCTION: office-ext_src_install
106# @DESCRIPTION: 103# @DESCRIPTION:
107# Install the extension source to the proper location. 104# Install the extension source to the proper location.
108office-ext_src_install() { 105office-ext_src_install() {
109 debug-print-function ${FUNCNAME} "$@" 106 debug-print-function ${FUNCNAME} "$@"
107 debug-print "Extensions: ${OO_EXTENSIONS[@]}"
110 local i 108 local i
111 109
112 # subshell to not pollute rest of the env with the insinto redefinition 110 # subshell to not pollute rest of the env with the insinto redefinition
113 ( 111 (
112 dodir $(office-ext_get_implementation)/share/extension/install/
114 insinto $(openoffice-ext_get_implementation)/share/extension/install/ 113 insinto $(office-ext_get_implementation)/share/extension/install/
115 for i in "${OO_EXTENSIONS[@]}"; do 114 for i in ${OO_EXTENSIONS[@]}; do
116 doins "${i}" 115 doins "${i}"
117 done 116 done
118 ) 117 )
119 118
120 einfo "Remember that if you replace your office implementation," 119 einfo "Remember that if you replace your office implementation,"
121 einfo "you need to recompile all the extensions." 120 einfo "you need to recompile all the extensions."
122 einfo "Your current implementation location is: " 121 einfo "Your current implementation location is: "
123 einfo " $(openoffice-ext_get_implementation)" 122 einfo " $(office-ext_get_implementation)"
124} 123}
125 124
126# @FUNCTION: office-ext_pkg_postinst 125# @FUNCTION: office-ext_pkg_postinst
127# @DESCRIPTION: 126# @DESCRIPTION:
128# Add the extensions to the libreoffice/openoffice. 127# Add the extensions to the libreoffice/openoffice.
129office-ext_pkg_postinst() { 128office-ext_pkg_postinst() {
130 debug-print-function ${FUNCNAME} "$@" 129 debug-print-function ${FUNCNAME} "$@"
130 debug-print "Extensions: ${OO_EXTENSIONS[@]}"
131 local i 131 local i
132 132
133 for i in "${OO_EXTENSIONS[$@]}"; do 133 for i in ${OO_EXTENSIONS[@]}; do
134 openoffice-ext_add_extension "${i}" 134 office-ext_add_extension "$(office-ext_get_implementation)/share/extension/install/${i}"
135 done 135 done
136 136
137} 137}
138 138
139# @FUNCTION: office-ext_pkg_prerm 139# @FUNCTION: office-ext_pkg_prerm
140# @DESCRIPTION: 140# @DESCRIPTION:
141# Remove the extensions from the libreoffice/openoffice. 141# Remove the extensions from the libreoffice/openoffice.
142office-ext_pkg_prerm() { 142office-ext_pkg_prerm() {
143 debug-print-function ${FUNCNAME} "$@" 143 debug-print-function ${FUNCNAME} "$@"
144 debug-print "Extensions: ${OO_EXTENSIONS[@]}"
144 local i 145 local i
145 146
146 for i in "${OO_EXTENSIONS[@]}"; do 147 for i in ${OO_EXTENSIONS[@]}; do
147 openoffice-ext_remove_extension "${i}" 148 office-ext_remove_extension "${i}"
148 done 149 done
149} 150}
151
152EXPORT_FUNCTIONS ${OEXT_EXPORTED_FUNCTIONS}
153unset OEXT_EXPORTED_FUNCTIONS

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

  ViewVC Help
Powered by ViewVC 1.1.20