[nfft] 04/06: Refactor and simplify content of rules file.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Oct 12 13:27:25 UTC 2016


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

ghisvail-guest pushed a commit to annotated tag debian/3.3.2_rc3-1
in repository nfft.

commit 2c696431cb150c68fc49f87dc6e792d4006522ce
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Tue Oct 11 11:39:47 2016 +0100

    Refactor and simplify content of rules file.
    
    - Use dh_listpackages to detect long-double precision availability.
    - Drop superfluous query for DEB_HOST_ARCH_CPU.
    - Drop explicit setup of precision suffix, use upstream's defaults.
    - Simplify all targets by looping through the available precisions.
    
    Gbp-Dch: full
---
 debian/rules | 73 ++++++++++++++++++++++++------------------------------------
 1 file changed, 29 insertions(+), 44 deletions(-)

diff --git a/debian/rules b/debian/rules
index 5877fbc..0aa114b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,87 +8,72 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
+# Available precisions.
+PRECISIONS = single double
+ifneq (,$(findstring libnfft3-long2,$(shell dh_listpackages)))
+	PRECISIONS += long
+endif
+
 # Build options common to arch and indep targets.
 BUILD_OPTIONS = \
 	--disable-applications \
+	--disable-doxygen-doc \
 	--disable-examples \
 	--disable-static \
 	--enable-all \
 	--enable-openmp
 
-# Detect whether the long-double version of the FFTW library is available for
-# the host architecture.
-HAVE_FFTWL ?= $(shell pkg-config --exists fftw3l && echo 'yes')
-
 DEB_HOST_ARCH_CPU := $(shell dpkg-architecture --query DEB_HOST_ARCH_CPU)
 
 %:
 	dh $@
 
 override_dh_auto_clean:
-	dh_auto_clean --arch --builddirectory=build-nfft
-	dh_auto_clean --arch --builddirectory=build-nfftf
-ifneq (,$(HAVE_FFTWL))
-	dh_auto_clean --arch --builddirectory=build-nfftl
-endif
+	for p in $(PRECISIONS) ; do \
+		dh_auto_clean --builddirectory=build-$$p ; \
+	done
 
 override_dh_auto_configure-arch:
-	dh_auto_configure --builddirectory=build-nfft -- \
-		$(BUILD_OPTIONS) \
-		--disable-doxygen-doc
-	dh_auto_configure --builddirectory=build-nfftf -- \
+	dh_auto_configure --builddirectory=build-single -- \
 		$(BUILD_OPTIONS) \
-		--disable-doxygen-doc \
-		--enable-single \
-		--program-suffix=f
-ifneq (,$(HAVE_FFTWL))
-	dh_auto_configure --builddirectory=build-nfftl -- \
+		--enable-single
+	dh_auto_configure --builddirectory=build-double -- \
+		$(BUILD_OPTIONS)
+ifneq (,$(findstring long,$(PRECISIONS)))
+	dh_auto_configure --builddirectory=build-long -- \
 		$(BUILD_OPTIONS) \
-		--disable-doxygen-doc \
-		--enable-long-double \
-		--program-suffix=l
+		--enable-long-double
 endif
 
 override_dh_auto_configure-indep:
-	dh_auto_configure --builddirectory=build-nfft -- \
+	dh_auto_configure --builddirectory=build-double -- \
 		$(BUILD_OPTIONS) \
 		--enable-doxygen-doc
 
 override_dh_auto_build-arch:
-	dh_auto_build --builddirectory=build-nfft
-	dh_auto_build --builddirectory=build-nfftf
-ifneq (,$(HAVE_FFTWL))
-	dh_auto_build --builddirectory=build-nfftl
-endif
+	for p in $(PRECISIONS) ; do \
+		dh_auto_build --builddirectory=build-$$p ; \
+	done
 
 override_dh_auto_build-indep:
-	dh_auto_build --builddirectory=build-nfft -- doc
+	dh_auto_build --builddirectory=build-double -- doc
 
 # Note: long-double testing is temporarily disabled for powerpc and ppc64el
 # to allow the package to transition whilst upstream is working on a fix.
 override_dh_auto_test-arch:
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	dh_auto_test --builddirectory=build-nfft
-	dh_auto_test --builddirectory=build-nfftf
-ifneq (,$(HAVE_FFTWL))
-ifeq (,$(filter powerpc ppc64el,$(DEB_HOST_ARCH_CPU)))
-	dh_auto_test --builddirectory=build-nfftl
-endif
-endif
+	dh_auto_test --builddirectory=build-single
+	dh_auto_test --builddirectory=build-double
+ifneq (,$(findstring long,$(PRECISIONS)))
+	dh_auto_test --builddirectory=build-long
 endif
 
 override_dh_auto_test-indep:
 	# No-op.
 
 override_dh_auto_install-arch:
-	dh_auto_install --builddirectory=build-nfft \
-		--package=libnfft3-double2
-	dh_auto_install --builddirectory=build-nfftf \
-		--package=libnfft3-single2
-ifneq (,$(HAVE_FFTWL))
-	dh_auto_install --builddirectory=build-nfftl \
-		--package=libnfft3-long2
-endif
+	for p in $(PRECISIONS) ; do \
+		dh_auto_install --builddirectory=build-$$p ; \
+	done
 
 override_dh_installdocs-indep:
 	dh_installdocs --indep

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



More information about the debian-science-commits mailing list