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

Re: Version number in rules

On Tuesday 06 May 2008, Thijs Kinkhorst wrote:
> On Tuesday 6 May 2008 12:45, Sveinung Kvilhaugsvik wrote:
> > Is there a way to get the Debian version as a variable in the rules
> > file? Is there a standard way to remove the .dsfg from it?

If we accept that cdbs could be a sort of a standard and you don't mind having 
cdbs listed in your build-depends (well, watch out the tradeoffs;-), then: 
include /usr/share/cdbs/1/rules/utils.mk in debian/rules and you will get 
$(DEB_VERSION). If you want the trailing .dfsg chopped off from the latter, 
you can do it yourself as Thijs already suggested.

> The following works well for me. I'm not sure but I don't believe
> there's a more 'standard' way. To remove the .dfsg, add some
> sed to this line.
> DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2
> -d ' ')

Nod... That is precisely how cdbs does it for DEB_VERSION in buildvars.mk. 

pub 4096R/0E4BD0AB 2003-03-18 <people.fccf.net/danchev/key pgp.mit.edu>
fingerprint 1AE7 7C66 0A26 5BFF DF22 5D55 1C57 0C89 0E4B D0AB 

Reply to: