On Thu, Jun 26, 2014 at 05:55:23PM +0100, Wookey wrote:
> Rather than gating the sphinxdoc debhelper module option on installation of 
> the
> sphinx-common package, would it not be better to use an explicit
> DEB_BUILD_PROFILE=stage1 or nodoc?
> 
> This is more deterministic. We don't want packages that still build OK
> when build-deps are missing unless explicitly asked to.
> 
> Or am I misunderstanding the patch/situation?

You're not quite misunderstanding it, but there is no need to use a
build profile for this.  In this case it's a matter of splitting the
documentation into an arch:all package and making it so that sphinxdoc
will only be used when building all the packages and that it will not be
used when building only the architecture-dependent packages on the
buildds (or during a bootstrap build).

You are right that the way I'd made the checks was not ideal; attached
is a better patch, also available in my Gitorious repository at
https://gitorious.org/roam-debian-bootstrap/mpdecimal-debian/commits/roam-stage1-indep-2

Thanks for taking a look!

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
From a8d2aa393787d6d35c8b35f4e62bca60f7fef92b Mon Sep 17 00:00:00 2001
From: Peter Pentchev <[email protected]>
Date: Tue, 17 Jun 2014 01:07:31 +0300
Subject: [PATCH] Break the docs out into arch:all libmpdec-doc.

Move the HTML documentation into a separate package and only build it if
required.  This takes care of a circular dependency loop as outlined by
the versioned page linked to from
http://bootstrap.debian.net/source/mpdecimal.html -
python3-sphinx python3 libpython3-stdlib libpython3.4-stdlib libmpdec2

Have the libmpdec-dev package recommend the new libmpdec-doc one, so
that it will be installed in the default "always install Recommends"
Debian setup.
---
 debian/control | 14 ++++++++++++--
 debian/rules   | 11 +++++++----
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/debian/control b/debian/control
index ef15f89..b25ca58 100644
--- a/debian/control
+++ b/debian/control
@@ -3,8 +3,8 @@ Priority: optional
 Maintainer: Matthias Klose <[email protected]>
 Build-Depends: debhelper (>= 8.0.0), autotools-dev,
 # gmp is only used when running the tests from the separate test tarball
- libgmp-dev,
- python-sphinx (>= 1.0.7+dfsg) | python3-sphinx
+ libgmp-dev
+Build-Depends-Indep: python-sphinx (>= 1.0.7+dfsg) | python3-sphinx
 Standards-Version: 3.9.5
 Section: libs
 Homepage: http://www.bytereef.org/mpdecimal/index.html
@@ -14,6 +14,7 @@ Section: libdevel
 Architecture: any
 Multi-Arch: same
 Depends: libmpdec2 (= ${binary:Version}), ${sphinxdoc:Depends}, ${misc:Depends}
+Recommends: libmpdec-doc
 Description: library for decimal floating point arithmetic (development files)
  mpdecimal is a package for correctly-rounded arbitrary precision decimal
  floating point arithmetic.
@@ -29,3 +30,12 @@ Replaces: libmpdec2.3
 Description: library for decimal floating point arithmetic (runtime library)
  mpdecimal is a package for correctly-rounded arbitrary precision decimal
  floating point arithmetic.
+
+Package: libmpdec-doc
+Section: doc
+Architecture: all
+Breaks: libmpdec-dev (<< 2.4.0-7)
+Replaces: libmpdec-dev (<< 2.4.0-7)
+Description: library for decimal floating point arithmetic (documentation)
+ mpdecimal is a package for correctly-rounded arbitrary precision decimal
+ floating point arithmetic.
diff --git a/debian/rules b/debian/rules
index afbc00c..c8f0e83 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,6 +17,9 @@ ifneq ($(DEB_BUILD_MULTIARCH),$(DEB_HOST_MULTIARCH))
 endif
 
 %:
+       dh $@ --parallel --buildsystem=autoconf
+
+binary binary-indep build build-indep:
        dh $@ --parallel --buildsystem=autoconf --with sphinxdoc
 
 # work around debhelper, v9 overwrites CFLAGS in the build :-/
@@ -51,9 +54,9 @@ override_dh_auto_install:
 
 override_dh_sphinxdoc:
        cp -a debian/tmp/usr/share/doc/mpdecimal/* \
-               debian/libmpdec-dev/usr/share/doc/libmpdec-dev
-       rm -f debian/libmpdec-dev/usr/share/doc/libmpdec-dev/LICENSE*
-       rm -f debian/libmpdec-dev/usr/share/doc/libmpdec-dev/INSTALL*
+               debian/libmpdec-doc/usr/share/doc/libmpdec-doc
+       rm -f debian/libmpdec-doc/usr/share/doc/libmpdec-doc/LICENSE*
+       rm -f debian/libmpdec-doc/usr/share/doc/libmpdec-doc/INSTALL*
        cp -p 
/usr/share/javascript/sphinxdoc/1.0/{doctools,jquery,searchtools,sidebar,underscore}.js
 \
-               debian/libmpdec-dev/usr/share/doc/libmpdec-dev/_static/.
+               debian/libmpdec-doc/usr/share/doc/libmpdec-doc/_static/.
        dh_sphinxdoc
-- 
2.0.0

Attachment: signature.asc
Description: Digital signature

Reply via email to