Yup..most certainly, and chgroup..is it???..my memory just went blank..I know it when I'm in there... too to make them totally his.. everything but make install that is.
Here's a simple howto for most major distros.
Compiling an application from the source code
The easiest way to install new software:
1. pre-compiled .deb, .rpm, or .tgz - use the native package for your distribution
2. Compile from your distribution's source packages
3. If it hasn't been packaged use the original source
If you are trying to compile a version which is newer than the package version you may be able to patch the new version using the old package .diff file.
Compiling a Debian source package
Required package: dpkg-dev
Suggested packages: fakeroot, devscripts
download source packages
Download three files for each package: .dsc, .diff.gz, and .orig.tar.gz from your local mirror.
eg mutt_1.0pre4-1.dsc mutt_1.0pre4-1.diff.gz, and mutt_1.0pre4.orig.tar.gz.
dpkg-source -x foo.dsc
Extract the package where foo is the name of the package and will include the version number, eg mutt_1.0pre4-1
cd foo
that's the common short form of chdir foo
fakeroot build
Compile the package and put it into a .deb file. Root privileges are not required to build a .deb package if the fakeroot package is installed.
dpkg -i ../foo.deb
Install your new package. You do have to be root for this - use su to change to root from an ordinary user.
All the debian specific files live in the debian directory.
debian/rules is a makefile which is run to build the package. It can be run directly with ./debian/rules build to compile the package, or ./debian/rules binary to compile and install the package to debian/tmp.
Compiling a RedHat source package
Download the source rpm (.src.rpm) from your local mirror.
rpm --recompile foo-ver.src.rpm
From rpm(8):
When invoked this way, rpm installs the named source package, and does a prep, compile and install. In addition, --rebuild builds a new binary package. When the build has completed, the build directory is removed (as in --clean) and the the sources and spec file for the package are removed.
Compiling from the original source
Extracting the archive
* Download foo.tar.gz
* Extract with: tar -xzvf foo.tar.gz
-x
extract the file
-z
unzip it (required for .gz files)
-v
verbose, print the names of the files as they are extracted
-f foo.tar.gz
extract the named file, rather than from /dev/rmt0 (tape device)
Read documentation
Look for files called: INSTALL, README, SETUP, or similar.
Read with less docfile, or zless docfile.gz for .gz files.
Building
Follow the instructions that come with the package. Typically they will tell you to:
./configure
Many packages have a configure script which will query your system and configure themselves appropriately. Not supported by all software.
make
Compile the software. Some require a file name to build such as make foo. make reads a file normally called Makefile for what commands to run.
make install
Install the software. Typically packages will put themselves in /usr/local. Run as root.
Where to look when it doesn't work
Read the error messages. Look for errors about missing header files, libraries or commands.
Look at config.log if ./configure failed.
gcc may have be called with these options:
-llibrary
link in the library with a file called liblibrary.a
-Ldirectory
search for libraries here as well as /lib, /usr/lib, and paths specified in /etc/ld.so.conf
-Idirectory
search for #include here as well as /usr/include
-c
compile, but don't link - produces a .o file, not an executable
Often you may be missing a file which is required to build the package. This may be a header (.h) file, library (.a) file, or command required to build certain parts (yacc, as, g++, etc).
Header files are found in Debian packages ending -dev, or RedHat packages ending in -devel.
For example, there are three Debian libncurses4 packages:
libncurses4_4.2-3.deb
needed to run a program which uses ncurses
libncurses4-dev_4.2-3.deb
needed to compile an ncurses program
libncurses4-dbg_4.2-3.deb
needed to be able to debug and step through the actual ncurses functions - not often needed
Debian has a list of all files in all packages as part or each mirror: ftp://ftp.monash.edu.au/pub/linux/distributions/debian/dists/stable/Contents-i386.gz.
Use zgrep to search for missing files:
> zgrep ncurses.h Contents-i386.gz
usr/i486-linuxlibc1/include/ncurses.h oldlibs/ncurses3.0-altdev
usr/include/ncurses.h devel/libncurses4-dev
Easier than typing it all bit by bit. It's old but trusted, don't follow the libraries names, they have changed since this... sorry it's so Debian based..that's what I use, so that's what I know.. Last excursion into redhat was 9 I think..and I didn't like it.
Just saved ourselves a heap of posts there..drat..my fingers hurt now..
This message has been edited since posting. Last time this message was edited on 6. January 2007 @ 15:22
|