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

Contents of /eclass/gkrellm-plugin.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Apr 23 19:35:05 2007 UTC (11 years, 2 months ago) by swegener
Branch: MAIN
Changes since 1.2: +2 -2 lines
Apply whitespace checks from repoman to eclasses.

1 lack 1.1 # Copyright 1999-2007 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 swegener 1.3 # $Header: /var/cvsroot/gentoo-x86/eclass/gkrellm-plugin.eclass,v 1.2 2007/03/12 17:39:01 lack Exp $
4 lack 1.1
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 lack 1.2 # 167227)
13     # - Provides utility routines in lieu of hard-coding the plugin directories.
14 lack 1.1 # - Provides the most common src_install method to avoid code duplication.
15     #
16     # Utility Routines:
17     # gkrellm-plugin_dir - Returns the gkrellm-2 plugin directory
18 lack 1.2 # gkrellm-plugin_server_dir - Returns the gkrellm-2 server plugin directory
19 lack 1.1 #
20     # Environment:
21     # For src_install:
22     # PLUGIN_SO - The name of the plugin's .so file which will be installed in
23     # the plugin dir. Defaults to "${PN}.so".
24     # PLUGIN_DOCS - An optional list of docs to be installed. Defaults to
25     # unset.
26 lack 1.2 # PLUGIN_SERVER_SO - The name of the plugin's server plugin .so portion.
27     # Defaults to unset.
28     # Important: This will also cause the pkg_setup check to be skipped, so
29     # you need to check 'build_with_use app-admin/gkrellm X' in your
30     # src_compile and only compile the GUI portion if that returns true. (see
31     # x11-plugins/gkrelltop as an example)
32 lack 1.1 #
33     # Changelog:
34 lack 1.2 # 12 March 2007: Jim Ramsay <lack@gentoo.org>
35     # - Added server plugin support
36 lack 1.1 # 09 March 2007: Jim Ramsay <lack@gentoo.org>
37     # - Initial commit
38     #
39    
40     inherit multilib eutils
41    
42     RDEPEND="=app-admin/gkrellm-2*"
43     DEPEND="${RDEPEND}
44     dev-util/pkgconfig"
45    
46     gkrellm-plugin_dir() {
47     echo /usr/$(get_libdir)/gkrellm2/plugins
48     }
49    
50 lack 1.2 gkrellm-plugin_server_dir() {
51     echo /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd
52     }
53    
54 lack 1.1 gkrellm-plugin_pkg_setup() {
55 swegener 1.3 if [[ -z "${PLUGIN_SERVER_SO}" ]] &&
56 lack 1.1 ! built_with_use app-admin/gkrellm X; then
57     eerror "This plugin requires the X frontend of gkrellm."
58     eerror "Please re-emerge app-admin/gkrellm with USE=\"X\""
59     die "Please re-emerge app-admin/gkrellm with USE=\"X\""
60     fi
61     }
62    
63     gkrellm-plugin_src_install() {
64 lack 1.2 if built_with_use app-admin/gkrellm X; then
65     insinto $(gkrellm-plugin_dir)
66     doins ${PLUGIN_SO:-${PN}.so} || die "Plugin shared library was not installed"
67     fi
68    
69     if [[ -n "${PLUGIN_SERVER_SO}" ]]; then
70     insinto $(gkrellm-plugin_server_dir)
71     doins ${PLUGIN_SERVER_SO} || die "Server plugin shared library was not installed"
72     fi
73 lack 1.1
74     DDOCS="README* Change* AUTHORS FAQ TODO INSTALL"
75    
76     for doc in ${DDOCS}; do
77     [ -s "$doc" ] && dodoc $doc
78     done
79    
80     [ -n "${PLUGIN_DOCS}" ] && dodoc ${PLUGIN_DOCS}
81     }
82    
83     EXPORT_FUNCTIONS pkg_setup src_install

  ViewVC Help
Powered by ViewVC 1.1.20