VectorLinux

Getting you started => How to's => Topic started by: InTheWoods on September 27, 2006, 08:41:43 pm

Title: How to install software from source code
Post by: InTheWoods on September 27, 2006, 08:41:43 pm
How to install software from source code:

Get your package ready

NOTE: tar.gz and .tgz are the same thing.


Installing the package
(or dependencies).
Open a terminal and CD to the package directory.
For most packages run the following commands:

   ./configure (options)        #configure the package
   make             #compile files
   make install         #copy files to the system
OR

./configure && make && make install
(is this the same thing?)

./configure <options>
This creates a makefile for your package detailing how the package is to be installed on your system.
Options may be specified in package documentation (or elsewhere).
READ THE DOCUMENTATION.
In Vector 6.0 --prefix=/usr should usually be one of the options. This specifies the package is to be installed in the /usr directory.
If you are updating a package already installed on the system install it to the same directory as the older version.
./configure --help  may list the available options.

EXAMPLE:   ./configure --prefix=/usr --enable-gui

make”      compiles the required files into binary files

make install”      copies the binaries into your system.

You can then clean up from the compiling process with “make clean” (in the package directory). But you will no longer be able to uninstall the package with “make uninstall”!!!
Ditto if you delete your package directory!


A  better way to install from source:

   ./configure (options)       # configure the package   
   make              # compile files
   checkinstall –L      #create a .tlz package.

OR

./configure –prefix=/usr && make && checkinstall –L ( would this work)

checkinstall”   creates and installs a package for your system leaving it in the
package directory.
The checkinstall version provided is optimized for vector .
Do not use another version.
Use the –L switch for a .tlz package and -G for a .tgz package.
The package can be uninstalled like any other with removepkg
without damaging your system.
It can be reinstalled at any time with installpkg.




Installing your package with SCONS
Not all packages use the ./configure && make && make install method of installation. Some use the scons system to build and install packages.

Get your package source and get it ready
(see above)
READ THE DOCUMENTATION.
In a terminal CD to the package directory:
   scons configure   # Configure the package. You may need options.
   scons        # Build the scons package.
   scons install    #  Install the scons package

OR
checkinstall scons install



Other install methods:

Pkgtool            tukaani-pkgtools is a GUI wrapper for the make tools described above.
                     Just follow the onscreen prompts.
install scripts    scons itself uses a python script for its self installation.
                     This is run from a terminal in the package directory.
                     READ THE DOCUMENTATION.
Midnight
Commander     a file manager that runs in a terminal. (this could use it’s own how to)
Title: Re: How to install software from source code
Post by: Triarius Fidelis on September 27, 2006, 09:02:11 pm
Good work, mate
Title: Re: How to install software from source code
Post by: DrCR on October 26, 2006, 05:10:36 am
Dido that, thanks as well. It took me over two years of using Linux on and off before figuring out make/makeinstall. Your HowTo has helped to bring me up more than a couple of pegs.  :)

DrCR
Title: Re: How to install software from source code
Post by: easuter on October 26, 2006, 07:18:46 am
very complete howto, kudos InTheWoods!
Title: Re: How to install software from source code
Post by: barret on October 26, 2006, 11:50:26 pm
this is great! that's exactly what i was looking for :)

especially uninstalling & update bits :) (hm... i think it's worth printing)

big thanks man!
Title: Re: How to install software from source code
Post by: barret on October 29, 2006, 04:32:46 am
but when i do checkinstall -L it says that there is no such option: -L. what's wrong?
i also checked in help, and indeed, there is no such thing like -L switch. or -G.
Title: Re: How to install software from source code
Post by: easuter on October 29, 2006, 04:36:40 am
but when i do checkinstall -L it says that there is no such option: -L. what's wrong?
i also checked in help, and indeed, there is no such thing like -L switch. or -G.

-L or -G are options uased only for VL 5.8 (and its corresponding dynamite versions).

just use simple checkinstall on its own for 5.1
Title: Re: How to install software from source code
Post by: saulgoode on October 29, 2006, 12:47:03 pm
I would recommend doing 'configure' and 'make' as an unprivileged user and then switch to root only for the final installation ('tis a little safer).
Title: Re: How to install software from source code
Post by: Triarius Fidelis on October 29, 2006, 10:44:06 pm
Furthermore, you can delete all the cruft left behind AS a normal user (.o files, etc.)
Title: Re: How to install software from source code
Post by: MikeCindi on November 02, 2006, 11:16:59 pm
Furthermore, you can delete all the cruft left behind AS a normal user (.o files, etc.)

Is that that same as makeclean and then deleting the source directory? Or is it a better, safer option (esp. when done as USER vs. ROOT)?
Title: Re: How to install software from source code
Post by: Triarius Fidelis on November 16, 2006, 03:57:25 am
Furthermore, you can delete all the cruft left behind AS a normal user (.o files, etc.)

Is that that same as makeclean and then deleting the source directory? Or is it a better, safer option (esp. when done as USER vs. ROOT)?

make clean rules typically remove object files, dynamically generated headers, executables, etc. I've never seen one fail, especially in the days of GNU autoconf, distutils, and others, but it could happen.

make clean does not delete the source directory (that I know of). If you build as root, revert to normal user, and then try to expunge said directory by hand, however, you will notice all those files created during the build will block your way.

The point is, you can build software just as well as normal user as you can root, and one should do things as normal user by default.

Sorry if I came off as incoherent---I haven't slept for a while...
Title: Re: How to install software from source code
Post by: MikeCindi on November 16, 2006, 05:47:40 am
Thanks. I don't think you were unclear I'm just trying to learn the "why" along with the "how-to".
Title: Re: How to install software from source code
Post by: Triarius Fidelis on November 22, 2006, 02:07:07 pm
Oh ya. Gotta love that!!
Title: Re: How to install software from source code
Post by: henryxcrudos on August 27, 2009, 07:21:19 am
J.U.S.T. what I was looking for. I thought it'd work like that, but it's good to see it black on white (at least until I change my vieweing options ;D).

THUMBS UP!