James, How can i assign the value from the command line like i said? Then how can i declare it within the specfile? I am not understanding the suggestions you posted. Thanks Barry ----- Original Message ----- From: "James Olin Oden" <joden@xxxxxxxxxxxxx> To: <rpm-list@xxxxxxxxxx> Sent: Friday, March 05, 2004 4:12 PM Subject: Re: How can I change some values within the spec file during rpmbuild? > On Fri, 5 Mar 2004 barry@xxxxxxxxxxxxxxxxxxx wrote: > > > All, > > > > How can I change something within the spec file while building the > > rpm package using rpmbuild command? > > > > For example, if I have a build number that I need to reflect it in > > the "release:" field, then can I say something like: > > > > %define buildnumber 111 > > ... > > Release: %{buildnumber} > > > One approach, of which their are many variants are to use the %() macro. > This is very simular to using backticks (i.e. `ls`) in shell or in bash > $(). So here is a variant. Your wrapper script that calls rpmbuild > writes to a file the build number and your relase line looks like: > > Release: %(cat /some/file) > > Sometimes what goes in %() is a command: > > Release: %(getBuildNumber) > > > > and when execute rpmbuild, then I type "rpmbuild -bb specfile -- > > define 'buildnumber 222' ??? > > > And I think that works too. > > Oh, and another thing you can do is write a file that defines the > macro, you end up with something like this in said file: > > %define buildnumber 222 > > And then you do this at the top of your spec file: > > %{expr: %(cat /some/file.macro)} > > Which gets the contents of the macro file, and then evaluates via > the macro processor. > > I am sure there are other ways...james > > > _______________________________________________ > 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