The most newbie question
Ok, I've looked around to try and find the answer first, nothing.
So this may be the easiest question to answer or maybe not, but i have determined that is important enough for me to ask. How do you do basic compiling? For example, i've downloaded an emulator, or maybe just a random program, but I can't compile it because I don't know how. Sooooo if you could answer it for me, or maybe point me in the right direction, i would be most greatful :) |
you will have to untar the package, usually run configure(after reading README and INSTALL) and then make; make install.
do you know linuxpackages.net ? ... man tar man gcc man make more /usr/doc/Linux-HOWTOs/* EDIT: man man |
It can be a mine field
Hi Linux_n00b_57, nice to meet you and it's a pleasure to see someone other then myself willing to ask a question, thats the thing i find about linuxquestions, no body here has to ask questions they all seem to be programmed at birth with the answeres (wish i was them)
Anyway in response, if you have downloaded a package off the net they quite often end with a different identifier ie windows would be .exe, redhat would be .rpm and so on and so on. Slackware precompiled packages ten to end with .tgz where as source packages often end with .tar.gz Assuming now you have a source package (.tar.gz) you will have to unpack it first so place it in a folder of your choosing and open a konsole and (in my experience) using the cd command change into the directory your package is stored in. Now type in tar -zxvf yourfilename.tar.gz once youve done this type in ./configure now type in make and finally type in makeinstall If your downloaded package ends with .tgz then simply open a console and again using the cd command change to the directory your package is in and type in the following installpkg yourpackagename.tgz and press enter. I may be slightly wrong as i tend to follow erklaerbaer's advice and download the pre built package from www.linuxpackages.net or packages.slackware.it is also a viable option Let us know how you get on. |
It's a .tar.bz2
|
don't want to be arrogant, but...
Read The Fine Manual |
Where is it? because I can't find it.
|
nvm i found it, thank you, sorry for being difficult
|
Hiya ;), not sure which manual you've found, but there's the 'man' manual, the 'info' manual, and the docs, which are in that order (for me anyways) the places to look in your own computer (as opposed to on the internet) for information about anything.
So in a console, 'man tar' or 'info tar' will return whatever MANual pages there might be for the tar command. The docs that come with Slackware (I think) are located in /var/doc or /var/docs but there may be other locations for stuff too. If you happen to be using a desktop environment, it is quite easy if you have ARK or a similar archive program available. Then you can just navigate to the bz2 or zip file or whatever it is, right click it, and select 'Extract Here...'. Most times it will extract into a new folder of its own, where you would then go into, and then follow The-Yikes' instructions above from in a terminal/console window. |
Remember to read the README and INSTALL and compile if they exist.
Usually it's just "./configure; make; make install" |
To try to summarize, compiling the source is often a 5 step dance
Code:
tar zxvf <package> |
if it's a tar.bz2 package.
you can do tar -xjvf <package name>. And... Quote:
|
am I the only one who adds the step:
su before make install? I thought everything was to be compiled as user, and install as root? |
Quote:
I would also recommend using Checkinstall (in the extras folder). It makes package maintenance sooooooo much easier: Code:
./configure |
LOL :D forgot the su part.. Though to be truthful:
A) I often try as a user first to see what happens, and B) most of the time, I open my console from an already-su'd konqueror, because I need su-konqueror to move the package into its resting place, so the console winds up su too :) |
Quote:
To expand on the 'su'. If the package/program is system wide then the 'su' would be used. If the install package/program is user specific then the user can install in his/her environment. |
I've written a tool which makes compiling and packaging a real breeze most of the time.
http://distro.ibiblio.org/pub/linux/...1.0-i486-1.tgz Login as root, install the above package. Then just type `src2pkg tarballname`. Can't get much easier than that. If it turns out that you need to pass extra options to configure you can do that and much more by using the src2pkg options. |
Thanks for that, Gnashley :) I will be checkng into it shortly. Already downloaded it, and it looks very handy; nice work!
|
Quote:
the clarification by onebuck is really what I was looking to elicit. + sometimes when I am trying to compile on my own and working in different terminal windows I'll accidentally ./configure as root, which forces me to make as root, etc if it wasn't necessary to 'su' to make install then I'd be aggravating myself for no reason. I too liberally apply checkinstall. ? how do you tell if its a user package? also does it still go to /var/log/packages? can someone point me to the 'M' in rtfm about this? (and no, that wasn't sarcasm ;D ) @gnashley- yes thanks for the tool. I am d/ling it now. another ? should I feel kind of lame for relying on all these package tools to install stuff? I use whatever I can find at linuxpackages, slackbuilds and the CD extras of course. But should I endeavor to learn the intricacies of this stuff myself? Whats the benefit (besides satisfying my abnormal geek curiosity)? |
Even more simple:
Rightclick the tar.* --> Extract --> click on the new folder --> press F4 --> ./configure --> make --> (as root) checkinstall --> installpkg. ;) Of course always read the README and/or INSTALL in advance. src2pkg is also a fine tool (maybe even more handy). Lets you install .deb and .rpm files as well! |
"how do you tell if its a user package?" Do you mean if it should be installed to /usr? If so, i think that nearly anything you package for use with installpkg should be installed to /usr (except for stuff like KDE or anything that *needs* to be installed to another prefix. If you are compiling and installing with 'make install', then the program shouild go to prefix /usr/local.
Learning the ins and outs of compiling is fun and can also be quite challenging. I've spent the last two years working on src2pkg and teaching it what I learn. It can now compile, on it's own, many programs that I couldn't compile even manually two years ago. Having a look through the src2pkg the configure_source function may provide some tips for configuring difficult sources. For instance, a few months ago I discovered the 'nearly magic' command 'autoreconf -if' which will update all the config files and stop *lots* of errors. src2pkg uses autoreconf when it finds autoconf sources without an executable configure script -like CVS sources. Most sources can be configured and compiled as user and then installed as root, but there are programs which must be compiled as root in order to work correctly -there are others which must be compiled as user, but this is less common. When this is the case, you can still use the src2pkg tools by untarring and compiling as user, then su to root and make the package using trackinstall instead of src2pkg. src2pkg and trackinstall can also write the script for you, if you need or want to keep a record the build for repeatability. |
All times are GMT -5. The time now is 06:58 AM. |