Jump to content

Trying to write an ebuild


Recommended Posts

That would be the easiest solution really. Read one from /usr/portage/whatever and create you own. Replace the source download by the clanbomber website and replace the dependencies by those needed by the prog .. and so on. Now uncommant PORTDIR_OVERLAY=/usr/local/portage in /etc/make.conf and put your new clanbomber.whateverversion.ebuild in (let's say) /usr/local/portage/app-game/clanbomber/. Now cd to that directory and type 'digest clanbomber.whateverversion.ebuild'. That should create a new file in /usr/local/portage/app-game/clanbomber/files. You can now as root 'emerge clanbomber' .. 

 

But the best solution is really to build your own ebuild. I can help you if you want...

 

OK - actually started trying to write an ebuild for clanbomber, but I've got a bit lost - so here is me taking Motts (and anyone else) up on that offer of help. First up - I'm not sure what to put for the download. The source is available from sourceforge - but I can't get a straight URL.

 

This is just the beginning of my confusion, but hopefully by the time someone has helped me get this sorted I may have solved a few other things.

 

Also, any general tips would be handy :D

Link to comment
Share on other sites

  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

I don't know the answer to your question, but this may be helpful in making ebuilds:

http://www.gentoo.org/doc/en/gentoo-howto.xml

 

look at the bottom for some troubleshooting tools.

 

also, there was a post over in the gentoo forums with what I believe was the exact same problem, however it's from Feb 6 and was never answered...hope you have better luck.

Link to comment
Share on other sites

Here is what you should do..

 

1. Make sure you have the line PORTDIR_OVERLAY=/usr/local/portage in /etc/make.conf

2. Create the directory /usr/local/portage/GROUP/PACKAGE-NAME

3. Put your ebuild in this directory (the filename should be PACKAGENAME-VERSION.ebuild)

4. You should have a file /usr/local/portage/GROUP/PACKAGE-NAME/PACKAGENAME-VERSION.ebuild now.

5. Do an 'emerge PACKAGENAME'

6. cd in the directory of the ebuild and do an 'ebuild PACKAGENAME-VERSION.ebuild digest'

7. do 'emerge PACKAGENAME' again

8. finish

 

I'm not too sure about the last 2-3 steps but you have to do the digest command to add the ebuild to your database. If those steps are over and it still does not work, this is an ebuild problem. Post it here..

 

MOttS

Link to comment
Share on other sites

OK - any steps that required emerge clanbomber failed

 

All the other steps worked.

 

Here is my ebuild. Please bear i nmind that this is very much a trial and error thing for me - I don't really know what I'm doing so the following may be ridiculous :oops:

 

S=${WORKDIR}/${P}

DESCRIPTION="Bomberman clone - fantastic game!"

SRC_URI="http://heanet.dl.sourceforge.net/sourceforge/clanbomber/clanbomber-1.02a.tar.gz"

HOMEPAGE="http://clanbomber.sourceforge.net"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86"

IUSE=""



DEPEND="sys-libs/zlib

app-games/clanlib

media-libs/hermes"



src_unpack() {

unpack clanbomber-1.02a.tar.gz

cd ${S}



}



src_compile() {



cd ${S}

make || die



}



src_install () {



make install || die



}

 

It's based on a ebuild file I found in my /usr/portage tree - I forget which app, perhaps bbrun.

 

Anything I didn't understand was either removed, left as it was or replaced with something experimental

Link to comment
Share on other sites

BTW lintool keeps telling me that my license is wrong - although I'm sure it's not

 

I remember reading that lintool is broken so I'm not paying all that much attention to it - but I thought it might be worth mentioning

 

Also when I try to emerge - I get the following response:

 

root@kirstine clanbomber # emerge clanbomber

Calculating dependencies   

!!! all ebuilds that could satisfy "clanbomber" have been masked.



!!! Error calculating dependencies. Please correct.

Link to comment
Share on other sites

try:

ACCEPT_KEYWORDS=~x86 emerge clanbomber

 

since clanbomber is not an official package it's considered masked. anytime you want to emerge a package that's masked, you can do this. you could also go into /etc/make.conf and change the line:

#ACCEPT_KEYWORDS=~x86

by removing the #.

 

my only worry is that it's not looking at your ebuild but an ebuild that is in portage and masked...no, just checked and i don't see one, so it must be picking up yours.

Link to comment
Share on other sites

OK the response to the above is:

 

Calculating dependencies ...done!

>>> emerge (1 of 1) app-games/clanbomber-1.2_alpha to /

>>> md5 src_uri;-) clanbomber-1.02a.tar.gz

>>> Unpacking source...

>>> Unpacking clanbomber-1.02a.tar.gz to /var/tmp/portage/clanbomber-1.2_alpha/work

/usr/sbin/ebuild.sh: line 20: cd: /var/tmp/portage/clanbomber-1.2_alpha/work/clanbomber-1.2_alpha: No such file or directory

>>> Source unpacked.

/usr/sbin/ebuild.sh: line 26: cd: /var/tmp/portage/clanbomber-1.2_alpha/work/clanbomber-1.2_alpha: No such file or directory

make: *** No targets specified and no makefile found.  Stop.



!!! ERROR: app-games/clanbomber-1.2_alpha failed.

!!! Function src_compile, Line 27, Exitcode 2

!!! (no error message)

 

The /var/tmp/portage/clanbomber-1.2_alpha/work/clanbomber-1.2_alpha does exist. I'm thinking that the no targets thing is the problem, but I'm not sure how to fix that

 

Edit: - I'm lying to you, the directory doesn't exist - it's clanbomber-1.2_a

 

Edit #2: I've changed the working directory to the above, so I no longer get the "no such file or directorry" but everything else is the same

Link to comment
Share on other sites

you need to run

./configure

in your ebuild before make, as that creates the make file.

 

i would put

src_configure() {



  cd ${S}

  ./configure || die



}

above the src_compile() function.

 

note that there are some programs which do not require you to run configure before doing the make, but most do. this will also help you in seeing if there are any dependencies which the ebuild should satisfy.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


×
×
  • Create New...