1

I need to compile a software from the sources.

./config && make && make install

On that, it does install a bunch of stuff everywhere(Libraries, etc)

But the thing is, that I also need to copy that software after to another set of machines that I do not want to install gcc on.

How could I make that software install in one "directory" to then just copy to the other machines ?

2
  • When I say everywhere, it could be /usr/local/bin/... /usr/share/.... etc...
    – yield
    May 28, 2015 at 16:21
  • 1
    --prefix= seem to do the job. But further explanation would be greatly appreciated.
    – yield
    May 28, 2015 at 17:00

1 Answer 1

3

If you intend to distribute the software to other machines, you definitely need to package it.

You don't specify which distribution you are using, so general guidance follows.

Software in the GNU/Linux and *BSD worlds is usually distributed in packaged form and source code when its license allows it.

Different distributions use different frontends or package managers to update, install and remove this software.

Software compiled from source code is commonly (but not always) built using a known workflow (configure && make && make install), the option you mention (--prefix) is an option present when using a common set of tools to build software from the GNU project known as the autotools. Briefly explained, it is possible to pass an option to modify the default location (/usr/local) that make install will use to copy the compiled software in the local system.

Packaging software includes this compilation step, but is more convoluted, as it leverages the use of metadata to manage dependencies, transactionality and other functionality not present in the bare-bones autotools schema.

Take a look at the output of:

$ rpm -qi coreutils

Name        : coreutils
Version     : 8.23
Release     : 10.fc22
Architecture: x86_64
Install Date: Fri 15 May 2015 11:55:00 PM BST
Group       : System Environment/Base
Size        : 16324354
License     : GPLv3+
Signature   : RSA/SHA256, Thu 14 May 2015 03:22:57 PM BST, Key ID 11adc0948e1431d5
Source RPM  : coreutils-8.23-10.fc22.src.rpm
Build Date  : Thu 14 May 2015 10:00:06 AM BST
Build Host  : buildhw-05.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://www.gnu.org/software/coreutils/
Summary     : A set of basic GNU tools commonly used in shell scripts
Description :
These are the GNU core utilities.  This package is the combination of
the old GNU fileutils, sh-utils, and textutils packages.

In this case, the package format is RPM, other distributions use DEB, and the package managers are also different (yum/dnf, zypper, pkgsrc, dpkg or apt/aptitude, ...).

Depending on the amount of machines you need to distribute this software to, and the process you use to build it, QA it and store it, different methods (or parts of them) apply:

  • Learn how the standard packaging system works in your platform of choice. For example, in Red Hat and derivatives, you need to write an SPEC file and use rpmbuild. There are also lightweight alternatives like fpm that can save you time.

  • Learn how to configure and manage a private repository to host your custom packages. Some tools in this field include createrepo and apt-utils, but also higher level applications like cobbler, pulp or nexus.

  • If your workflow is more convoluted, for example if it includes QA of the package, you might need tools to automate this. There are many.

  • Document the process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .