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

Re: spec file mutations.



Circa 2005-09-22 01:49 dixit Jason Pyeron:

: We manage too many machines, which is made manaable by using up2date.
: 
: We push everything as a rpm.
: 
: Most "upstream" providers are src rpms, which get a --rebuild and are 
: deploed to our differnet channels as needed.
: 
: But there are some which are CVS type upstream.
: 
: We have a program which gives us a revision marker unique to the working 
: copy, which would allow us to reproduce it each time, it is intended to be 
: the rpm's release attribute.
: 
: A general package would be like so:
: 
: Name: package
: Version: CVS.Tag
: Release: LastModDate.SpecVer

How do you get the source to begin with?  Via a CVS
checkout/update/export, or via downloading a snapshot?

Is the specfile included in the CVS source, or maintained separately?

If the specfile is maintained in CVS and under your control, you may be
able to use $-keywords in the specfile to get the information you want
directly from CVS when the specfile is checked out or updated.  You may
need to define macros and then process them to get the info in the form
you want.  For example:

    %define CVSTag $Name$
    %define ModDate $Date$
    ...
    Version: %(echo "%{CVSTag}" |sed -e 's/\$//g')
    Release: %(echo "%{ModDate}" |sed -e 's/\$//g' -e 's/ /_/g')

If the specfile is not under your control and maintained in CVS, then
you might consider using an external tool to modify---or create---the
specfile before using it to build the package.  Alternatively, if you
have control over the specfile, but it's not maintained under CVS, use
%() macros to grab the information you need out of the checked-out or
snapshot source.

Good luck.

-- 
jim knoble  |  jmknoble pobox com  |  http://www.pobox.com/~jmknoble/
(GnuPG fingerprint: 809F:09B9:9686:D035:4AB0::9455:124B:0A62:DD6A:76D6)
 .....................................................................
 :"The methods now being used to merchandise the political candidate :
 : as though he were a deodorant positively guarantee the electorate :
 : against ever hearing the truth about anything."   --Aldous Huxley :
 :...................................................................:


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