Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 245242
Collapse All | Expand All

(-)Desktop/openoffice-ext.eclass (-19 / +23 lines)
Lines 10-56 Link Here
10
# list of extentions
10
# list of extentions
11
# OOO_EXTENSIONS="" 
11
# OOO_EXTENSIONS="" 
12
12
13
OOO_ROOT_DIR="/usr/$(get_libdir)/openoffice"
14
OOO_PROGRAM_DIR="${OOO_ROOT_DIR}/program"
15
UNOPKG="${OOO_PROGRAM_DIR}/unopkg"
16
OOO_EXT_DIR="${OOO_ROOT_DIR}/share/extension/install"
17
13
add_extension() {
18
add_extension() {
14
  echo -n "Adding extension $1..."
19
  ebegin "Adding extension $1"
15
  INSTDIR=`mktemp -d`
20
  INSTDIR=$(mktemp -d --tmpdir=${T})
16
  /usr/lib/openoffice/program/unopkg add --shared $1 \
21
  ${UNOPKG} add --shared $1 \
17
    "-env:UserInstallation=file:///$INSTDIR" \
22
    "-env:UserInstallation=file:///${INSTDIR}" \
18
    "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
23
    "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
19
#     '-env:UNO_JAVA_JFW_INSTALL_DATA=$ORIGIN/../share/config/javasettingsunopkginstall.xml' \    
24
  if [ -n ${INSTDIR} ]; then rm -rf ${INSTDIR}; fi
20
  if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
25
  eend
21
  echo " done."
22
}
26
}
23
27
24
flush_unopkg_cache() {
28
flush_unopkg_cache() {
25
    /usr/lib/openoffice/program/unopkg list --shared > /dev/null 2>&1
29
    ${UNOPKG} list --shared > /dev/null 2>&1
26
}
30
}
27
31
28
remove_extension() {
32
remove_extension() {
29
  if /usr/lib/openoffice/program/unopkg list --shared $1 >/dev/null; then
33
  if ${UNOPKG} list --shared $1 >/dev/null; then
30
    echo -n "Removing extension $1..."
34
    ebegin "Removing extension $1"
31
    INSTDIR=`mktemp -d`
35
    INSTDIR=$(mktemp -d --tmpdir=${T})
32
    /usr/lib/openoffice/program/unopkg remove --shared $1 \
36
    ${UNOPKG} remove --shared $1 \
33
      "-env:UserInstallation=file://$INSTDIR" \
37
      "-env:UserInstallation=file://${INSTDIR}" \
34
      "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
38
      "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
35
#       '-env:UNO_JAVA_JFW_INSTALL_DATA=$ORIGIN/../share/config/javasettingsunopkginstall.xml' \
39
    if [ -n ${INSTDIR} ]; then rm -rf ${INSTDIR}; fi
36
    if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
40
    eend
37
    echo " done."
38
    flush_unopkg_cache
41
    flush_unopkg_cache
39
  fi
42
  fi
40
}
43
}
41
44
42
openoffice-ext_src_install() {
45
openoffice-ext_src_install() {
43
	insinto /usr/$(get_libdir)/openoffice/share/extension/install
46
	cd "${S}" || die
47
	insinto ${OOO_EXT_DIR}
44
	for i in ${OOO_EXTENSIONS}
48
	for i in ${OOO_EXTENSIONS}
45
	do
49
	do
46
		doins ${i}
50
		doins ${i} || die "doins failed."
47
	done
51
	done
48
}
52
}
49
53
50
openoffice-ext_pkg_postinst() {
54
openoffice-ext_pkg_postinst() {
51
	for i in ${OOO_EXTENSIONS}
55
	for i in ${OOO_EXTENSIONS}
52
	do
56
	do
53
		add_extension /usr/$(get_libdir)/openoffice/share/extension/install/${i}
57
		add_extension ${OOO_EXT_DIR}/${i}
54
	done
58
	done
55
59
56
}
60
}

Return to bug 245242