Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-09 Thread Mike Kelly
On Thu, 8 Mar 2007 12:34:59 -0600
Jim Ramsay [EMAIL PROTECTED] wrote:

 Petteri Räty wrote:
  Jim Ramsay wrote:
   ECLASS=gkrellm-plugin
   INHERITED=$INHERITED $ECLASS
  
  No need to set INHERITED yourself any more either. Ciaran already
  pointed out ECLASS.
 
 Indeed, thanks for that!
 
 They just appeared automagically when I did 'vim foo.eclass'  I
 wonder where that comes from...

That comes from the app-vim/gentoo-syntax package, in the
plugin/newebuild.vim file. I'll have that fixed in the next release of
gentoo-syntax.

-- 
Mike Kelly
--
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Ciaran McCreesh
On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay [EMAIL PROTECTED] wrote:
 I have attached my first draft of the eclass.  As you can see, there
 are 3 main important benefits to using this eclass:

You shouldn't dodoc COPYING.

You don't need to set ECLASS manually any more.

-- 
Ciaran McCreesh
Mail: ciaranm at ciaranm.org
Web : http://ciaranm.org/
Paludis, the secure package manager : http://paludis.pioto.org/



signature.asc
Description: PGP signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Petteri Räty
Jim Ramsay wrote:
 ECLASS=gkrellm-plugin
 INHERITED=$INHERITED $ECLASS

No need to set INHERITED yourself any more either. Ciaran already
pointed out ECLASS.

 
 gkrellm-plugin_pkg_setup() {
   if ! built_with_use app-admin/gkrellm X  \
   ! has X ${IUSE}; then
   eerror This plugin requires the X frontend of gkrellm.
   eerror Please re-emerge app-admin/gkrellm with USE=\X\
   die Please re-emerge app-admin/gkrellm with USE=\X\
   fi
 }

How useful is the X use flag in gkrellm? Just thinking if it would be
better to just remove the use flag and always build that code.

Regards,
Petteri



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Ioannis Aslanidis

On 3/8/07, Ciaran McCreesh [EMAIL PROTECTED] wrote:

On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay [EMAIL PROTECTED] wrote:
 I have attached my first draft of the eclass.  As you can see, there
 are 3 main important benefits to using this eclass:

You shouldn't dodoc COPYING.


How is it that it should not be done? Is it because the file is
usually a symlink? Or because there is simply no need to do it?


You don't need to set ECLASS manually any more.

Who takes care of ECLASS now?

--
Ioannis Aslanidis

deathwing00[at]gentoo.org 0xB9B11F4E
--
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Petteri Räty
Ioannis Aslanidis wrote:
 On 3/8/07, Ciaran McCreesh [EMAIL PROTECTED] wrote:
 On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay [EMAIL PROTECTED] wrote:
  I have attached my first draft of the eclass.  As you can see, there
  are 3 main important benefits to using this eclass:

 You shouldn't dodoc COPYING.
 
 How is it that it should not be done? Is it because the file is
 usually a symlink? Or because there is simply no need to do it?
 

Because it's a copy of files in /usr/portage/licenses most likely.

 You don't need to set ECLASS manually any more.
 Who takes care of ECLASS now?
 

The package manager.

Regards,
Petteri



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Stephen Bennett
On Thu, 8 Mar 2007 19:04:20 +0100
Ioannis Aslanidis [EMAIL PROTECTED] wrote:

 How is it that it should not be done? Is it because the file is
 usually a symlink? Or because there is simply no need to do it?

Because it's the package's licence. Guess where we already store
licence information.

 Who takes care of ECLASS now?

The package manager. Who else?
-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Ciaran McCreesh
On Thu, 8 Mar 2007 19:04:20 +0100 Ioannis Aslanidis
[EMAIL PROTECTED] wrote:
 On 3/8/07, Ciaran McCreesh [EMAIL PROTECTED] wrote:
  On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay [EMAIL PROTECTED]
  wrote:
   I have attached my first draft of the eclass.  As you can see,
   there are 3 main important benefits to using this eclass:
 
  You shouldn't dodoc COPYING.
 
 How is it that it should not be done? Is it because the file is
 usually a symlink? Or because there is simply no need to do it?

It's generally agreed that installing licence files should only be done
if legally required. Otherwise, we already have a copy in the tree.

  You don't need to set ECLASS manually any more.

 Who takes care of ECLASS now?

Your package manager of choice. Same for INHERITED btw.

-- 
Ciaran McCreesh
Mail: ciaranm at ciaranm.org
Web : http://ciaranm.org/
Paludis, the secure package manager : http://paludis.pioto.org/



signature.asc
Description: PGP signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Ioannis Aslanidis

  You shouldn't dodoc COPYING.

 How is it that it should not be done? Is it because the file is
 usually a symlink? Or because there is simply no need to do it?

It's generally agreed that installing licence files should only be done
if legally required. Otherwise, we already have a copy in the tree.


That makes full sense.



  You don't need to set ECLASS manually any more.

 Who takes care of ECLASS now?

Your package manager of choice. Same for INHERITED btw.



Thanks for the reply.

--
Ioannis Aslanidis

deathwing00[at]gentoo.org 0xB9B11F4E
--
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Seemant Kulleen
On Thu, 2007-03-08 at 20:02 +0200, Petteri Räty wrote:

 How useful is the X use flag in gkrellm? Just thinking if it would be
 better to just remove the use flag and always build that code.
 
 Regards,
 Petteri
 

Back in the day, when gkrellm2 first came out, they had this option of
building only the gkrellm daemon, which is handy, because you can throw
it onto some headless server and connect your client to that daemon to
monitor it from your desktop.  I vote to keep X USE flag :)

Thanks,


Seemant


-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Jim Ramsay
Ciaran McCreesh wrote:
 On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay [EMAIL PROTECTED] wrote:
  I have attached my first draft of the eclass.  As you can see, there
  are 3 main important benefits to using this eclass:
 
 You shouldn't dodoc COPYING.
 
 You don't need to set ECLASS manually any more.

Good points, and thanks :)

-- 
Jim Ramsay
Gentoo/Linux Developer (rox,gkrellm)


signature.asc
Description: PGP signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Andrej Kacian
On Thu, 08 Mar 2007 20:02:50 +0200
Petteri Räty [EMAIL PROTECTED] wrote:

 How useful is the X use flag in gkrellm? Just thinking if it would be
 better to just remove the use flag and always build that code.

There is a possibility for headless servers to run gkrellmd, which runs in
background, and connect to it from elsewhere with a gkrellm frontend.

-- 
Andrej Ticho Kacian ticho at gentoo dot org
Gentoo Linux Developer - net-mail, antivirus, sound, x86


signature.asc
Description: PGP signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Jim Ramsay
Petteri Räty wrote:
 Jim Ramsay wrote:
  ECLASS=gkrellm-plugin
  INHERITED=$INHERITED $ECLASS
 
 No need to set INHERITED yourself any more either. Ciaran already
 pointed out ECLASS.

Indeed, thanks for that!

They just appeared automagically when I did 'vim foo.eclass'  I wonder where 
that comes from...

  
  gkrellm-plugin_pkg_setup() {
  if ! built_with_use app-admin/gkrellm X  \
  ! has X ${IUSE}; then
  eerror This plugin requires the X frontend of
  gkrellm. eerror Please re-emerge app-admin/gkrellm with USE=\X\
  die Please re-emerge app-admin/gkrellm with
  USE=\X\ fi
  }
 
 How useful is the X use flag in gkrellm? Just thinking if it would be
 better to just remove the use flag and always build that code.

Well, gkrellm consists of two optional parts:

- gkrellmd which is a monitoring daemon, which does not require X
support at all.  It is meant for headless machines you would want to
monitor remotely.

- gkrellm2 which is the front-end which can monitor the local machine
and/or any machine running gkrellmd.

USE=X builds both parts.
USE=-X builds only the monitoring daemon.

I believe this is a useful distinction.

The plugins are only relevant when you have the GUI front-end in place,
except that there may be some plugins that have a gkrellmd-equivalent
part, in which case that ebuild should set IUSE=X and do its own
checking.

I suppose the alternative would be to split the ebuild into 'gkrellm'
and 'gkrellmd' ebuilds, which would indeed remove the need for the
'built_with_use' check.  How is this normally done for other packages
that have, for example, both a client and server part?

-- 
Jim Ramsay
Gentoo/Linux Developer (rox,gkrellm)


signature.asc
Description: PGP signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Marien Zwart
On Thu, Mar 08, 2007 at 11:19:20AM -0600, Jim Ramsay wrote:
 gkrellm-plugin_pkg_setup() {
   if ! built_with_use app-admin/gkrellm X  \
   ! has X ${IUSE}; then
   eerror This plugin requires the X frontend of gkrellm.
   eerror Please re-emerge app-admin/gkrellm with USE=\X\
   die Please re-emerge app-admin/gkrellm with USE=\X\
   fi
 }

Any chance of plugins existing (or appearing in the future) that work
with a USE=-X gkrellm and a USE=X gkrellm the same way? In that case
that check will not do the right thing. Perhaps add a var the plugin
ebuild can set to indicate it does not need gkrellm built with X even
though the plugin has no X USE flag?

This will also error out if you try to build a plugin that has the X
USE flag with both the plugin and gkrellm itself built with -X, you
probably meant to check for use X too?

-- 
Marien.


pgpunqAqv1Kld.pgp
Description: PGP signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Jim Ramsay
Marien Zwart wrote:
 On Thu, Mar 08, 2007 at 11:19:20AM -0600, Jim Ramsay wrote:
  gkrellm-plugin_pkg_setup() {
  if ! built_with_use app-admin/gkrellm X  \
  ! has X ${IUSE}; then
  eerror This plugin requires the X frontend of
  gkrellm. eerror Please re-emerge app-admin/gkrellm with USE=\X\
  die Please re-emerge app-admin/gkrellm with
  USE=\X\ fi
  }
 
 Any chance of plugins existing (or appearing in the future) that work
 with a USE=-X gkrellm and a USE=X gkrellm the same way? In that case
 that check will not do the right thing. Perhaps add a var the plugin
 ebuild can set to indicate it does not need gkrellm built with X even
 though the plugin has no X USE flag?
 
 This will also error out if you try to build a plugin that has the X
 USE flag with both the plugin and gkrellm itself built with -X, you
 probably meant to check for use X too?

Well, my intention was that such a plugin would do its own
built_with_use checking, but I see your point, and I think that having a
Don't check for X variable the ebuild can optionally set would be a
better approach than mine - That way such an ebuild could do its own
magic based on 'built_with_use gkrellm X' without having to have
IUSE=X.

Thanks!

-- 
Jim Ramsay
Gentoo/Linux Developer (rox,gkrellm)


signature.asc
Description: PGP signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Jim Ramsay
Attached is version 2 of my draft eclass.  I have incorporated the
excellent changes suggested here, and it seems to be working great on
my local overlay.

-- 
Jim Ramsay
Gentoo/Linux Developer (rox,gkrellm)
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

#
# Original Author: Jim Ramsay [EMAIL PROTECTED]
#
# Purpose:
#   Provides common methods used by (almost) all gkrellm plugins:
#- Sets up default dependencies
#- Adds pkg_setup check to ensure gkrellm was built with USE=X (bug
#167227)
#- Provides 'gkrellm-plugin_dir' function in lieu of hard-coding the plugins
#directory (which *may* change in the future)
#- Provides the most common src_install method to avoid code duplication.
#
# Utility Routines:
#   gkrellm-plugin_dir - Returns the gkrellm-2 plugin directory
#
# Environment:
#   For pkg_setup:
# PLUGIN_NO_XCHECK - If set, the default check ensuring that gkrellm2 is
#   built with USE=X is skipped, allowing plugins to build with the
#   gkrellmd-only case.  Defaults to unset.
#   For src_install:
# PLUGIN_SO - The name of the plugin's .so file which will be installed in
#   the plugin dir.  Defaults to ${PN}.so.
# PLUGIN_DOCS - An optional list of docs to be installed.  Defaults to
# unset.
#

inherit multilib eutils

RDEPEND==app-admin/gkrellm-2*
DEPEND=${RDEPEND}
dev-util/pkgconfig

gkrellm-plugin_dir() {
echo /usr/$(get_libdir)/gkrellm2/plugins
}

gkrellm-plugin_pkg_setup() {
if [[ -z ${PLUGIN_NO_XCHECK} ]]  
! built_with_use app-admin/gkrellm X; then
eerror This plugin requires the X frontend of gkrellm.
eerror Please re-emerge app-admin/gkrellm with USE=\X\
die Please re-emerge app-admin/gkrellm with USE=\X\
fi
}

gkrellm-plugin_src_install() {
insinto $(gkrellm-plugin_dir)
doins ${PLUGIN_SO:-${PN}.so} || die Plugin shared library was not 
installed

DDOCS=README* Change* AUTHORS FAQ TODO INSTALL

for doc in ${DDOCS}; do
[ -s $doc ]  dodoc $doc
done

[ -n ${PLUGIN_DOCS} ]  dodoc ${PLUGIN_DOCS}
}

EXPORT_FUNCTIONS pkg_setup src_install


signature.asc
Description: PGP signature


Re: [gentoo-dev] New eclass: gkrellm-plugin

2007-03-08 Thread Marien Zwart
On Thu, Mar 08, 2007 at 03:51:42PM -0600, Jim Ramsay wrote:
 gkrellm-plugin_pkg_setup() {
   if [[ -z ${PLUGIN_NO_XCHECK} ]]  
   ! built_with_use app-admin/gkrellm X; then
   eerror This plugin requires the X frontend of gkrellm.
   eerror Please re-emerge app-admin/gkrellm with USE=\X\
   die Please re-emerge app-admin/gkrellm with USE=\X\
   fi
 }

This is basically horrible nitpicking, but perhaps point at
package.use here to prevent people from doing USE=X emerge gkrellm on
the commandline (prevents accidentally remerging gkrellm with -X and
breaking stuff later and all that)?

(http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2chap=2
does not quite mention this specifically, and is a bit long to link to
anyway, or I'd say link to that in the message)

-- 
Marien.


pgpqOICfh19Cf.pgp
Description: PGP signature