Here's one scenario where I use -v and binary:Version.  I have a
library, libscarlet, that I build for both Sarge and Etch.  To be able
to tell the two versions apart, I append "+dv3.1" or "+dv4.0" to the
version of the binary package.  ("dv" stands for "Debian Version.")

I build the following regular, debug, and developer package files:

     libscarlet0_1.6.0+dv3.1_i386.deb
 libscarlet0-dbg_1.6.0+dv3.1_i386.deb
  libscarlet-dev_1.6.0+dv3.1_i386.deb
     libscarlet0_1.6.0+dv4.0_i386.deb
 libscarlet0-dbg_1.6.0+dv4.0_i386.deb
  libscarlet-dev_1.6.0+dv4.0_i386.deb


I build both versions of the packages from the same source.
The binary version is set with a pbuilder hook that edits the
debian/rules file to pass a -v flag to dh_gencontrol (which
passes it to dpkg-gencontrol).  Here is my hook script:


#! /bin/sh -e
# A50add-debianversion, by Stephen Gildea.
# pbuilder type A hook, runs before dpkg-buildpackage.
# Purpose: add the version of this Debian release to the binary
#  package version.  
# (This addition lets us build binaries for
#  more than one Debian release from the same sources.)
debian_release=$(cat etc/debian_version)
cd tmp/buildd/*/
source_version=$(dpkg-parsechangelog | sed -n '/^Version: /s/Version: //p')
total_vers=$source_version+dv$debian_release
echo "Will build binaries as version $total_vers"
sed -i~ "/^     dh_gencontrol[^-]*\$/s/dh_gencontrol/& -- -v'$total_vers'/" \
    debian/rules


The dpkg support for different source and binary versions is great,
and it accurately records that my binary packages come from the same
source.  In particular, my binary package control files correctly have
the following lines:

Version: 1.6.0+dv4.0
Source: libscarlet (1.6.0)


I would like to specify the dependencies of the dbg and dev packages
with the following simple declarations in the control file:


Package: libscarlet0-dbg
Depends: libscarlet0 (= ${binary:Version})

Package: libscarlet-dev
Depends: libscarlet0 (= ${binary:Version})


... and this is the only part of my whole setup that doesn't work.
${binary:Version} is "1.6.0", but it needs to be "1.6.0+dv4.0".

Thank you for your attention to this issue.

 < Stephen



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to