Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Question about creating an ebuild....
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Ateo
Advocate
Advocate


Joined: 02 Jun 2003
Posts: 2021
Location: Republic of California

PostPosted: Tue Jul 20, 2004 9:19 pm    Post subject: Question about creating an ebuild.... Reply with quote

I wanted to take this opportunity to learn how to write an ebuild to install the latest package of superkaramba (0.34-1) since portage hasn't caught up yet. I'm a little bit confused as to why I run into errors.

According to the Gentoo Ebuild/Developer HOWTO....
Quote:
The second section is the version of the package, which should normally be same as the version on the main source tarball.

I follow that rule (the source tarball having the file name superkaramba-0.34-1.tar.gz) and here is the output of digesting the ebuild:
Code:
epitaph superkaramba # ebuild superkaramba-0.34-1.ebuild digest
!!! Name error in superkaramba-0.34-1: multiple version parts.
!!! Error: PF is null 'superkaramba-0.34-1'; exiting.
epitaph superkaramba #
The file is in portage overlay and the corresponding line in make.conf is not commented out. I am not able to set the variable P as it is a "read" variable and cannot be set. I assume the variable P is the package name (pretty obvious unless I am wrong). It appears there are no other variables that I can set for instructions on the correct tarball to download and install.

Later on in the HOWTO, it states:
Quote:
The fourth (optional) section of the package name is the Gentoo Linux-specific revision number, which is specified by -r#, where # is an integer...

I'm not really sure if I should follow this rule instead. However I gave it a go and the ebuild does digest but when I attempt to emerge the package, it wants to use the buggy version of superkaramba, 0.34.tar.gz, instead of 0.34-1.tar.gz, which addresses and fixes a memory sensor issue.

I'm pretty sure I need to stick to the first ebuild, 0.34-1, since that is the source package name but I'm not sure.

So, I guess I'm trying to figure out which rule to follow. If it's the first rule, why am I getting the error when I digest it? If it's the 2nd rule, and name the ebuild 0.34-r1, how do i instruct the ebuild to download and install 0.34-1? The HOWTO does not explain this. If it does, then I completely missed it.

BTW, is there a better ebuild howto? If so, can someone link me.

Thanks
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Tue Jul 20, 2004 9:37 pm    Post subject: Reply with quote

Change the ebuild name to "superkaramba-0.34_1.ebuild" and add a shell variable definition
Code:
PV="0.34-1"

to the ebuild. The additional -r# is reserved for ebuild versioning IMO.
Back to top
View user's profile Send private message
Ateo
Advocate
Advocate


Joined: 02 Jun 2003
Posts: 2021
Location: Republic of California

PostPosted: Tue Jul 20, 2004 9:44 pm    Post subject: Reply with quote

Ok. Tried it. Still didn't digest
Code:
epitaph superkaramba # ebuild superkaramba-0.34_1.ebuild digest
!!! Name error in 0.34_1
!!! Error: PF is null 'superkaramba-0.34_1'; exiting.


Isn't PV a variable that cannot be set?

Here's the script
Code:
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-misc/superkaramba/superkaramba-0.34_1.ebuild,v 1.1 2004/07/18 15:14:15 carlo Exp $

inherit kde eutils

PV="0.34-1"

DESCRIPTION="A version of Karamba with extra extensions in-built"
HOMEPAGE="http://netdragon.sourceforge.net/"
SRC_URI="mirror://sourceforge/netdragon/${P}.tar.gz"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86 ~ppc ~sparc ~amd64"
IUSE="doc"

need-kde 3

src_install () {
        einstall
        dodir /usr/share/karamba/themes /usr/share/karamba/bin
        keepdir /usr/share/karamba/themes /usr/share/karamba/bin
        dodir /etc/env.d
        cp ${FILESDIR}/karamba-env ${D}/etc/env.d/99karamba
        if use doc; then
                dodir /usr/share/doc/${P}/examples
                mv ${D}/usr/share/doc/* ${D}/usr/share/doc/${P}
                cp ${S}/examples/* ${D}/usr/share/doc/${P}/examples
        else
                rm -Rf ${D}/usr/share/doc
        fi
}

It's just a copy of 0.34.ebuild.
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Tue Jul 20, 2004 9:52 pm    Post subject: Reply with quote

Blast. OK, try this: Change
Code:
SRC_URI="mirror://sourceforge/netdragon/${P}.tar.gz"

to
Code:
SRC_URI="mirror://sourceforge/netdragon/superkaramba-${PV}.tar.gz"
Back to top
View user's profile Send private message
Ateo
Advocate
Advocate


Joined: 02 Jun 2003
Posts: 2021
Location: Republic of California

PostPosted: Tue Jul 20, 2004 10:09 pm    Post subject: Reply with quote

If I name the file superkaramba-0.34_1.ebuild, it fails:
Code:
epitaph superkaramba # ebuild superkaramba-0.34_1.ebuild digest
!!! Name error in 0.34_1
!!! Error: PF is null 'superkaramba-0.34_1'; exiting.


If I name the file superkaramba-0.34-r1.ebuild, it is successful (setting the PV variable as you suggest):
Code:
epitaph superkaramba # ebuild superkaramba-0.34-r1.ebuild digest
>>> Generating digest file...
<<< superkaramba-0.34-1.tar.gz
>>> Generating manifest file...
<<< superkaramba-0.34-r1.ebuild
<<< files/digest-superkaramba-0.34-r1
>>> Computed message digests.


Is this acceptable by Gentoo ebuild standards? I believe so
Quote:
The fourth (optional) section of the package name is the Gentoo Linux-specific revision number, which is specified by -r#, where # is an integer, e.g. package-4.5.3-r3. This revision number is independent of the version of the source tarball and is used to inform people that a new and improved Gentoo Linux rev of a particular package is available.


This version of superkaramba is "new and improved" because it addresses a bug. What do you think?
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Tue Jul 20, 2004 10:19 pm    Post subject: Reply with quote

I don't think it is gentoo compliant, but then again, for your overlay it's ok if it works... :wink:
If you aim for compliance, you could still try 0.34.1 as ebuild version.
Back to top
View user's profile Send private message
Ateo
Advocate
Advocate


Joined: 02 Jun 2003
Posts: 2021
Location: Republic of California

PostPosted: Wed Jul 21, 2004 1:43 am    Post subject: Reply with quote

Thanks for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum