Hi,

Daniel's patch still uses the deprecated stage1 profile. We've
deprecated stage1, because it is meaning less. One should rather be
using descriptive profiles. I went ahead and updated Daniel's patch to
replace stage1 with "nojava" and "pkg.db5.3.notcl". The debian/rules
file also had some ENABLE_SQL which I turned into a "pkg.db5.3.nosql"
profile.

Beware that using these profiles makes the -dbg package unreproducible
as it is a cumulative debug package for all binary packages. To
alleviate that, I suggest switching to -dbgsym packages, which results
in splitting the present -dbg package in many smaller ones, each of
which will be reproducible.

Helmut
diff --minimal -Nru db5.3-5.3.28+dfsg1/debian/changelog 
db5.3-5.3.28+dfsg1/debian/changelog
--- db5.3-5.3.28+dfsg1/debian/changelog 2018-09-09 09:33:40.000000000 +0200
+++ db5.3-5.3.28+dfsg1/debian/changelog 2018-11-14 09:28:47.000000000 +0100
@@ -1,3 +1,10 @@
+db5.3 (5.3.28+dfsg1-0.3) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use build profiles. (Closes: #869952)
+
+ -- Helmut Grohne <[email protected]>  Wed, 14 Nov 2018 09:28:47 +0100
+
 db5.3 (5.3.28+dfsg1-0.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru db5.3-5.3.28+dfsg1/debian/control 
db5.3-5.3.28+dfsg1/debian/control
--- db5.3-5.3.28+dfsg1/debian/control   2018-09-09 09:33:07.000000000 +0200
+++ db5.3-5.3.28+dfsg1/debian/control   2018-11-14 09:28:47.000000000 +0100
@@ -4,16 +4,15 @@
 Maintainer: Debian Berkeley DB Group <[email protected]>
 Uploaders: Ondřej Surý <[email protected]>, Dmitrijs Ledkovs <[email protected]>
 Standards-Version: 3.9.6
-# For cross building one also needs tcl8.4:native (ie. such that it
-# can be executed to pre-process sqlite3 components).
 # For DEB_STAGE=stage1 build tcl-dev, javahelper, default-jdk can be dropped
 Build-Depends: debhelper (>= 10),
               autotools-dev,
               dh-autoreconf,
-              tcl-dev,
-              procps [!hurd-i386],
-              javahelper,
-              default-jdk
+              tcl <cross !pkg.db5.3.notcl>,
+              tcl-dev <!pkg.db5.3.notcl>,
+              procps [!hurd-i386] <!nocheck>,
+              javahelper <!nojava>,
+              default-jdk <!nojava>
 Homepage: 
http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html
 Vcs-Browser: https://anonscm.debian.org/git/pkg-db/db5.3.git
 Vcs-Git: git://anonscm.debian.org/pkg-db/db5.3.git
@@ -116,6 +115,7 @@
 Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
 Conflicts: libdb4.6-tcl, libdb4.7-tcl, libdb4.8-tcl, libdb5.1-tcl, libdb5.2-tcl
+Build-Profiles: <!pkg.db5.3.notcl>
 Depends: ${tcl:Depends},
         ${shlibs:Depends},
         ${misc:Depends}
@@ -144,6 +144,7 @@
 Breaks: libdb5.3-java (<< ${source:Version})
 Conflicts: libdb5.1-java, libdb5.2-java
 Multi-Arch: same
+Build-Profiles: <!nojava>
 Description: Berkeley v5.3 Database Libraries for Java
  This package provides the Java interface for the Berkeley v5.3 database
  library.
@@ -157,6 +158,7 @@
         ${misc:Depends}
 Pre-Depends: ${misc:Pre-Depends}
 Multi-Arch: foreign
+Build-Profiles: <!nojava>
 Description: Berkeley v5.3 Database Libraries for Java
  This package provides the Java interface for the Berkeley v5.3 database
  library.
@@ -169,6 +171,7 @@
         ${shlibs:Depends},
         ${misc:Depends}
 Conflicts: libdb4.6-java-dev, libdb4.7-java-dev, libdb4.8-java-dev, 
libdb5.1-java-dev, libdb5.2-java-dev
+Build-Profiles: <!nojava>
 Description: Berkeley v5.3 Database Libraries for Java [development]
  This package provides the Java interface for the Berkeley v5.3 database
  library.
@@ -192,6 +195,7 @@
         ${misc:Depends}
 Pre-Depends: ${misc:Pre-Depends}
 Multi-Arch: same
+Build-Profiles: <!pkg.db5.3.nosql>
 Description: Berkeley v5.3 Database Libraries [SQL runtime]
  This is the runtime package for programs that use the v5.3 Berkeley
  database SQL library.
diff --minimal -Nru db5.3-5.3.28+dfsg1/debian/rules 
db5.3-5.3.28+dfsg1/debian/rules
--- db5.3-5.3.28+dfsg1/debian/rules     2018-09-09 09:33:07.000000000 +0200
+++ db5.3-5.3.28+dfsg1/debian/rules     2018-11-14 09:28:47.000000000 +0100
@@ -26,11 +26,8 @@
   ENABLE_JAVA=yes
 endif
 
-ifeq ($(DEB_STAGE),stage1)
+ifneq (,$(filter nojava,$(DEB_BUILD_PROFILES)))
   ENABLE_JAVA=no
-  ENABLE_TCL=no
-else
-  ENABLE_TCL=yes
 endif
 
 CONFIGURE_SWITCHES =    --prefix=/usr \
@@ -44,7 +41,7 @@
                        --enable-stl \
                        --enable-dbm
 
-ifeq ($(ENABLE_TCL),yes)
+ifeq (,$(filter pkg.db5.3.notcl,$(DEB_BUILD_PROFILES)))
   ENABLE_TESTS=yes
   CONFIGURE_SWITCHES += --enable-tcl
 ifneq (,$(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/tcl*))
@@ -58,20 +55,10 @@
   DH_OPTIONS += -Nlibdb5.1-tcl
 endif
 
-ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
-  ENABLE_TESTS=no
-endif
-
-ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
   ENABLE_TESTS=no
 endif
 
-ifeq ($(ENABLE_TESTS),yes)
-  CONFIGURE_SWITCHES += --enable-test
-else
-  CONFIGURE_SWITCHES += --disable-test
-endif
-
 ifeq (zx86_64-linux-gnuz,z$(DEB_HOST_GNU_TYPE)z)
 CONFIGURE_SWITCHES += --with-mutex=POSIX/pthreads/library
 endif
@@ -87,11 +74,9 @@
 DH_PLUGINS += --with=javahelper
 else
 CONFIGURE_SWITCHES += --disable-java
-DH_OPTIONS += -Nlibdb5.3-java -Nlibdb5.3-java-dev -Nlibdb5.3-java-jni
 endif
 
-ifeq (no,$(ENABLE_SQL))
-DH_OPTIONS += -Nlibdb5.1-sql
+ifneq (,$(filter pkg.db5.3.nosql,$(DEB_BUILD_PROFILES)))
   CONFIGURE_SWITCHES += --disable-sql
 endif
 
@@ -138,13 +123,13 @@
        cd dist && libtoolize -cfi
        cd lang/sql/sqlite && libtoolize -cfi
        cd dist && ./s_config
-ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+ifeq ($(ENABLE_TESTS),yes)
        JAVACFLAGS="$(JAVACFLAGS)" dh_auto_configure -Ddist -Bbuild-test -- 
$(CONFIGURE_SWITCHES) --enable-test
 endif
        JAVACFLAGS="$(JAVACFLAGS)" dh_auto_configure -Ddist -Bbuild-production 
-- $(CONFIGURE_SWITCHES) --disable-test
 
 override_dh_auto_clean:
-ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+ifeq ($(ENABLE_TESTS),yes)
        dh_auto_clean -Ddist -Bbuild-test
 endif
        dh_auto_clean -Ddist -Bbuild-production
@@ -165,7 +150,7 @@
 
 override_dh_auto_test:
 ifeq (,$(findstring z$(DEB_BUILD_GNU_CPU)z,$(VERY_BROKEN_CPUS))$(findstring 
z$(DEB_BUILD_GNU_SYSTEM)z,$(VERY_BROKEN_SYSTEMS)))
-ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+ifeq ($(ENABLE_TESTS),yes)
        cd build-test && make cutest && ./cutest
        echo 'source ../test/tcl/test.tcl; run_std;' | tclsh
 
@@ -209,7 +194,7 @@
 
        echo -n "Berkeley DB signature is:"; $(CURDIR)/debian/db_signature
 
-ifneq ($(DEB_STAGE),stage1)
+ifneq (,$(filter nojava pkg.db5.3.notcl,$(DEB_BUILD_PROFILES)))
        if [ -f $(CURDIR)/debian/saved_signature_$(DEB_HOST_ARCH).txt ]; then \
            cmp $(CURDIR)/debian/saved_signature_$(DEB_HOST_ARCH).txt         \
                $(CURDIR)/debian/build_signature_$(DEB_HOST_ARCH).txt         \
@@ -227,7 +212,7 @@
 
 override_dh_install:
        dh_install -a -Xusr/doc --list-missing
-ifeq ($(ENABLE_TCL),yes)
+ifeq (,$(filter pkg.db5.3.notcl,$(DEB_BUILD_PROFILES)))
        tcltk-depends
 endif
 

Reply via email to