On 2/10/06, Matthew Miller <mattdm@xxxxxxxxxx> wrote: > On Fri, Feb 10, 2006 at 09:14:07AM -0500, Jeff Parker wrote: > > The required fields in a SPEC file like Version and Release may change > > often enough that I don't want to edit the SPEC file every time I make > > an RPM. Is there anyway the SPEC file can get these numbers from an > > environmental variable or command line option? > > Yes -- use a macro and -D. > > But often what people do is make a ".spec.in" file and then use something in > a makefile or other build system to generate the real .spec file with the > fields filled in. > Specifically, though, if you wanted to just use a macro you could set release like so: Release: %(getRelease) Where get release is some script you write that would get the last release from some source (db, text file, etc), atomically increment it and update the source, and then print this new release. If the source of the release information was just a text file, your spec file might look like: Release: %(R=$(( $(cat release.dat) + 1)); echo $R | tee release.dat) Good Luck...james > -- > Matthew Miller mattdm@xxxxxxxxxx <http://mattdm.org/> > Boston University Linux ------> <http://linux.bu.edu/> > > _______________________________________________ > Rpm-list mailing list > Rpm-list@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/rpm-list > _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list