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
11 # @BLURB: Provides src_install used by (almost) all gkrellm plugins
13 # - Sets up default dependencies
14 # - Provides a common src_install method to avoid code duplication
17 # 03 January 2018: David Seifert <soap@gentoo.org>
18 # - Port to EAPI 6, remove built_with_use, simplify a lot
19 # 12 March 2007: Jim Ramsay <lack@gentoo.org>
20 # - Added server plugin support
21 # 09 March 2007: Jim Ramsay <lack@gentoo.org>
25 # @ECLASS-VARIABLE: PLUGIN_SO
27 # The name of the plugin's .so file which will be installed in
28 # the plugin dir. Defaults to "${PN}$(get_modname)". Has to be a bash array.
30 # @ECLASS-VARIABLE: PLUGIN_SERVER_SO
32 # The name of the plugin's server plugin $(get_modname) portion.
33 # Unset by default. Has to be a bash array.
35 # @ECLASS-VARIABLE: PLUGIN_DOCS
37 # An optional list of docs to be installed, in addition to the default
38 # DOCS variable which is respected too. Has to be a bash array.
42 die "${ECLASS} is banned in EAPI ${EAPI:-0}"
47 die "Unknown EAPI ${EAPI:-0}"
53 EXPORT_FUNCTIONS src_install
55 if [[ ! ${_GKRELLM_PLUGIN_R1} ]]; then
57 DEPEND="virtual/pkgconfig"
59 # @FUNCTION: gkrellm-plugin_src_install
61 # Install the plugins and call einstalldocs
62 gkrellm-plugin_src_install() {
63 exeinto /usr/$(get_libdir)/gkrellm2/plugins
65 if ! declare -p PLUGIN_SO >/dev/null 2>&1 ; then
66 doexe ${PN}$(get_modname)
67 elif declare -p PLUGIN_SO | grep -q "^declare -a " ; then
68 doexe "${PLUGIN_SO[@]}"
70 die "PLUGIN_SO has to be a bash array!"
74 if [[ -n ${PLUGIN_SERVER_SO} ]]; then
75 exeinto /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd
77 if declare -p PLUGIN_SERVER_SO | grep -q "^declare -a " ; then
78 doexe "${PLUGIN_SERVER_SO[@]}"
80 die "PLUGIN_SERVER_SO has to be a bash array!"
86 for d in Changelog* ChangeLog*; do
87 [[ -s "${d}" ]] && dodoc "${d}"
90 if [[ -n ${PLUGIN_DOCS} ]]; then
91 if declare -p PLUGIN_DOCS | grep -q "^declare -a " ; then
92 dodoc "${PLUGIN_DOCS[@]}"
94 die "PLUGIN_DOCS has to be a bash array!"