Mailing List Archive

New eclass: gkrellm-plugin
I'm tired of maintaining essentially the same code in 20-odd ebuilds,
so I am wanting to condense the common bits into a single eclass.

Most of you probably don't care, but it may be of interest to those few
who maintain gkrellm plugin ebuilds.

I have attached my first draft of the eclass. As you can see, there
are 3 main important benefits to using this eclass:

1 - Sets up the basic dependencies shared by all gkrellm plugins

2 - New pkg_setup check to ensure gkrellm was built with USE="X" (see
bug 167227 for more info on why this is necessary for 99.9% of plugins)

3 - The plugin install location is now centralized, and available via
the gkrellm-plugin_dir function, instead of each ebuild hard-coding
'/usr/$(get_libdir)/gkrellm2/plugins'

As an added benefit, the most common variant of src_install was
centralized here too.

If there are no major objections, I will add this eclass shortly, at
which point anyone is free (and encouraged!) to use it for their gkrellm
plugin ebuilds. I will begin converting all my ebuilds shortly
thereafter.

--
Jim Ramsay
Gentoo/Linux Developer (rox,gkrellm)
Re: New eclass: gkrellm-plugin [ In reply to ]
On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay <lack@gentoo.org> 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/
Re: New eclass: gkrellm-plugin [ In reply to ]
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
Re: New eclass: gkrellm-plugin [ In reply to ]
On 3/8/07, Ciaran McCreesh <ciaranm@ciaranm.org> wrote:
> On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay <lack@gentoo.org> 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: New eclass: gkrellm-plugin [ In reply to ]
Ioannis Aslanidis wrote:
> On 3/8/07, Ciaran McCreesh <ciaranm@ciaranm.org> wrote:
>> On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay <lack@gentoo.org> 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
Re: New eclass: gkrellm-plugin [ In reply to ]
On Thu, 8 Mar 2007 19:04:20 +0100 "Ioannis Aslanidis"
<aslanidis@gmail.com> wrote:
> On 3/8/07, Ciaran McCreesh <ciaranm@ciaranm.org> wrote:
> > On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay <lack@gentoo.org>
> > 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/
Re: New eclass: gkrellm-plugin [ In reply to ]
> > > 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: New eclass: gkrellm-plugin [ In reply to ]
On Thu, 8 Mar 2007 19:04:20 +0100
"Ioannis Aslanidis" <aslanidis@gmail.com> 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: New eclass: gkrellm-plugin [ In reply to ]
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: New eclass: gkrellm-plugin [ In reply to ]
Ciaran McCreesh wrote:
> On Thu, 8 Mar 2007 11:19:20 -0600 Jim Ramsay <lack@gentoo.org> 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)
Re: New eclass: gkrellm-plugin [ In reply to ]
On Thu, 08 Mar 2007 20:02:50 +0200
Petteri Räty <betelgeuse@gentoo.org> 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
Re: New eclass: gkrellm-plugin [ In reply to ]
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)
Re: New eclass: gkrellm-plugin [ In reply to ]
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.
Re: New eclass: gkrellm-plugin [ In reply to ]
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)
Re: New eclass: gkrellm-plugin [ In reply to ]
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)
Re: New eclass: gkrellm-plugin [ In reply to ]
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=2&chap=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.
Re: New eclass: gkrellm-plugin [ In reply to ]
Marien Zwart wrote:
> 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)?

I don't know about that... I don't go as far as saying 'USE="X" emerge
gkrellm', so I would assume most users now know this to mean either
"Enable USE="X" in your make.conf or package.use"... And it's so much
more compact this way :)

Anyhow, since most if not all platforms all include "X" in USE
by default, this should only be seen by people who have already
explicitly disabled it either globally or just for gkrellm, so they
*should* know what to do about it.

But thanks for your excellent suggestions!

--
Jim Ramsay
Gentoo/Linux Developer (rox,gkrellm)
Re: New eclass: gkrellm-plugin [ In reply to ]
On Thu, 8 Mar 2007 12:34:59 -0600
Jim Ramsay <lack@gentoo.org> 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: New eclass: gkrellm-plugin [ In reply to ]
Mike Kelly wrote:
> 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.
>
Speaking of vim masterdriverz pointed out this python indenter:
http://www.vim.org/scripts/script.php?script_id=974
dunno if that can be included in something; one of the things i love about
gentoo is the way everything is set up well by default.


--
gentoo-dev@gentoo.org mailing list