View previous topic :: View next topic |
Author |
Message |
red_over_blue Guru
Joined: 16 Dec 2002 Posts: 310
|
Posted: Fri Feb 14, 2003 10:39 pm Post subject: Help with simple ebuild? |
|
|
Hey everyone,
Well, I'm trying to write my first ebuild. It is for Temperature.app, which is similar to wmweather, but I like it better (less cluttered) and it is not currently available in portage.
These are the steps I took. I downloaded the tarball and extracted it, read the install instructions. It's a simpel "make" "make install" ... no biggy.
I created the following ebuild call Temperature.app-1.3.ebuild
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
S=${WORKDIR}/${P}
DESCRIPTION="Dockable applette for WindowMaker that shows temperature."
SRC_URI="http://freshmeat.net/redir/temperature.app/10337/url_tgz/${P}.tar.gz"
HOMEPAGE="http://freshmeat.net/redir/temperature.app/10337/url_homepage/temperature"
DEPEND="virtual/x11
sys-devel/perl"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86"
src_compile() {
make CFLAGS="$CFLAGS" || die
}
src_install () {
make install || die
}
I make this in /usr/local/portage/x11-plugins/Temperature.app
Now, as root, I do an emerge Temperature.app, the tar is downloaded fine, extracted, the make seems to go ok, but then I am guessing when it gets to the make install this is where the following error occurs:
ACCESS DENIED mkdir: /usr/local/GNUstep
install: cannot create directory `/usr/local/GNUstep': Permission denied
make: *** [install-gnustep] Error 1
!!! ERROR: x11-plugins/Temperature.app-1.3 failed.
!!! Function src_install, Line 22, Exitcode 2
!!! (no error message)
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-Temperature.app-1.3-9310.log"
mkdir: /usr/local/GNUstep
--------------------------------------------------------------------------------
I checked an my ebuild has the same permissions as any other ebuild in the normal portage tree, so why am I getting an error when it wants to create a directory?
Remember, this is my FIRST ebuild, so be gentle |
|
Back to top |
|
|
Scandium Retired Dev
Joined: 22 Apr 2002 Posts: 340 Location: Germany
|
Posted: Fri Feb 14, 2003 10:51 pm Post subject: |
|
|
The problem is during the build process emerge is not allowed to fall outside the portage dir but the ebuild wants to create a directory in /usr/local/...
The solution might be to change the makefile not to use /usr/local/...
(so it stops falling outside the portage dir)
You can do that by using sed somewhere in the ebuild, just look at others, some ebuilds where the build process falls outside the portage dir are using that as a trick, but _before_ you do so, try using "einstall" in src_install which might resolve it automagically.
Take a look at /usr/portage/skel.ebuild for more information |
|
Back to top |
|
|
red_over_blue Guru
Joined: 16 Dec 2002 Posts: 310
|
Posted: Fri Feb 14, 2003 10:54 pm Post subject: |
|
|
Thanks for the quick reply.
BTW - I thought portage was already very very powerful just having the emerge utility, but if I can master creating my own ebuilds, then things will move to the next level.
Thanks again. |
|
Back to top |
|
|
red_over_blue Guru
Joined: 16 Dec 2002 Posts: 310
|
Posted: Fri Feb 14, 2003 11:00 pm Post subject: |
|
|
Well, I quickly tried the einstall but that was not the solution.
I am still a little confused though. You said that the ebuild is not allowed to fall outside the portage directory.
I don't really understand what you are trying to say. The way I see it (and I know I am wrong, but just so you know how I am interpreting things), the ebuild will eventually have to install files and make directories outside the portage directory, or else my whole system would be off of the portage directory.
What is the sense in emerging something if it can't create files or directories outside of the portage directory? |
|
Back to top |
|
|
DooBeDooBeDo Apprentice
Joined: 21 Aug 2002 Posts: 220 Location: UK
|
Posted: Fri Feb 14, 2003 11:18 pm Post subject: |
|
|
Packages which just have a Makefile and don't use autoconf are the hardest to turn into ebuilds IMO.
Take a look at 'man 5 ebuild'
Here's an example of the hassle a plain Makefile gives : https://bugs.gentoo.org/attachment.cgi?id=8176&action=view |
|
Back to top |
|
|
red_over_blue Guru
Joined: 16 Dec 2002 Posts: 310
|
Posted: Fri Feb 14, 2003 11:22 pm Post subject: |
|
|
Well, for a second there I was thinking this wasn't going to be as hard as I first anticipated |
|
Back to top |
|
|
Scandium Retired Dev
Joined: 22 Apr 2002 Posts: 340 Location: Germany
|
Posted: Sat Feb 15, 2003 8:16 am Post subject: |
|
|
red_over_blue wrote: |
I am still a little confused though. You said that the ebuild is not allowed to fall outside the portage directory.
I don't really understand what you are trying to say. The way I see it (and I know I am wrong, but just so you know how I am interpreting things), the ebuild will eventually have to install files and make directories outside the portage directory, or else my whole system would be off of the portage directory.
What is the sense in emerging something if it can't create files or directories outside of the portage directory? |
You can't do an ebuild and write to every directory you like to, that gives a sandbox error. The sense of this is to make everything in the portage dir and when build is finished just move it out.
Just take a look at the skeleton ebuild file I told you about in my post before, there you'll find (a rather short ) explanation, too |
|
Back to top |
|
|
red_over_blue Guru
Joined: 16 Dec 2002 Posts: 310
|
Posted: Sat Feb 15, 2003 5:02 pm Post subject: |
|
|
Thanks for the tips. I would really like to be able to write my own ebuilds, so I guess I have a bit of reading ahead of me.
Thanks again for all the help |
|
Back to top |
|
|
red_over_blue Guru
Joined: 16 Dec 2002 Posts: 310
|
Posted: Sat Feb 15, 2003 6:11 pm Post subject: |
|
|
Thanks everyone for your help... I got it to work. I just had to add
DESTDIR = ${D}
during the "make install" portion. If anyone wants it, this will work, and the binary gets put in /usr/local/GNUstep/Apps/Temperature.app/
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
S=${WORKDIR}/${P}
DESCRIPTION="Dockable applette for WindowMaker that shows temperature."
SRC_URI="http://freshmeat.net/redir/temperature.app/10337/url_tgz/${P}.tar.gz"
HOMEPAGE="http://freshmeat.net/redir/temperature.app/10337/url_homepage/temperature"
DEPEND="virtual/x11
sys-devel/perl"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86"
src_compile() {
emake CFLAGS="$CFLAGS" || die
}
src_install() {
make \
DESTDIR=${D} \
prefix=${D}/usr \
mandir=${D}/usr/share/man \
infodir=${D}/usr/share/info \
install || die
} |
|
Back to top |
|
|
red_over_blue Guru
Joined: 16 Dec 2002 Posts: 310
|
Posted: Sat Feb 15, 2003 6:23 pm Post subject: |
|
|
Oh... and by the way, it is -25 C outside my house right now.... bloody cold! |
|
Back to top |
|
|
|