Automated package building (GNU autotools)

Forum: LinuxTotal Replies: 4
Author Content
Sander_Marechal

Sep 02, 2007
4:23 PM EDT
Hello all,

I would like to setup my server to automatically fetch the latest version of my gnome-hearts game from subversion and build a source package (.tar.gz) from it. The kind of package that you get from executing "make dist". However, I don't want to install all the build dependencies for the game on my server. Trouble is, in order to be able to execute "make dist" I have to run "configure" first, because configure will turn my Makefile.ins into Makefiles. But configure checks to see if I have satisfied all my build dependencies.

Is it possible to setup/use the GNU autotools in such a way that configure only checks the requirements I need tor the "make dist" step insteal of the "make all" step?
mvermeer

Sep 03, 2007
12:00 PM EDT
Hmmm, 'make dist' does not produce a source package -- in my understanding it produces a binary installable package.

If you want a source package, just use tar on the source from svn. If you want an installable binary, that's a bit harder. I suppose you could build one in the way you are thinking of, but the trouble then is, that you will be able to happily install it on systems where it will never run due to lacking dependencies.

The way to avoid that is building a .deb or .rpm, leveraging the dependency checking of your packaging system. That's what 'make dist' or some variant ought to do if it is wise.

But... why do you want to build on a system where it won't run? Even if you would manage to persuade or circumvent configure, you won't get the gcc compiler's linker to work if it doesn't find the libraries it wants to link in, or their headers (irrespective of static or dynamic).

All in my (limited) understanding.
Sander_Marechal

Sep 03, 2007
1:09 PM EDT
Quoting:Hmmm, 'make dist' does not produce a source package -- in my understanding it produces a binary installable package.


Nope. "make dist" produces a GNU compliant source tar.gz package that can be compiled on any platform by merely doing the standard "configure && make && make install" magic. That is: You do not need autoconf, automake, etcetera installed on the system that you're building the tar.gz on.

Quoting:but the trouble then is, that you will be able to happily install it on systems where it will never run due to lacking dependencies.


That should not happen. The user that downloads the tarball always needs to run configure again because the result of configure (Makefiles, config.h) is not packaged in the tar.gz tarball.

Quoting:But... why do you want to build on a system where it won't run?


I only want to build the source package on my system, not the binary. You see, right now it's a 4 step process to install my nightly snapshot:

bootstrap (uses all the GNU autotools to convert the SVN source to a GNU source package) configure (generate Makefiles and config.h) make (build binaries) make install (install binaries)

I want to eliminate the first step for people downloading my nightly snapshots. But there is a catch-22 here: In order to build the source tarball, I need the Makefiles so I need to run configure myself as well.
mvermeer

Sep 04, 2007
8:38 PM EDT
OK, I see.

I remember making tarballs from a CVS tree by manually removing the CVS stuff and then just running tar. I don't know if those were "gnu tarballs", but the users were happy with them.

You could automate this by writing a suitable Makefile -- or saving and editing a Makefile produced by the full process once. (You could probably delete most of it.)

Maybe I am still misunderstanding you.
Sander_Marechal

Sep 04, 2007
10:47 PM EDT
Quoting:I remember making tarballs from a CVS tree by manually removing the CVS stuff and then just running tar.


That is pretty much what I do now. It works well, but it requires that the people downloading it have all the autotools installed.

Quoting:You could automate this by writing a suitable Makefile -- or saving and editing a Makefile produced by the full process once. (You could probably delete most of it.)


That's exactly what I don't want :-) As a good IT geek I am very lazy. 3 strikes and you automate. This would require me to craft a new makefile every time the list of files in my package changes. If I don't, my snapshots will break.

I'll just stick with the SVN tarballs for now.

You cannot post until you login.