Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Does anyone know how Portage works?
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
nybbles
n00b
n00b


Joined: 10 May 2003
Posts: 55
Location: Vancouver

PostPosted: Mon May 12, 2003 1:57 am    Post subject: Does anyone know how Portage works? Reply with quote

Okay so, its supposed to be like BSD ports... Not sure what that is...

What I would like to know is... when you type in

Code:
emerge <packagename>


what goes on behind the scenes? how is the program configured, compiled and where can you decide where to install the software?
_________________
oo oo aah aah
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Mon May 12, 2003 2:37 am    Post subject: Re: Does anyone know how Portage works? Reply with quote

snarkyshark wrote:
Okay so, its supposed to be like BSD ports... Not sure what that is...

What I would like to know is... when you type in

Code:
emerge <packagename>


what goes on behind the scenes? how is the program configured, compiled and where can you decide where to install the software?


Well, all this could all be explained to you in the Portage User Guide, or slightly more advanced info in the Portage Manual, but since i'm such a nice guy, I'll give you the skinny.

When you type in
Code:
emerge <packagename>
portage looks at <packagename>'s ebuild, and sees which package it is to download. It then proceeds to download that package, then compares the package to a "MD5 Sum" that is kept behind scenes to check that the package is complete and has not been tampered with.

Then, it looks at your use variables, and runs configure. The ebuild "maps" USE varaibles to configure options, so the package is built to your specifications.

Make is then run, and the program builds. Once that is done, portage installs it to a "sandbox" directory (to make sure it doesn't alter any live system files), then that "sandbox" directory is copied to the live filesystem, and portage keeps track of the files it installed, so it can be easily uninstalled.

And, you can't choose where to install the package to. Portage figures it out itself, but really, why would you need to? That's what a package management system is for!

Cheers,
Chris.
Back to top
View user's profile Send private message
uzik
Apprentice
Apprentice


Joined: 17 Apr 2003
Posts: 257

PostPosted: Mon May 12, 2003 3:49 am    Post subject: Reply with quote

Hey, got time for another stupid question?

I read both the docs but didn't see the answer to this.

I've written my first package. I've got an ebuild and a tar file done.
How do I put it into the portage tree on my system so I can see if
it's going to work?
Back to top
View user's profile Send private message
TheEternalVortex
Apprentice
Apprentice


Joined: 15 Oct 2002
Posts: 207
Location: San Jose, CA

PostPosted: Mon May 12, 2003 5:06 am    Post subject: Reply with quote

Set PORTDIR_OVERLAY in /etc/make.conf (the default is /usr/local/portage)
Then make directories under that. Example:
Code:

# mkdir -p /usr/local/portage/net-www/mozilla/
# cp mozilla-1.4_beta.ebuild /usr/local/portage/net-www/mozilla/
# emerge -p mozilla

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N   ] net-www/mozilla-1.4_beta

_________________
-- Andy
Back to top
View user's profile Send private message
uzik
Apprentice
Apprentice


Joined: 17 Apr 2003
Posts: 257

PostPosted: Mon May 12, 2003 5:33 pm    Post subject: Reply with quote

Thanks Andy,

I'll give it a try tonight.
Back to top
View user's profile Send private message
uzik
Apprentice
Apprentice


Joined: 17 Apr 2003
Posts: 257

PostPosted: Wed May 14, 2003 2:30 am    Post subject: Reply with quote

Well, I'm close. I can't install the files the way I need to.
It gives permissions errors when I try to make directories.
I need the executables and data files in the same directory.
If I use 'dobin' it adds the /bin/ directory to the destination.
If I use 'insinto' it removes the executable bit from the program.
The docs are not terribly well organized. I'd rewrite them if
I could understand how it worked well enough.
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