[atlas] 01/01: Use DEB_BUILD_OPTIONS=custom as new interface for building custom package.

Sébastien Villemot sebastien at debian.org
Thu Jul 27 13:53:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastien pushed a commit to branch master
in repository atlas.

commit ac0932ec75f5f4d56883cec85877671e426b481a
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Thu Jul 27 15:52:46 2017 +0200

    Use DEB_BUILD_OPTIONS=custom as new interface for building custom package.
    
    By the way, no longer automatically append a changelog entry.
    
    Gbp-Dch: Full
    Closes: #854781
---
 debian/README.Debian |  5 ++---
 debian/rules         | 37 ++++++++++++-------------------------
 2 files changed, 14 insertions(+), 28 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index eeda5a2..0f22ea6 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -50,11 +50,10 @@ Just get the sources of the package and its build-dependencies:
 
 # apt-get source atlas
 # apt-get build-dep atlas
-# apt-get install devscripts
 
 and type the following from the atlas source subdir:
 
-# fakeroot debian/rules custom
+# DEB_BUILD_OPTIONS=custom dpkg-buildpackage -uc -b
 
 it should produce a package called:
 
@@ -71,5 +70,5 @@ Thanks to David Cournapeau for providing all the patches for the shared
 libraries managements.
 
 
- -- Sébastien Villemot <sebastien at debian.org>, Fri,  7 Jun 2013 12:07:33 +0200
+ -- Sébastien Villemot <sebastien at debian.org>, Thu, 27 Jul 2017 15:42:27 +0200
  -- Sylvestre Ledru <sylvestre at debian.org>, Tue, 15 May 2012 18:05:34 +0200
diff --git a/debian/rules b/debian/rules
index 591a945..c85fc9a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,6 +8,7 @@ UBUNTU:=yes
 endif
 
 
+ifeq (,$(filter custom,$(DEB_BUILD_OPTIONS)))
 # NB: the following strings and numbers come from xprint_enums (compilable from the build
 # directory with "make xprint_enums); they can change across releases
 #
@@ -30,6 +31,10 @@ else
 # See debian/patches/generic.diff
 ARCHS=base_GENERIC_1
 endif
+else
+# Custom package
+ARCHS = base__
+endif
 
 # Pointer bitwidth
 MODE_BITWIDTH = $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
@@ -65,12 +70,13 @@ GENERIC_CONFIG_PARAMS := \
 	-Ss ADdir ../../../debian/archdefs/$(DEB_HOST_ARCH_CPU) \
 	--cripple-atlas-performance
 
-# Build a custom package optimized for the current arch
-custom: custom-stamp
-.PHONY: custom
-custom-stamp:
-		rm -f configure-stamp
 
+common-configure-arch common-configure-indep:: configure-stamp
+configure-stamp:
+		dh_testdir
+
+ifneq (,$(filter custom,$(DEB_BUILD_OPTIONS)))
+		# If building custom package, verify that CPU frequency governors are ok
 		ncpu=$$(LANG=C cpufreq-info | grep "analyzing CPU" -c);\
 		cpu=0;\
 		while test $$cpu -lt $$ncpu ; do\
@@ -83,26 +89,7 @@ custom-stamp:
 		fi; \
 		cpu=$$((cpu+1)) ;\
 		done
-
-		# Here, the trick is pretty simple:
-		# * We don't want to build all the optimized version of Atlas. Just the
-		#   one for the current CPU
-		# * We override ARCHS by base__
-		# * Base is the name of the package (libatlas3-base)
-		# * __ is provided to have the right expression
-		# * the regexp will consider that atlasArch and atlasISA are empty
-		#   therefor, leaving the choice of the optimization to Atlas
-		# * After that, we fall back to the normal build procedure by calling
-		#   debian/rules itself (yep, recursively)
-
-		# Remove all the other archs in this case
-		dch --local='+custom'  "custom build on: `uname -a`"
-		LANG=C debian/rules ARCHS=base__ binary
-		touch $@
-
-common-configure-arch common-configure-indep:: configure-stamp
-configure-stamp:
-		dh_testdir
+endif
 
 		set -e;											\
 		targetName=`echo $(ARCHS)|sed -e "s|\(.*\)_.*_.*|atlas-\1|g"`; \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/atlas.git



More information about the debian-science-commits mailing list