[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Getting a dynamic Release number for a spec file.
- From: James Olin Oden <james oden gmail com>
- To: RPM Package Manager <rpm-list redhat com>
- Subject: Re: Getting a dynamic Release number for a spec file.
- Date: Fri, 10 Feb 2006 10:02:55 -0500
On 2/10/06, Matthew Miller <mattdm mattdm org> 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 mattdm org <http://mattdm.org/>
> Boston University Linux ------> <http://linux.bu.edu/>
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list redhat com
> https://www.redhat.com/mailman/listinfo/rpm-list
>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]