toolchain.eclass: move gentoo patches into own helper
[gentoo.git] / eclass / office-ext-r1.eclass
index f9492a839f31d9c61ba56cc2aa7f607812117a9e..04df18698fb801315a7894a4618853d133f855c6 100644 (file)
@@ -1,22 +1,23 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
-# $Id$
 
 # @ECLASS: office-ext-r1.eclass
 # @MAINTAINER:
-# The office team <openoffice@gentoo.org>
+# The office team <office@gentoo.org>
 # @AUTHOR:
 # Tomáš Chvátal <scarabeus@gentoo.org>
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Eclass for installing libreoffice/openoffice extensions
 # @DESCRIPTION:
-# Eclass for easing maitenance of libreoffice/openoffice extensions.
+# Eclass for easing maintenance of libreoffice/openoffice extensions.
 
 case "${EAPI:-0}" in
-       5) OEXT_EXPORTED_FUNCTIONS="src_unpack src_install pkg_postinst pkg_prerm" ;;
+       5|6) inherit eutils multilib ;;
+       7) ;;
        *) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-inherit eutils multilib
+OEXT_EXPORTED_FUNCTIONS="src_unpack src_install pkg_postinst pkg_prerm"
 
 # @ECLASS-VARIABLE: OFFICE_REQ_USE
 # @DESCRIPTION:
@@ -72,14 +73,23 @@ RDEPEND=""
 
 for i in ${OFFICE_IMPLEMENTATIONS[@]}; do
        IUSE+=" office_implementation_${i}"
-       RDEPEND+="
-               office_implementation_${i}? (
-                       || (
-                               app-office/${i}${OFFICE_REQ_USE}
-                               app-office/${i}-bin${OFFICE_REQ_USE}
+       if [[ ${i} == "openoffice" ]]; then
+               # special only binary
+               RDEPEND+="
+                       office_implementation_openoffice? (
+                               app-office/openoffice-bin${OFFICE_REQ_USE}
                        )
-               )
-       "
+               "
+       else
+               RDEPEND+="
+                       office_implementation_${i}? (
+                               || (
+                                       app-office/${i}${OFFICE_REQ_USE}
+                                       app-office/${i}-bin${OFFICE_REQ_USE}
+                               )
+                       )
+               "
+       fi
 done
 
 REQUIRED_USE="|| ( "
@@ -174,7 +184,7 @@ office-ext-r1_add_extension() {
                "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
        eend $?
        ${UNOPKG_BINARY} list --shared > /dev/null
-       rm -rf "${tmpdir}"
+       rm -r "${tmpdir}" || dir "failed to clean up"
 }
 
 # @FUNCTION: office-ext-r1_remove_extension
@@ -193,7 +203,7 @@ office-ext-r1_remove_extension() {
                "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
        eend $?
        ${UNOPKG_BINARY} list --shared > /dev/null
-       rm -rf "${tmpdir}"
+       rm -r "${tmpdir}" || dir "failed to clean up"
 }
 
 # @FUNCTION: office-ext-r1_pkg_postinst