LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-11-2004, 10:31 AM   #1
squirrels
LQ Newbie
 
Registered: Jun 2004
Location: Baltimore, MD USA
Distribution: Slackware 9.1 right now...
Posts: 15

Rep: Reputation: 0
MAKE, installing source packages, etc...can someone explain this or at least...


lead me to a link that explains it?

Installing Linux wasn't that hard at all...it's when I started installing stuff on top of Linux that I really started getting lost. It seems like when I download these source packages, there's always a "configure" and a bunch of "make"s going on, but I have no understanding of what's going on behind the scenes.

I know that this is somehow looking at the "Makefile" in the package and compiling the source according to the specs, but I find myself asking questions like, "Did I unzip the .tar into the right directory before installing? Is this supposed to go here? Is MAKE going to put everything where it needs to go or do I need to move/link stuff? How does it know what libraries to search for this/that on my system? etc etc"

Can someone please break the whole open-source and make deal down for me? Or at least direct me to some documentation that describes it in layman's terms? I'm usually pretty quick with stuff like this, I've programmed before and understand the concept, but honestly, websites that package stuff like this usually just have a really simple install guide like:

"Unzip this file into the proper directory." Which is WHAT??
"Run ./configure" Which does what?
"Run make" Huh?? OK
"Run make install" OK uhh...am I 'done'? What now? And what did I just do?

I'm used to the Windows way of run the file, answer "Yes", and watch the scrollbar move. Even DOS programs installed simpler than this. But I DO want to learn...I just need a direction to look.

Thanks in advance.
 
Old 06-11-2004, 10:48 AM   #2
verzonnen
Member
 
Registered: Aug 2003
Posts: 31

Rep: Reputation: 15
>"Unzip this file into the proper directory." Which is WHAT??
just create a directory somewhere and cd into that directory for excample
mkdir /tmp/software
cd /tmp/software

Depending on the extension you can "unpack the file"
for .tgz use the command tar -xvzf filename
tar will usualy create a subdirectory so you will have to "cd" into that.

>"Run ./configure" Which does what?
This will optimize the configuration for you particular machine/cpu

>"Run make" Huh?? OK
make will "compile" the prgram(s) for you, this can take a long time even hours..

>"Run make install" OK uhh...am I 'done'? What now? And what did I just do?
make install will install the program(s) for you, only run this if the privious make did complete sucsesfully.

Hope this helps...
 
Old 06-11-2004, 10:57 AM   #3
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 47
you really should have a reference book at hand to help you learn.........

here is a link to Rute User's Tutorial and Exposition
http://www.icon.co.za/~psheer/book/index.html.gz
 
Old 06-11-2004, 11:04 AM   #4
Nis
Member
 
Registered: Jul 2003
Location: Virginia
Distribution: Ubuntu Hoary (5.04)
Posts: 550

Rep: Reputation: 31
For Slackware, if you cannot find a package on LinuxPackages then compiling is the way to go. verzonnen laid it out really nicely. The only other things you could add are these:
Code:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
This is what most official Slack packages use and it keeps everything in a nice order on your filesystem. Not necessary but useful.

Also check out checkinstall. You run checkinstall instead of 'make install' and it will create a Slackware package and install it for you. This makes it easy to remove software later using pkgtool and makes a nice entry in /var/log/packages. checkinstall is in the extras/ directory on the Slackware CD.
 
Old 06-11-2004, 12:39 PM   #5
penguin4
Senior Member
 
Registered: May 2004
Location: california
Distribution: mdklinux8.1
Posts: 1,209

Rep: Reputation: 45
squirrels; oh got depenedant on W, just like me but i,m letting go of all of
windows forever! like the challenge of learning linux and its whole open-source being. even programming and development. squirrels just give it up
come with us and linux.
 
Old 06-11-2004, 12:52 PM   #6
rustynailz
Member
 
Registered: Jun 2004
Distribution: MDK 9.2/10.0, VectorLinux 4.0
Posts: 50

Rep: Reputation: 15
The programming thing is a neat angle - I do a lot of development, and I find that once you understand the different parts of a program and how they're put together (compiling, linking, etc) you get a really good feel for what's going on in each stage.

Another really great reference is the manpages and info. Try "info make" and it'll show you how a makefile works. This is really good to know - sometimes you can edit makefiles to work better (though passing options to configure usually takes care of it nicely).

This is a good link too (for Mandrake, but applies pretty much everywhere):
http://doc.mandrakelinux.com/Mandrak...e-chapter.html
 
Old 06-11-2004, 02:02 PM   #7
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Just to expand on verzonnen said...

A source "tarball" is simply the collection of source code used to compile a program (including directory structure). They're typically named with an extension of ".tgz", ".tar.gz", or ".tar.bz2". The "gz" versions of the extensions means that the gzip utility was used to compress the file. The "bz2" means that the bzip2 utility was used for compression. When you unzip/untar the tarball you downloaded, the source code directory structure is created and the appropriate source code files are placed in each subdirectory. You then cd into the directory the tar command created to compile the source code.

The configure script is pretty much exactly what it sounds like. Keep in mind Linux runs on a wide variety of hardware including processors. When you run configure, essentially, the script analyzes your system to detect what is present or missing. There are explicit tests to find what the size of integers are (in bytes) or other computer-architecture-dependent things. That could make a difference on how the code should be compiled. Similarly, the script will test to make sure necessary libraries are installed to support the software you will compile. The configure script will croak if it encounters something it can't adjust for. It simply customizes the way the source code is compiled to make sure it will work with your system.

Running "make" is when you actually compile the software. The configure script modified the "Makefile" that you said you are familiar with. Essentially, a Makefile contains instructions regarding how to compile the software. It specifies the commands to run, the options for those commands, the files to include. Depending on the complexity of the software package, there may be a vast number of things that need compiling. When the make command finishes successfully, then you have a working executable, but it's not in the right place yet; it's not "installed" on the system.

Issuing the "make install" command is what will put the software you compiled into the proper place on your machine. Since a Makefile contains sequences of commands to execute, it can be used for things other than compiling. In this case, it's used to copy the executable, any man pages, libraries, or other files to the appropriate spot.. Once make install completes, the software has been installed on your machine. You should be able to run the new program just like any other.

One last thing to add... The configure script usually accepts a number of optional arguments. These arguments can specify anything from where to put the program when you run "make install" to completely disabling certain features in the source code. Each configure script can be different. So it's imperative to read any INSTALL file that omes with the tarball.
 
Old 06-12-2004, 06:08 AM   #8
Dobie
Member
 
Registered: Nov 2003
Location: Halifax N.S.
Distribution: Mandrake 9.1
Posts: 35

Rep: Reputation: 15
Thanks Dark_Helmet.
Like squirrels, i'm new to *nix, and must say that I've found your post very informative.

Tanks
Dobie.
 
Old 06-12-2004, 09:25 AM   #9
Stevetgn
Member
 
Registered: Jun 2003
Distribution: SuSE10, Mepis,
Posts: 230

Rep: Reputation: 30
Quote:
Originally posted by Dobie
Thanks Dark_Helmet.
Like squirrels, i'm new to *nix, and must say that I've found your post very informative.

Tanks
Dobie.
Me too, cheers!
 
Old 06-12-2004, 12:51 PM   #10
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
rustynailz : the link you provided is for MDK 9.2 I suppose changes are minimal, but could you supply a link for MDK 10? Thanx in advance
 
Old 06-12-2004, 06:05 PM   #11
hct224
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 87

Rep: Reputation: 15
Nice posts.

Now I have a question, how am I going to build a RPM package from source package? I need to do all the above steps and then build RPM or just can build directly RPM package from the source? What command should I use to build RPM package?

 
Old 06-12-2004, 08:24 PM   #12
rustynailz
Member
 
Registered: Jun 2004
Distribution: MDK 9.2/10.0, VectorLinux 4.0
Posts: 50

Rep: Reputation: 15
Don't think there's official 10.0 documentation out yet - either that or it's on the CDs.
 
Old 06-13-2004, 09:35 AM   #13
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
[B] rustynailz[/]: been reading the Reference Guide and it mentions a Starter Guide. I'm sort of impatient to get going so do you know if there's a link to that one as well

(if it's on the CDs I'll get it eventually, but I've been waiting, like, a whole day (!) and I want more!!! )
 
Old 06-13-2004, 11:49 AM   #14
penguin4
Senior Member
 
Registered: May 2004
Location: california
Distribution: mdklinux8.1
Posts: 1,209

Rep: Reputation: 45
linmix; slow down impatience broods mistakes! patience is a virtue, practice
it. and you are right evetually you will run across any information either on cd or online even written. so slow down its there. welcome to linux we all
go through anxiousness but get through some how with patience!
 
Old 06-13-2004, 12:21 PM   #15
rustynailz
Member
 
Registered: Jun 2004
Distribution: MDK 9.2/10.0, VectorLinux 4.0
Posts: 50

Rep: Reputation: 15
Yeah, just go to www.mandrakelinux.com and click on the Doc link on the top - it's got a starter guide, a reference, and a command line link (plus you can get PDFs if you want).

Another really good reference is the alt.os.linux.* newsgroups, but be careful about what you post - there are some extremely knowledgeable Linux folks there, but there are also a lot of people who take pleasure in nitpicking. I'd strongly recommend just reading (lurking) for at least a week or two before you post. Make sure you find and read the FAQ for the groups as well - they've got some excellent answers to commonly asked questions, and the etiquette suggestions will avoid you getting flamed right out of the gate.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
installing software from source, make uninstall question darkleaf Linux - Software 2 08-19-2004 04:18 PM
Make Mandrake use a different drive for installing packages Foxy Mandriva 7 07-20-2004 09:28 AM
Can ANYONE explain how to make 6 chanell NForse 2 based sound work? buboleck Linux - Hardware 0 01-30-2004 02:27 AM
Can someone please explain the make process to me? supertechmyers Linux - Newbie 5 11-07-2003 12:42 PM
creating packages (.tgz/.deb/.rpm) How from the source packages? l_9_l Linux - General 1 03-06-2002 06:03 PM


All times are GMT -5. The time now is 01:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration