[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I configure to run a program?

From: John Calcote
Subject: Re: How do I configure to run a program?
Date: Fri, 21 Mar 2008 13:28:55 -0600
User-agent: Thunderbird (Windows/20080213)


I like to include my subversion version number in my rpm spec file so I can
keep track of the source used to generate the binary.  I've been manually
changing it but since I forget to sometimes, I'd like for make to generate
the spec file for me.  I wrote a small perl program that reads a template
file (.tmpl) and writes out the .spec file after calling subversion . -n.  I
can't figure out how to force make from a to run the perl script
each time it builds.
I thought I could do it with SUFFIXES but when I tried it didn't work.  I
added the following to the top level
Don't use make to do this - just use autoconf, and let your configure script 
deal with it:
svnrev=`svnversion .`
AC_CONFIG_FILES([Makefile ... poll.spec)

Now create a file called that contains an exact copy of your 
existing poll.spec, but add the autoconf substitution variable, @svnrev@ where 
it make sense.

In a in the directory containing your poll.spec file, add
EXTRA_DIST = ... poll.spec

I use this trick all the time and it works great! In fact, I generate most of 
my rpm and debian build scripts this way.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]