views:

520

answers:

5

Hi all,

How can we create a software package. So that after extracting our software tar ball user can do the typical steps:

$ gunzip < mycode.tar.gz | tar xvf -
$ ./configure
$ make
$ make install
+1  A: 

Use autotools to create the configure script (which will generate the Makefile necessary for the last two steps), then make a tarball with all your code and stuff in it.

womble
+6  A: 

Look into the GNU autoconf/automake toolchain. Here's a free tutorial/book.

Hank
+6  A: 

An alternative to the hard to understand GNU/Autools is CMake.

http://www.cmake.org/cmake/help/examples.html

e.g. KDE is using it.

Lennart
+1  A: 

rpmbuild is a command to build rpm packages

man page

tutorial

Sharique
When I read the linked manpage, it doesn't seem to answer the question I believe was asked: that how do you provide a platform flexible build in the first place (i.e. help with writing configure and makefile)... rpmbuild appear to assume that you have such a thing in place.
dmckee
Perhaps I misunderstood question.http://www.lrde.epita.fr/~adl/autotools.html
Sharique
+3  A: 

In the old days, this process was done by hand. Each Makefile was written by hand (the file make uses as a sort of script). This became problematic when it came to portability, and so the configure script was made. The ./configure script was written by hand for each project as well. Eventually this was automated by GNU with their autotools package. This consists of autoconf, automake, and a few others. While alternatives exist, particularly for make, autotools is most widely used. ...At least on GNU/Linux systems. Alternatives include the already mentioned CMake, Boost.Build, Boost.Jam, SCons, and more.

fow