scaffold using autoconf/make

39 views
Skip to first unread message

Noah Campbell

unread,
May 10, 2010, 8:02:19 PM5/10/10
to devops-t...@googlegroups.com
I'm interested in creating scaffold ala rails and rake, but using autoconf. I appreciate what tools like rake, mvn et. al. provide, but I'm interested in a specific autoconf/makefile approach.

-Noah

Scott Smith

unread,
May 10, 2010, 8:05:03 PM5/10/10
to devops-t...@googlegroups.com
Noah Campbell wrote:
> I'm interested in creating scaffold ala rails and rake, but using autoconf. I appreciate what tools like rake, mvn et. al. provide, but I'm interested in a specific autoconf/makefile approach.
>
> -Noah

It really has nothing to do with Rake specifically; all you need to do
is create some make targets to do what you want.

Which begs the question, exactly what DO you want to do?

-scott

Noah Campbell

unread,
May 10, 2010, 8:15:51 PM5/10/10
to devops-t...@googlegroups.com
I have a makefile and an rpm spec files that I'd like to generate on behalf of the user provide some very simple input, i.e. a name, etc.

Think of it as a quick way to generate the necessary scaffolding to build and package a project. I think autoconf does this, but I'm not experienced with that tool chain and I'm looking for a few pointers on how to start.

-Noah

Will Lowe

unread,
May 10, 2010, 8:30:30 PM5/10/10
to devops-t...@googlegroups.com
What kinda code is it? You could check out one of the autopackagers like http://perl.arix.com/cpan2rpm/

Lee Thompson

unread,
May 11, 2010, 10:35:55 AM5/11/10
to devops-t...@googlegroups.com
When you say "on behalf of the user" are you thinking something like

./configure --prefex=/opt/mydir --with-foo --without-bar

and the make file and the RPM responding to the foobar input?  If not, don't bother with the rest of this drivel...

Looks like the XSANE project (0.996) did this at one point but has it commented out.  The epkowa image scan "ISCAN" project creates the spec file based on autoconf input.  RRDTOOL is autoconf and has a spec file, but it looks like the RPM spec files calls the configure script instead of the generated make file calling the generated spec file which would flip the relationship.  However, pretty easy to do, just can't find off the top of my head a project that does it that way.

Like Scott said, make an "rpm:" target in the Makefile.am and rename <pkgname>.spec to <pkgname>.spec.in and put <pkgname>.spec in the configure.ac file so that it gets template expanded something like...

AC_OUTPUT([<pkgname>.spec])

To start hacking around, look at the iscan project, create a small configure.ac, Makefile.am, and <pkgname>.spec.in and run

autoreconf --force
./configure --whatever
make rpm

and start hacking around.

Richard Crowley

unread,
May 11, 2010, 4:40:01 PM5/11/10
to devops-t...@googlegroups.com
On Mon, May 10, 2010 at 5:15 PM, Noah Campbell <noahca...@gmail.com> wrote:
> I have a makefile and an rpm spec files that I'd like to generate on behalf of the user provide some very simple input, i.e. a name, etc.
>
> Think of it as a quick way to generate the necessary scaffolding to build and package a project.  I think autoconf does this, but I'm not experienced with that tool chain and I'm looking for a few pointers on how to start.

Apologies that this is built on Debian packages and you're after RPMs
but your problem seems so similar that it gave me the final push to
open-source Debra: https://github.com/devstructure/debra

I use debra-makefile(1) (along with manskeleton(1) from
http://github.com/rcrowley/manskeleton but that's tangential) when
starting any new project and the generated Makefile to build Debian
packages far more easily than with dpkg-deb(1) alone.

GNU autoconf alone leaves you with source packages, which can be the
right way to go but proper packages give tools like Puppet the ability
to only install/upgrade what is actually missing/out-of-date.

Part of the motivation for building this tool was to attempt to
standardize on our system's package management, avoiding RubyGems and
the like wherever possible. If it doesn't help you directly, I hope
you can steal anything that's useful.

Rich

Lee Thompson

unread,
May 11, 2010, 5:52:15 PM5/11/10
to devops-t...@googlegroups.com
Wow, timing is perfect.  Looks like the same idea having developers building deployable versioned artifacts and that is debs in your world!  Thanks for sharing the comment on gems as language specific package managers (gems, cpan, etc) seem to be DevDev instead of DevOps.  I think that construct set DevOps and continuous deployment conceptually back a decade.  Wonder if OSGi is a positive or a negative...  It's definitely language specific to Java.

I used to bundle a collection of perl modules and ruby gems into a single autoconf project so that it a set could be deployed as a single package.  Debs, RPMs and most other package managers have have no problem eating autoconf projects.

http://github.com/stagrlee/perlmod_bldr
http://github.com/stagrlee/rubygems_bldr

cpan2rpm, cpan2dist, and dh-make-perl are a way to get one for one cpan modules to OS packages.

Debra... any inspiration from the Beck classic crooner's ballad?

Noah Campbell

unread,
May 11, 2010, 6:05:57 PM5/11/10
to devops-t...@googlegroups.com

Debra... any inspiration from the Beck classic crooner's ballad?

From the project homepage: http://github.com/devstructure/debra

THEME SONG

Beck - "Debra"

Lee Thompson

unread,
May 11, 2010, 10:15:49 PM5/11/10
to devops-t...@googlegroups.com
Step inside my Hyundai!
Reply all
Reply to author
Forward
0 new messages