Steven Knight  committed 515e8de

Generalize DH_COMPAT for various Debian build levels.

  • Participants
  • Parent commits e2ef310

Comments (0)

Files changed (2)

 $dh_builddeb = cons::whereis('dh_builddeb');
 $fakeroot = cons::whereis('fakeroot');
+# My installation on Red Hat doesn't like any debhelper version
+# beyond 2, so let's use 2 as the default on any non-Debian build.
+$DH_COMPAT = (-f "/etc/debian_version") ? 3 : 2;
 # Now grab the information that we "build" into the files (using sed).
 		  map("build/script/$_", @script_files),
 		  qq(rm -rf build/engine/build build/engine/dist
 		     rm -rf build/script/build build/script/dist
-		     fakeroot make -f debian/rules ENVOKED_BY_CONSTRUCT=1 binary
-		     env DH_COMPAT=3 dh_clean
+		     fakeroot make -f debian/rules DH_COMPAT=$DH_COMPAT ENVOKED_BY_CONSTRUCT=1 binary
+		     env DH_COMPAT=$DH_COMPAT dh_clean

File debian/rules

 #export DH_VERBOSE=1
 # This is the debhelper compatability version to use.
-export DH_COMPAT=3
+# We expect this to be provided by the calling build script:
+export DH_COMPAT
+# Here's the previous/"normal" Debian value (?), but it breaks on a
+# converted Red Hat debhelper installation:
+#export DH_COMPAT=3
 # This has to be exported to make some magic below work.
 export DH_OPTIONS