/[gentoo-x86]/eclass/gkrellm-plugin.eclass
Gentoo

Contents of /eclass/gkrellm-plugin.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Mar 9 15:35:02 2007 UTC (11 years, 9 months ago) by lack
Branch: MAIN
New eclass to provide common functions for gkrellm plugin ebuilds

1 lack 1.1 # Copyright 1999-2007 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: $
4    
5     #
6     # Original Author: Jim Ramsay <lack@gentoo.org>
7     #
8     # Purpose:
9     # Provides common methods used by (almost) all gkrellm plugins:
10     # - Sets up default dependencies
11     # - Adds pkg_setup check to ensure gkrellm was built with USE="X" (bug
12     # 167227)
13     # - Provides 'gkrellm-plugin_dir' function in lieu of hard-coding the plugins
14     # directory (which *may* change in the future)
15     # - Provides the most common src_install method to avoid code duplication.
16     #
17     # Utility Routines:
18     # gkrellm-plugin_dir - Returns the gkrellm-2 plugin directory
19     #
20     # Environment:
21     # For pkg_setup:
22     # PLUGIN_NO_XCHECK - If set, the default check ensuring that gkrellm2 is
23     # built with USE="X" is skipped, allowing plugins to build with the
24     # gkrellmd-only case. Defaults to unset.
25     # For src_install:
26     # PLUGIN_SO - The name of the plugin's .so file which will be installed in
27     # the plugin dir. Defaults to "${PN}.so".
28     # PLUGIN_DOCS - An optional list of docs to be installed. Defaults to
29     # unset.
30     #
31     # Changelog:
32     # 09 March 2007: Jim Ramsay <lack@gentoo.org>
33     # - Initial commit
34     #
35    
36     inherit multilib eutils
37    
38     RDEPEND="=app-admin/gkrellm-2*"
39     DEPEND="${RDEPEND}
40     dev-util/pkgconfig"
41    
42     gkrellm-plugin_dir() {
43     echo /usr/$(get_libdir)/gkrellm2/plugins
44     }
45    
46     gkrellm-plugin_pkg_setup() {
47     if [[ -z "${PLUGIN_NO_XCHECK}" ]] &&
48     ! built_with_use app-admin/gkrellm X; then
49     eerror "This plugin requires the X frontend of gkrellm."
50     eerror "Please re-emerge app-admin/gkrellm with USE=\"X\""
51     die "Please re-emerge app-admin/gkrellm with USE=\"X\""
52     fi
53     }
54    
55     gkrellm-plugin_src_install() {
56     insinto $(gkrellm-plugin_dir)
57     doins ${PLUGIN_SO:-${PN}.so} || die "Plugin shared library was not installed"
58    
59     DDOCS="README* Change* AUTHORS FAQ TODO INSTALL"
60    
61     for doc in ${DDOCS}; do
62     [ -s "$doc" ] && dodoc $doc
63     done
64    
65     [ -n "${PLUGIN_DOCS}" ] && dodoc ${PLUGIN_DOCS}
66     }
67    
68     EXPORT_FUNCTIONS pkg_setup src_install

  ViewVC Help
Powered by ViewVC 1.1.20