1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: gkrellm-plugin.eclass
6 # maintainer-needed@gentoo.org
8 # Original author: Jim Ramsay
9 # EAPI 6 author: David Seifert
10 # @BLURB: Provides src_install used by (almost) all gkrellm plugins
12 # - Sets up default dependencies
13 # - Provides a common src_install method to avoid code duplication
16 # 03 January 2018: David Seifert <soap@gentoo.org>
17 # - Port to EAPI 6, remove built_with_use, simplify a lot
18 # 12 March 2007: Jim Ramsay <lack@gentoo.org>
19 # - Added server plugin support
20 # 09 March 2007: Jim Ramsay <lack@gentoo.org>
24 # @ECLASS-VARIABLE: PLUGIN_SO
26 # The name of the plugin's .so file which will be installed in
27 # the plugin dir. Defaults to "${PN}$(get_modname)". Has to be a bash array.
29 # @ECLASS-VARIABLE: PLUGIN_SERVER_SO
31 # The name of the plugin's server plugin $(get_modname) portion.
32 # Unset by default. Has to be a bash array.
34 # @ECLASS-VARIABLE: PLUGIN_DOCS
36 # An optional list of docs to be installed, in addition to the default
37 # DOCS variable which is respected too. Has to be a bash array.
41 die "${ECLASS} is banned in EAPI ${EAPI:-0}"
46 die "Unknown EAPI ${EAPI:-0}"
52 EXPORT_FUNCTIONS src_install
54 if [[ ! ${_GKRELLM_PLUGIN_R1} ]]; then
56 DEPEND="virtual/pkgconfig"
58 # @FUNCTION: gkrellm-plugin_src_install
60 # Install the plugins and call einstalldocs
61 gkrellm-plugin_src_install() {
62 exeinto /usr/$(get_libdir)/gkrellm2/plugins
64 if ! declare -p PLUGIN_SO >/dev/null 2>&1 ; then
65 doexe ${PN}$(get_modname)
66 elif declare -p PLUGIN_SO | grep -q "^declare -a " ; then
67 doexe "${PLUGIN_SO[@]}"
69 die "PLUGIN_SO has to be a bash array!"
73 if [[ -n ${PLUGIN_SERVER_SO} ]]; then
74 exeinto /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd
76 if declare -p PLUGIN_SERVER_SO | grep -q "^declare -a " ; then
77 doexe "${PLUGIN_SERVER_SO[@]}"
79 die "PLUGIN_SERVER_SO has to be a bash array!"
85 for d in Changelog* ChangeLog*; do
86 [[ -s "${d}" ]] && dodoc "${d}"
89 if [[ -n ${PLUGIN_DOCS} ]]; then
90 if declare -p PLUGIN_DOCS | grep -q "^declare -a " ; then
91 dodoc "${PLUGIN_DOCS[@]}"
93 die "PLUGIN_DOCS has to be a bash array!"