When you are installing new applications to your Unix server it is almost always better to use some soft of package management tool. Compiling from source allows you to custom tailor the application to your hardware, but most applications do not provide a means for uninstalling.
Another issue with installing from sources is that you do not have a central repository to list all your installed applications. src2pkg is the best of both worlds, compile from source and install via the package management system.

src2pkg creates a variety of packages from different types of source archives. For this post I am going to stick with a Slackware centric example, *.tar.gz to *.tgz.

Typically with you install from source you do the following:

[user@host:~]$ tar -xzf application.tar.gz
[user@host:~]$ cd application
[user@host:~]$ ./configure && make && make install

src2pkg does the same, but instead archives the final install into a package for installation. The equivalent command would be:

[user@host:~]$ src2pkg -CWD application.tar.gz

CWD keeps everything in the current working directory. For applications that need special parameters passed as part of the configure or different steps, src2pkg has options that can be specified to pass them along to the underlying compile process. For example, if you wanted to change the prefix path.

[user@host:~]$ src2pkg -CWD -p='/usr/local' application.tar.gz

Now the package will use /usr/local as the base directory for the installation. Check the manual and help for the rest of the options.

Introduction to src2pkg
Slackware’s “magic package maker”
src2pkg for the impatient

Leave a Reply

You must be logged in to post a comment.