Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Creating ebuild: Getting Access Violation errors -- FIXED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Mon May 06, 2002 10:12 pm    Post subject: Creating ebuild: Getting Access Violation errors -- FIXED Reply with quote

I'm trying to create an ebuild for TOra, a toolkit for Oracle.

However in testing my script, I'm getting this error:
Code:

>>> Install tora-1.2.3 into /var/tmp/portage/tora-1.2.3/image/ category dev-db
ACCESS DENIED  mkdir:     /usr/lib/tora
mkdir: cannot create directory `/usr/lib/tora': Permission denied
make: *** [install-common] Error 1

!!! ERROR: The ebuild did not complete successfully.
!!! Function src_install, Line 4, Exitcode 2
!!! make install failed

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-tora-1.2.3-4831.log"

mkdir:     /usr/lib/tora
--------------------------------------------------------------------------------


I originally had specified /usr/lib/tora in the configure, but took it out. I don't know why it's still doing that. Even if it is, why can't it play there?


Last edited by rizzo on Tue Jul 02, 2002 2:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
Nitro
Bodhisattva
Bodhisattva


Joined: 08 Apr 2002
Posts: 661
Location: San Francisco

PostPosted: Mon May 06, 2002 10:49 pm    Post subject: Reply with quote

The problem is you are leaving the /var/tmp/portage/[package_name]/[work] directory. You can't touch anything outside of that directory except in the pkg_postinstall function(i think that is the right name..). Take a peak at some other ebuilds. If you are running 'make' or 'make install' when it is choking, you can pass variables to it that override those in the Makefile.

For example, in a make file it has: PREFIX=/usr, when you run make install, the ebuild will choke because ebuild is trying to touch the live filesystem. The solution is to run 'make PREFIX=${D} install.' ${D} is set my ebuild/emerge and points to the image directory. Don't think that just configuring the package to use ${D} will work, because then you will end up compiling the binaries wrong. Usaully, you just have to worry about the make install.

Hope that helps.
_________________
- Kyle Manna

Please, please SEARCH before posting.

There are three kinds of people in the world: those who can count, and those who can't.
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Tue May 07, 2002 12:57 pm    Post subject: Reply with quote

I had been looking at other ebuilds, and they specify prefix=${D}/usr in their make install lines. I never explicitly set the D env var. What is it set to?
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Tue May 07, 2002 1:01 pm    Post subject: Reply with quote

Also the first time I test out the ebuild through the 'ebuild <filename> merge'command, I get an error saying I need to run 'ebuild <filename> digest'. Why is this?
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Tue May 07, 2002 7:16 pm    Post subject: Reply with quote

It's still not working. Getting the same error as before. It fails on the src_install function. I've included src_compile and src_install below.

Code:

src_compile() {
    local myconf

    use kde     && myconf="$myconf --with-kde" \
                || myconf="$myconf --without-kde"
    use mysql   && myconf="$myconf" \
                || myconf="$myconf --without-mysql"

    ./configure \
        --prefix=/usr \
        --with-mono \
        $myconf || die "configure failed"
    emake || die "emake failed"
}

src_install() {
    make \
        DESTDIR=${D} \
        install || die "make install failed"

    #dodoc AUTHORS BUGS CHANGES COPYING FAQ PLATFORMS README* TODO VERSION
    #cp -a doc ${D}/usr/share/doc/${PF}/html
    #find ${D}/usr/share/docs/${PF}/html -name "Makefile*" -exec rm {} \;
    #prepalldocs
}

Back to top
View user's profile Send private message
tod
Developer
Developer


Joined: 17 Apr 2002
Posts: 136
Location: Ozarks, USA

PostPosted: Tue May 07, 2002 8:12 pm    Post subject: Reply with quote

rizzo wrote:
Code:

src_install() {
    make \
        DESTDIR=${D} \
        install || die "make install failed"

    #dodoc AUTHORS BUGS CHANGES COPYING FAQ PLATFORMS README* TODO VERSION
    #cp -a doc ${D}/usr/share/doc/${PF}/html
    #find ${D}/usr/share/docs/${PF}/html -name "Makefile*" -exec rm {} \;
    #prepalldocs
}



Try

src_install() {
make \
prefix=${D}/usr \
install || die "make install failed"


instead. See /usr/portage/skel.ebuild


hth

tod
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Tue May 07, 2002 8:40 pm    Post subject: Reply with quote

I had already tried that, and tried again after your post, getting the same error as before.

I looked at the Makefile for the program, and see this:
Code:

install: $(TARGET) install-common install-kde
        @echo Install $(TARGET) to $(INSTALLBIN)
        if [ \! -f $(TARGET) ] ; then cp tora $(TARGET) ; fi
        -strip $(TARGET) plugins/* >/dev/null 2>&1
        cp $(TARGET) $(INSTALLBIN)/tora
        if [ -f tora-plugin ] ; then rm tora-plugin ; fi
        mkdir -p $(INSTALLLIB)/tora/help
        rm -f $(INSTALLLIB)/tora/*.tso
        -cp plugins/* $(INSTALLLIB)/tora >/dev/null 2>&1
        -cp templates/*.tpl $(INSTALLLIB)/tora >/dev/null 2>&1
        -cp -r help/* $(INSTALLLIB)/tora/help >/dev/null 2>&1


It fails on the 'mkdir -p $(INSTALLLIB)/tora/help' line. These vars are set at the beginning of the Makefile.
Code:

# Where to install tora
INSTALLPREFIX=$(ROOT)/usr/local

# Where to install tora binary
INSTALLBIN=$(ROOT)/usr/local/bin

# Where to install tora plugins
INSTALLLIB=$(ROOT)/usr/local/lib


So it doesn't look at the DESTDIR variable, nor do I find the word "prefix" anywhere in the Makefile. That $(ROOT) variable is never set in the Makefile, nor in the configure or configure.pl script. I'm kind of lost. :p
Back to top
View user's profile Send private message
tod
Developer
Developer


Joined: 17 Apr 2002
Posts: 136
Location: Ozarks, USA

PostPosted: Wed May 08, 2002 2:44 pm    Post subject: Reply with quote

Hi!

It looks like you will have to excercise your sed'ing skills and change $(ROOT) to ${D} or something that has the same effect. It is safest to do the change in src_install() to ensure that the install paths aren't hardcoded into any off the installed files.

hth

tod
Back to top
View user's profile Send private message
Nitro
Bodhisattva
Bodhisattva


Joined: 08 Apr 2002
Posts: 661
Location: San Francisco

PostPosted: Wed May 08, 2002 9:11 pm    Post subject: Reply with quote

tod wrote:
Hi!

It looks like you will have to excercise your sed'ing skills and change $(ROOT) to ${D} or something that has the same effect. It is safest to do the change in src_install() to ensure that the install paths aren't hardcoded into any off the installed files.

hth

tod


Or perhaps
Code:
make ROOT=${D} install

_________________
- Kyle Manna

Please, please SEARCH before posting.

There are three kinds of people in the world: those who can count, and those who can't.
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Wed May 08, 2002 9:34 pm    Post subject: Reply with quote

Nitro wrote:
Code:
make ROOT=${D} install


I tried that and got this:

Code:
>>> Install tora-1.3.5.1_alpha into /var/tmp/portage/tora-1.3.5.1_alpha/image/ category dev-db
Install tora-mono to /var/tmp/portage/tora-1.3.5.1_alpha/image//usr/bin
cp: cannot create regular file `/var/tmp/portage/tora-1.3.5.1_alpha/image//usr/bin/tora': No such file or directory
make: *** [install] Error 1

!!! ERROR: The ebuild did not complete successfully.
!!! Function src_install, Line 3, Exitcode 2
!!! make install failed


Why can't it create that stuff? Also, is that double-slash supposed to be there. I imagine that is there because ${D} ends in a /. Does that cause problems?
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Tue Jun 18, 2002 8:22 pm    Post subject: Reply with quote

Well I'm back from my forte ebuilding adventures (emerge forte you lucky listeners) and am ready to tackle this again.

Does anyone have any idea how I need to lasso this thing and make it behave?
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Thu Jun 20, 2002 3:02 am    Post subject: Reply with quote

Turns out there was a bug in the configure/makefile so setting the $ROOT didn't work. Author has made the fix and I'll get back to testing when I can make a tarball from CVS.

Here is the email thread regarding the problem:
http://www.geocrawler.com/lists/3/SourceForge/9281/0/8978495/
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Tue Jul 02, 2002 2:30 pm    Post subject: Reply with quote

http://bugs.gentoo.org/show_bug.cgi?id=4430

TOra 1.3.6 alpha has been released and my ebuild worked without a hitch. I've submitted the files (ebuild and digest) to bugzilla. Here are the file contents:

/usr/portage/dev-db/tora/tora-1.3.6_alpha.ebuild
Code:

# TOra ebuild file
# Don Seiler, don@seiler.us

S=${WORKDIR}/tora-1.3.6
A="tora-alpha-1.3.6.tar.gz"
DESCRIPTION="TOra - Toolkit For Oracle"
SRC_URI="http://unc.dl.sourceforge.net/sourceforge/tora/${A}"
HOMEPAGE="http://www.globecom.se/tora/"

DEPEND=""

src_unpack() {
        unpack ${A}
        cd ${S}
}

src_compile() {
        local myconf

        use kde         && myconf="$myconf --with-kde" \
                                || myconf="$myconf --without-kde"       
        use mysql       && myconf="$myconf" \
                                || myconf="$myconf --without-mysql"     

        ./configure \
                --prefix=/usr \
                --with-mono \
                $myconf || die "configure failed"
        emake || die "emake failed"
}

src_install() {

        dodir ${D}/usr/bin
        make \
                ROOT=${D} \
                install || die "make install failed"

        #dodoc AUTHORS BUGS CHANGES COPYING FAQ PLATFORMS README* TODO VERSION
        #cp -a doc ${D}/usr/share/doc/${PF}/html
        #find ${D}/usr/share/docs/${PF}/html -name "Makefile*" -exec rm {} \;
        #prepalldocs
}


/usr/portage/dev-db/tora/files/digest-tora-1.3.6_alpha
Code:
MD5 1d2e1a7d597220a68006eab8c658b9db tora-alpha-1.3.6.tar.gz 2266020


Please try this out and let me know if you find any bugs. Obviously you need an Oracle client installed. I recommend 9i. Least buggy of the linux clients, works all the way down to 7.3.4 server (which is what I use).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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