Alternatively, you can use some kind of perl/shell script that executes in the post-install stage and changes the SPEC file. Should be easy enough.
----- Original Message ----- From: "Tzafrir Cohen" <[EMAIL PROTECTED]> To: "Oded Arbel" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, October 17, 2002 9:21 PM Subject: Re: An RPM question > On Thu, 17 Oct 2002, Oded Arbel wrote: > > > Hi list. > > > > I tried to find how to do this on my own, but failed - I wonder if it can be > > done at all : > > > > I have a SPEC file that I use to build an RPM from a CVS source. at the top of > > the spec file I have a %define which says > > %define use_cvs 1 > > nowdown the file,in the %prep stage it checks that define and either checks > > out the CVS version and package it into the SOURCES directory, or %setup the > > source archives (which were created from the CVS in the last build from CVS). > > after the build finishes RPM packs the source archives and spec file into the > > source RPM. now I want to rebuild the software from the source RPM in another > > computer, one that does not have access to the CVS (or I simply want to build > > exactly the version that is in the source RPM), so I have to rpm -i the > > source RPM and then manually edit the spec file to change use_cvs to 0. > > is there a way to get RPM (or using some script) to automaticly change the > > %define to 0 for the copy of the SPEC file that goes into the source RPM > > package ? > > Make a command-line option to set 'use_cvs' to 1, and make the default 0. > > I think that the package spec should not "know" it is in a CVS version. > > Have a look at the qmail srpm from: > > ftp://ftp.rpmhelp.net/pub/Mandrake/djbware/8.2/SRPMS/qmail-1.03-20rph.src.rp m > > For sample of command-line manipulations. > > > However, I believe that such things should be left for external scruipts > outside the rpm spec. IMHO a source rpm is something that should be able > to be built autonomously. > > In the ivritex rpm the rpm spec is created from rpm.spec.in . One oof the > things set there is the version number (because it is used in some other > places in the makefile, and we wanted to update just one place). > > > So I can simply run: > > rm -fv ivritex.spec *.tgz > make VERSION="$REAL_VERSION"`date +%Y%m%d` rpm > > to create tarballs and binary RPMs. I still haven't automated it, > though... > > -- > Tzafrir Cohen > mailto:tzafrir@;technion.ac.il > http://www.technion.ac.il/~tzafrir > > > > ================================================================= > To unsubscribe, send mail to [EMAIL PROTECTED] with > the word "unsubscribe" in the message body, e.g., run the command > echo unsubscribe | mail [EMAIL PROTECTED] > > ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
