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

Diff of /eclass/gkrellm-plugin.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20