[atlas] 05/05: d/rules: rewrite and simplify using dh (drop cdbs).

Sébastien Villemot sebastien at debian.org
Sat Jul 29 21:56:20 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 9a68d7ea45a17c7a9099d5f31228239858b16cf9
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Sat Jul 29 23:54:54 2017 +0200

    d/rules: rewrite and simplify using dh (drop cdbs).
---
 debian/control               |   1 -
 debian/docs                  |   1 -
 debian/libatlas-dev.install  |   1 +
 debian/libatlas-doc.docs     |   3 +
 debian/libatlas-test.install |  14 +--
 debian/rules                 | 215 +++++++++++++++++--------------------------
 6 files changed, 96 insertions(+), 139 deletions(-)

diff --git a/debian/control b/debian/control
index adc98bf..bd16f17 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,6 @@ Section: devel
 Priority: optional
 Build-Depends: debhelper (>= 10),
                gfortran,
-               cdbs,
                libblas-dev,
                liblapack-dev,
                liblapack-pic,
diff --git a/debian/docs b/debian/docs
deleted file mode 100644
index e845566..0000000
--- a/debian/docs
+++ /dev/null
@@ -1 +0,0 @@
-README
diff --git a/debian/libatlas-dev.install b/debian/libatlas-dev.install
new file mode 100644
index 0000000..af4858a
--- /dev/null
+++ b/debian/libatlas-dev.install
@@ -0,0 +1 @@
+usr/include/atlas
diff --git a/debian/libatlas-doc.docs b/debian/libatlas-doc.docs
new file mode 100644
index 0000000..bec1946
--- /dev/null
+++ b/debian/libatlas-doc.docs
@@ -0,0 +1,3 @@
+README
+doc/*.txt
+TexDoc/*.pdf
diff --git a/debian/libatlas-test.install b/debian/libatlas-test.install
index 5b3e91a..e111959 100644
--- a/debian/libatlas-test.install
+++ b/debian/libatlas-test.install
@@ -1,9 +1,9 @@
-build/atlas-base/bin/*tst usr/lib/libatlas-test
-build/atlas-base/tune/blas/level1/x* usr/lib/libatlas-test
-build/atlas-base/tune/blas/gemv/x* usr/lib/libatlas-test
-build/atlas-base/tune/blas/gemm/x* usr/lib/libatlas-test
-build/atlas-base/tune/blas/ger/x* usr/lib/libatlas-test
-build/atlas-base/interfaces/blas/C/testing/x* usr/lib/libatlas-test
-build/atlas-base/interfaces/blas/F77/testing/x* usr/lib/libatlas-test
+build/bin/*tst usr/lib/libatlas-test
+build/tune/blas/level1/x* usr/lib/libatlas-test
+build/tune/blas/gemv/x* usr/lib/libatlas-test
+build/tune/blas/gemm/x* usr/lib/libatlas-test
+build/tune/blas/ger/x* usr/lib/libatlas-test
+build/interfaces/blas/C/testing/x* usr/lib/libatlas-test
+build/interfaces/blas/F77/testing/x* usr/lib/libatlas-test
 interfaces/blas/C/testing/*.dat usr/lib/libatlas-test
 interfaces/blas/F77/testing/*.dat usr/lib/libatlas-test
diff --git a/debian/rules b/debian/rules
index c85fc9a..ea99f00 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,113 +1,102 @@
 #!/usr/bin/make -f
-# Copyright 2008-2010 Sylvestre Ledru <sylvestre at debian.org>
-
-include /usr/share/cdbs/1/rules/debhelper.mk
 
 ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
-UBUNTU:=yes
+UBUNTU := yes
 endif
 
-
+# If we are not building the custom package, force the MACHTYPE and ASMDIA
 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
-#
-# The trailing number in ARCHS corresponds to the instruction set (ISA):
-# - 1 means no instruction set extension
-# - 768 means SSE1+SSE2 (always available on amd64)
+
+# Select the machine type
 ifeq ($(DEB_HOST_ARCH),s390x)
-ARCHS=$(if $(UBUNTU),base_IBMz12_1,base_IBMz9_1)
+MACHTYPE := $(if $(UBUNTU),IBMz12,IBMz9)
 else ifeq ($(DEB_HOST_ARCH_CPU),ppc64el)
-ARCHS=base_POWER8_1
+MACHTYPE := POWER8
 else ifeq ($(DEB_HOST_ARCH_CPU),i386)
 # See http://math-atlas.sourceforge.net/atlas_install/node32.html
-ARCHS=base_x86x87_1
+MACHTYPE := x86x87
 else ifeq ($(DEB_HOST_ARCH_CPU),amd64)
-ARCHS=base_x86SSE2_768
+MACHTYPE := x86SSE2
 else ifeq ($(DEB_HOST_ARCH),armhf)
-ARCHS=base_ARMa7_1
+MACHTYPE := ARMa7
 else
-# The same as 0 (UNKNOWN), except that it does not try autodetection
+# The same as UNKNOWN, except that it does not try autodetection
 # See debian/patches/generic.diff
-ARCHS=base_GENERIC_1
+MACHTYPE := GENERIC
 endif
+
+# ASMDIA corresponds the asm dialect (aka instruction set, ISA):
+# - 1 means no instruction set extension
+# - 768 means SSE1+SSE2 (always available on amd64)
+ifeq ($(DEB_HOST_ARCH_CPU),amd64)
+ASMDIA := 768
 else
-# Custom package
-ARCHS = base__
+ASMDIA := 1
 endif
 
-# Pointer bitwidth
-MODE_BITWIDTH = $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
-
-DEB_SHLIBDEPS_INCLUDE_libatlas3-base := $(CURDIR)/debian/libatlas3-base/usr/lib/atlas-base/:$(CURDIR)/debian/libatlas3-base/usr/lib/atlas-base/atlas/
-
-DEB_DH_GENCONTROL_ARGS_ALL := -- -VBuilt-Using="`dpkg-query -W -f='$${source:Package} (= $${source:Version})' liblapack-pic`"
+endif
 
-GFORTRAN_LIB_PATH=`$(CC) -print-search-dirs|grep ^install:|awk '{print $$2}'`
+GFORTRAN_LIB_PATH := $(shell $(CC) -print-search-dirs | grep ^install: | awk '{print $$2}')
 
 # Flags common to both the generic and custom packages
-COMMON_CONFIG_PARAMS := --prefix="$(DEB_DESTDIR)" 	\
-	--incdir="$(DEB_DESTDIR)/usr/include/"			\
-	--libdir="$(DEB_DESTDIR)/usr/lib/$$targetName"		\
-	--cc="${CC}" 									\
-	--cflags="${CFLAGS}" 							\
-	-D c -DWALL 									\
-	-b $(MODE_BITWIDTH) 							\
-	-Fa alg '-fPIC' 				\
-	-Ss f77lib "-L$(GFORTRAN_LIB_PATH) -lgfortran -lgcc_s -lpthread"  \
-	-Ss pmake '$(MAKE)'					\
-	-Ss flapack /usr/lib/liblapack_pic.a 	\
-	-A $$atlasArch									\
-	-V $$atlasISA 									\
+COMMON_CONFIG_PARAMS := --prefix="$(CURDIR)/debian/tmp"			 	\
+	--incdir="$(CURDIR)/debian/tmp/usr/include/"				\
+	--libdir="$(CURDIR)/debian/tmp/usr/lib/atlas-base/"			\
+	--cc="$(CC)" 								\
+	--cflags="$(CFLAGS)" 							\
+	-D c -DWALL 								\
+	-Fa alg '-fPIC' 							\
+	-Ss f77lib "-L$(GFORTRAN_LIB_PATH) -lgfortran -lgcc_s -lpthread"	\
+	-Ss pmake 'make'							\
+	-Ss flapack /usr/lib/liblapack_pic.a 					\
 	-v 2
 
 # Flags used only for the generic package
 # The cripple-atlas-performance flag is needed for disabling the CPU throttling
 #  check, because on some buildds CPU throttling is enabled and we have no way
 #  of disabling it.
-GENERIC_CONFIG_PARAMS := \
-	-t 0 \
-	-Ss ADdir ../../../debian/archdefs/$(DEB_HOST_ARCH_CPU) \
+GENERIC_CONFIG_PARAMS := 					\
+	-b $(DEB_HOST_ARCH_BITS)				\
+	-A $(MACHTYPE) 						\
+	-V $(ASMDIA) 						\
+	-t 0 							\
+	-Ss ADdir ../../debian/archdefs/$(DEB_HOST_ARCH_CPU)	\
 	--cripple-atlas-performance
 
+%:
+	dh $@
 
-common-configure-arch common-configure-indep:: configure-stamp
-configure-stamp:
-		dh_testdir
-
+override_dh_auto_configure:
 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\
-		if test $$(cpufreq-info -p 2>&1 > /dev/null; echo $$?) \
-			-eq 0 -a -z "$$(LANG=C cpufreq-info -p -c $$cpu | grep performance)" ; then \
-			echo "frequency governor on cpu=$$cpu is not set to 'performance'"; \
-			echo "run: 'sudo cpufreq-set -g performance -c cpu#' for each cpu"; \
-			echo "aborting atlas build"; \
-			exit 1; \
-		fi; \
-		cpu=$$((cpu+1)) ;\
-		done
+	# If building custom package, verify that CPU frequency governors are ok
+	set -e; 										\
+	ncpu=$$(LANG=C cpufreq-info | grep "analyzing CPU" -c);					\
+	cpu=0;											\
+	while test $$cpu -lt $$ncpu; do								\
+	if test $$(cpufreq-info -p 2>&1 > /dev/null; echo $$?)					\
+		-eq 0 -a -z "$$(LANG=C cpufreq-info -p -c $$cpu | grep performance)"; then	\
+		echo "frequency governor on cpu=$$cpu is not set to 'performance'";		\
+		echo "run: 'sudo cpufreq-set -g performance -c cpu#' for each cpu";		\
+		echo "aborting atlas build";							\
+		exit 1;										\
+	fi;											\
+	cpu=$$((cpu+1));									\
+	done
 endif
+	mkdir -p build/
+ifeq (,$(filter custom,$(DEB_BUILD_OPTIONS)))
+	cd build && ../configure $(COMMON_CONFIG_PARAMS) $(GENERIC_CONFIG_PARAMS)
+else
+	cd build && ../configure $(COMMON_CONFIG_PARAMS)
 
-		set -e;											\
-		targetName=`echo $(ARCHS)|sed -e "s|\(.*\)_.*_.*|atlas-\1|g"`; \
-		atlasArch=`echo $(ARCHS)|sed -e "s|.*_\(.*\)_.*|\1|g"`; \
-		atlasISA=`echo $(ARCHS)|sed -e "s|.*_.*_\(.*\)|\1|g"`; \
-		mkdir -p build/$$targetName;					\
-		cd build/$$targetName; 							\
-		if test "$(ARCHS)" != "base__"; then 		\
-		../../configure $(COMMON_CONFIG_PARAMS) $(GENERIC_CONFIG_PARAMS); \
-		else						\
-		../../configure $(COMMON_CONFIG_PARAMS);	\
-		fi;						\
-		echo "Configure done. targetName = $$targetName / atlasArch = $$atlasArch / atlasISA = $$atlasISA";								\
-		if test ! -s Make.inc; then echo "Configure failed: Make.inc not found"; exit 1; fi;											\
-		cat Make.inc |grep ARCH|head -1|awk '{print $$3}'; \
-		echo "=============================================="; \
-		cd -
-		touch $@
+endif
+	@echo "=============================================="
+	@echo -n "Configured arch: "
+	@grep ARCH < build/Make.inc | head -1 | awk '{print $$3}'
+	@echo "=============================================="
 
 debian/blas-atlas.pc: debian/blas-atlas.pc.in
 	sed -e "s%@DEB_UPSTREAM_VERSION@%$(DEB_UPSTREAM_VERSION)%" < $< > $@
@@ -115,60 +104,17 @@ debian/blas-atlas.pc: debian/blas-atlas.pc.in
 debian/lapack-atlas.pc: debian/lapack-atlas.pc.in
 	sed -e "s%@DEB_UPSTREAM_VERSION@%$(DEB_UPSTREAM_VERSION)%" < $< > $@
 
-common-build-arch common-build-indep:: build-stamp
-build-stamp: debian/blas-atlas.pc debian/lapack-atlas.pc
-		dh_testdir
-		set -e; 												\
-		targetName=`echo $(ARCHS)|sed -e "s|\(.*\)_.*_.*|atlas-\1|g"`; \
-		cd build/$$targetName;									\
-		$(MAKE) build;											\
-		$(MAKE) check;											\
-		test -f build/$$targetName/lib/libptcblas.a && $(MAKE) ptcheck;										\
-		echo "==============================================";	\
-		cd ../../../
-		# Do not build the help when building the custom package
-		if test "$(ARCHS)" != "base__"; then \
-			make -C TexDoc atlas_contrib.pdf atlas_devel.pdf atlas_install.pdf cblasqref.pdf  f77blasqref.pdf lapackqref.pdf; \
-		fi
-		touch $@
-
-clean:: clean-work
-clean-work:
-		dh_testdir
-		dh_testroot
-		rm -rf build check
-		rm -f debian/blas-atlas.pc debian/lapack-atlas.pc
-		rm -f configure-stamp build-stamp
-		rm -f TexDoc/*.pdf
-		[ ! -f Makefile ] || $(MAKE) distclean
-.PHONY: clean-work
-
-common-install-arch common-install-indep::
-		dh_testdir
-		dh_testroot
-
-		set -e;													\
-		targetName=`echo $(ARCHS)|sed -e "s|\(.*\)_.*_.*|atlas-\1|g"`; \
-		cd build/$$targetName;									\
-		echo "make install of $$targetName to $(DEB_DESTDIR)";	\
-		$(MAKE) DESTDIR=$(DEB_DESTDIR) install;					\
-		echo "=============================================";	\
-		cd -
-
-install/libatlas-dev::
-	if test -d $(CURDIR)/debian/libatlas-dev/usr/include/; then \
-		rm -rf $(CURDIR)/debian/libatlas-dev/usr/include/;  \
-	fi
-	mkdir -p $(CURDIR)/debian/libatlas-dev/usr/include/
-	mv $(CURDIR)/debian/tmp/usr/include/*.h $(CURDIR)/debian/tmp/usr/include/atlas/
-	mv $(CURDIR)/debian/tmp/usr/include/atlas $(CURDIR)/debian/libatlas-dev/usr/include/
-
-install/libatlas-doc::
-	if test "$(ARCHS)" != "base__"; then \
-		mkdir -p $(CURDIR)/debian/libatlas-doc/usr/share/doc/libatlas-doc/; \
-		cp -R $(CURDIR)/doc/* $(CURDIR)/TexDoc/*.pdf $(CURDIR)/debian/libatlas-doc/usr/share/doc/libatlas-doc/; \
-		rm $(CURDIR)/debian/libatlas-doc/usr/share/doc/libatlas-doc/ChangeLog; \
-	fi
+override_dh_auto_build: debian/blas-atlas.pc debian/lapack-atlas.pc
+	make -C build build
+	make -C TexDoc atlas_contrib.pdf atlas_devel.pdf atlas_install.pdf cblasqref.pdf  f77blasqref.pdf lapackqref.pdf
+
+override_dh_auto_test:
+	make -C build check
+	if test -f build/lib/libptcblas.a; then make -C build ptcheck; fi
+
+override_dh_auto_install:
+	make -C build install # The build system does not support setting DESTDIR at install time
+	mv debian/tmp/usr/include/*.h debian/tmp/usr/include/atlas/
 
 # We want packages using libblas/liblapack to depend on any BLAS/LAPACK
 # alternative, and we want packages depending on ATLAS-specific libraries
@@ -176,8 +122,17 @@ install/libatlas-doc::
 #
 # Such a setting is not supported by dh_makeshlibs, so we ship a hand-crafted
 # shlibs file.
-binary-predeb/libatlas3-base::
+override_dh_makeshlibs:
+	dh_makeshlibs
 	cp debian/libatlas3-base.shlibs debian/libatlas3-base/DEBIAN/shlibs
 
+override_dh_gencontrol:
+	dh_gencontrol -- -VBuilt-Using="`dpkg-query -W -f='$${source:Package} (= $${source:Version})' liblapack-pic`"
+
+override_dh_auto_clean:
+	rm -rf build
+	rm -f TexDoc/*.pdf
+	rm -f debian/blas-atlas.pc debian/lapack-atlas.pc
+
 get-orig-source:
 	-uscan --upstream-version 0

-- 
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