[hdf4] 04/08: Use minimal dh rules with autoreconf.
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Sun May 8 16:11:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch experimental
in repository hdf4.
commit f97baac989284f310c0b794f74fcf1aa841b3799
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Sat May 7 22:43:16 2016 +0200
Use minimal dh rules with autoreconf.
---
debian/autoreconf | 2 +
debian/autoreconf.in | 2 +
debian/changelog | 1 +
debian/control | 4 +-
debian/control.in | 4 +-
debian/rules | 249 +++++++++++++++++++++++----------------------------
6 files changed, 120 insertions(+), 142 deletions(-)
diff --git a/debian/autoreconf b/debian/autoreconf
new file mode 100644
index 0000000..3b56ed3
--- /dev/null
+++ b/debian/autoreconf
@@ -0,0 +1,2 @@
+HDF4.2.11
+HDF4_ALT
diff --git a/debian/autoreconf.in b/debian/autoreconf.in
new file mode 100644
index 0000000..96b1e4b
--- /dev/null
+++ b/debian/autoreconf.in
@@ -0,0 +1,2 @@
+HDF at RELEASE@
+HDF4_ALT
diff --git a/debian/changelog b/debian/changelog
index dbbb52f..fc47be9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,7 @@ libhdf4 (4.2.11-1~exp) UNRELEASED; urgency=medium
* Add symbols files for libhdf4-0 & libhdf4-0-alt.
* Use Breaks/Replace with version instead Conflicts/Replaces.
* Update watch file to handle common issues.
+ * Use minimal dh rules with autoreconf.
-- Johan Van de Wauw <johan.vandewauw at gmail.com> Sat, 14 Feb 2015 13:43:51 +0100
diff --git a/debian/control b/debian/control
index 523d5f7..72ec0ee 100644
--- a/debian/control
+++ b/debian/control
@@ -5,15 +5,13 @@ Uploaders: Francesco Paolo Lovergine <frankie at debian.org>,
Section: graphics
Priority: optional
Build-Depends: debhelper (>= 9),
+ dh-autoreconf,
autotools-dev,
- autoconf,
- automake,
bison,
chrpath,
flex,
gfortran,
libjpeg-dev,
- libtool,
quilt,
sharutils,
zlib1g-dev
diff --git a/debian/control.in b/debian/control.in
index 0202718..c1dc473 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -5,15 +5,13 @@ Uploaders: Francesco Paolo Lovergine <frankie at debian.org>,
Section: graphics
Priority: optional
Build-Depends: debhelper (>= 9),
+ dh-autoreconf,
autotools-dev,
- autoconf,
- automake,
bison,
chrpath,
flex,
gfortran,
libjpeg-dev,
- libtool,
quilt,
sharutils,
zlib1g-dev
diff --git a/debian/rules b/debian/rules
index aed8a6e..8f97d99 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,5 @@
#!/usr/bin/make -f
-#
+#
# Copyright (C) 2008 Francesco Paolo Lovergine <frankie at debian.org>
# Released under GPL. See /usr/share/common-licenses/GPL for
# more information about the license.
@@ -11,16 +11,17 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p' | sed -e 's/\+(debian|dfsg|ds|deb)[0-9]*.*//; s/^[0-9]://')
RELEASE := 4.2.11
-ARCHIVE := upstream/HDF$(RELEASE).tar.gz
+ARCHIVE := upstream/HDF$(RELEASE).tar.gz
PACKAGE := libhdf4
SOVER := 0
-DESTDIR := $(CURDIR)/debian/tmp
-DESTDIR_ALT := $(CURDIR)/debian/tmp-alt
-F77 := gfortran
-CC := gcc
-CXX := g++
-LIBS := -ljpeg -lz -lm
+DESTDIR := $(CURDIR)/debian/tmp
+DESTDIR_ALT := $(CURDIR)/debian/tmp-alt
+
+F77 := gfortran
+CC := gcc
+CXX := g++
+LIBS := -ljpeg -lz -lm
CFLAGS = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie dpkg-buildflags --get CFLAGS)
CFLAGS += $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie dpkg-buildflags --get CPPFLAGS)
@@ -37,97 +38,117 @@ else
DISABLE_TESTS=0
endif
-unpack: stamps/unpack-stamp
-patch: stamps/patch-stamp
-build-arch: debian/control stamps/build-arch-stamp
-build-indep: debian/control stamps/build-indep-stamp
-build: debian/control build-arch build-indep
-install: stamps/install-stamp
-install-doc: stamps/install-doc-stamp
-binary: debian/control binary-indep binary-arch
-
-stamps/unpack-stamp: debian/control
- mkdir -p stamps
- touch $@
-
-stamps/patch-stamp: stamps/unpack-stamp
- dh_testdir
+TEMPLATES=$(wildcard debian/*.in)
+
+templates:
+ for TEMPLATE in $(TEMPLATES) ; do \
+ sed -e 's/@PACKAGE@/$(PACKAGE)/g' \
+ -e 's/@SOVER@/$(SOVER)/g' \
+ -e 's/@RELEASE@/$(RELEASE)/g' \
+ $$TEMPLATE > `echo $$TEMPLATE | sed 's/.in$$//'` ; \
+ done
+
+%:
+ dh $@ --with autoreconf
+
+override_dh_clean:
+ $(RM) -r HDF$(RELEASE) HDF4 HDF4_ALT $(DESTDIR_ALT)
+ dh_clean
+
+override_dh_auto_clean:
+ if [ -e HDF4 ]; then \
+ dh_auto_clean --sourcedirectory=HDF4 \
+ --builddirectory=debian/build-hdf4 ; \
+ fi
+
+ if [ -e HDF4_ALT ]; then \
+ dh_auto_clean --sourcedirectory=HDF4_ALT \
+ --builddirectory=debian/build-hdf4-alt ; \
+ fi
+
+override_dh_autoreconf:
mkdir HDF$(RELEASE)
bash debian/copysources.sh $(RELEASE)
patch <debian/patches/rename_hdf_hdfalt -p1
- touch $@
-unpatch:
- dh_testdir
+ dh_autoreconf
-configure: stamps/configure-stamp
-stamps/configure-stamp: patch
+override_dh_auto_configure: templates
rm -rf HDF4 && ln -sf HDF$(RELEASE) HDF4
- # build the 'regular' netcdf-clashing flavor.
- cd HDF4 \
- && libtoolize \
- && autoreconf -i \
- && F77="$(F77)" CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
- --prefix=/usr \
- --includedir=/usr/include/hdf \
- --enable-shared \
- --enable-fortran
- # ./hdf/fmpool/config.sub
- #
- # build a netcdf compatible flavor, without fortran functions.
- cd HDF4_ALT \
- && libtoolize \
- && autoreconf -i \
- && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
- --prefix=/usr \
- --includedir=/usr/include/hdf \
- --enable-shared \
- --disable-fortran \
- --disable-netcdf
- touch $@
-
-stamps/build-arch-stamp: patch configure
- dh_testdir
+
+ # configure the 'regular' netcdf-clashing flavor.
+ dh_auto_configure --sourcedirectory=HDF4 \
+ --builddirectory=debian/build-hdf4 \
+ -- --prefix=/usr \
+ --includedir=/usr/include/hdf \
+ --libdir=/usr/lib \
+ --enable-shared \
+ --enable-fortran \
+ F77="$(F77)" CC="$(CC)" CXX="$(CXX)" \
+ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+ # configure the netcdf compatible flavor, without fortran functions.
+ dh_auto_configure --sourcedirectory=HDF4_ALT \
+ --builddirectory=debian/build-hdf4-alt \
+ -- --prefix=/usr \
+ --includedir=/usr/include/hdf \
+ --libdir=/usr/lib \
+ --enable-shared \
+ --disable-fortran \
+ --disable-netcdf \
+ CC="$(CC)" CXX="$(CXX)" \
+ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+override_dh_auto_build:
TESTS_ENVIRONMENT="LD_LIBRARY_PATH=$(CURDIR)/HDF4/hdf/src:$(CURDIR)/HDF4/mfhdf/libsrc:/usr/lib" \
- $(MAKE) -C HDF4 \
- F77="$(F77)" CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" \
- LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"
- if [ "$(DISABLE_TESTS)" = 0 ]; then \
- $(MAKE) -C HDF4 check\
- F77="$(F77)" CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" \
- LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"; \
- fi
+ dh_auto_build --sourcedirectory=HDF4 \
+ --builddirectory=debian/build-hdf4 \
+ -- F77="$(F77)" CC="$(CC)" CXX="$(CXX)" \
+ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ LIBS="$(LIBS)"
+
TESTS_ENVIRONMENT="LD_LIBRARY_PATH=$(CURDIR)/HDF4_ALT/hdf/src:$(CURDIR)/HDF4_ALT/mfhdf/libsrc:/usr/lib" \
- $(MAKE) -C HDF4_ALT \
- CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" \
- LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"
- if [ "$(DISABLE_TESTS)" = 0 ]; then \
- $(MAKE) -C HDF4_ALT check \
- CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" \
- LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"; \
- fi;
- touch $@
-
-stamps/build-indep-stamp: patch
-
-stamps/install-doc-stamp: build-indep
- dh_testdir
- dh_testroot
- dh_prep -i
-
- install -d -o root -g root $(DESTDIR)/usr/share/doc/$(PACKAGE)
- touch $@
+ dh_auto_build --sourcedirectory=HDF4_ALT \
+ --builddirectory=debian/build-hdf4-alt \
+ -- CC="$(CC)" CXX="$(CXX)" \
+ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ LIBS="$(LIBS)"
+
+override_dh_auto_test:
+ if [ "$(DISABLE_TESTS)" = 0 ]; then \
+ dh_auto_test --sourcedirectory=HDF4 \
+ --builddirectory=debian/build-hdf4 \
+ -- F77="$(F77)" CC="$(CC)" CXX="$(CXX)" \
+ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ LIBS="$(LIBS)" ; \
+ fi
+
+ if [ "$(DISABLE_TESTS)" = 0 ]; then \
+ dh_auto_test --sourcedirectory=HDF4_ALT \
+ --builddirectory=debian/build-hdf4-alt \
+ -- CC="$(CC)" CXX="$(CXX)" \
+ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ LIBS="$(LIBS)" ; \
+ fi
+
+override_dh_auto_install:
+ dh_auto_install --sourcedirectory=HDF4 \
+ --builddirectory=debian/build-hdf4 \
+ --destdir=$(DESTDIR)
+
+ find $(DESTDIR)
+
+ dh_auto_install --sourcedirectory=HDF4_ALT \
+ --builddirectory=debian/build-hdf4-alt \
+ --destdir=$(DESTDIR_ALT)
+
+ find $(DESTDIR_ALT)
+
+ install -d -o root -g root $(DESTDIR)/usr/share/doc/$(PACKAGE)
-stamps/install-stamp: build-arch
- dh_testdir
- dh_testroot
- dh_prep -a
-
- $(MAKE) -C HDF4 install DESTDIR=$(DESTDIR)
sed -e "s/^\.TH HDF 1/\.TH HDF 3/" $(DESTDIR)/usr/share/man/man1/hdf.1 >$(DESTDIR)/usr/share/man/man1/hdf.3
rm -f $(DESTDIR)/usr/share/man/man1/hdf.1
- $(MAKE) -C HDF4_ALT install DESTDIR=$(DESTDIR_ALT)
mv $(DESTDIR_ALT)/usr/lib $(DESTDIR)/usr/lib-alt
mv $(DESTDIR_ALT)/usr/include $(DESTDIR)/usr/include-alt
@@ -148,53 +169,9 @@ stamps/install-stamp: build-arch
mv $(DESTDIR)/usr/share/man/man1/ncgen.1 $(DESTDIR)/usr/share/man/man1/ncgen-hdf.1
sed -e 's/ncgen/ncgen-hdf/g' $(DESTDIR)/usr/share/man/man1/ncgen-hdf.1
- touch $@
-
-binary-arch: install
- dh_testdir -a
- dh_testroot -a
- dh_install -a --sourcedir=$(DESTDIR)
- dh_installchangelogs -a
- dh_installdocs -a
- dh_installman -a
- dh_strip -a
- dh_link -a
- dh_lintian -a
- dh_compress -a
- dh_fixperms -a
- dh_makeshlibs -a -- -v$(UPSTREAM_VERSION)
- dh_installdeb -a
- dh_shlibdeps -a -l$(DESTDIR)/usr/lib:$(DESTDIR)/usr/lib-alt
- dh_gencontrol -a
- dh_md5sums -a
- dh_builddeb -a
-
-
-binary-indep: install-doc
- dh_testdir -i
- dh_testroot -i
- dh_install -i --sourcedir=$(DESTDIR)
- dh_installchangelogs -i
- dh_installdocs -i
- dh_installman -i
- dh_link -i
- dh_lintian -i
- dh_compress -i
- dh_fixperms -i
- dh_installdeb -i
- dh_gencontrol -i
- dh_md5sums -i
- dh_builddeb -i
-
-debian/control: debian/control.in
- sed -e 's/@PACKAGE@/$(PACKAGE)/g' -e 's/@SOVER@/$(SOVER)/g' \
- $(CURDIR)/debian/control.in >$(CURDIR)/debian/control
-
-clean: debian/control
- dh_testdir
- dh_testroot
- rm -rf stamps HDF$(RELEASE) HDF4 HDF4_ALT .pc .pc1 .pc2 $(CURDIR)/debian/patches1 $(CURDIR)/debian/patches2 $(DESTDIR_ALT)
- rm -f patches
- dh_clean
+override_dh_makeshlibs:
+ dh_makeshlibs -- -v$(UPSTREAM_VERSION)
+
+override_dh_shlibdeps:
+ dh_shlibdeps -l$(DESTDIR)/usr/lib:$(DESTDIR)/usr/lib-alt
-.PHONY: $(ARCHIVE) clean binary-indep binary-arch configure unpack patch build-arch build-indep build install install-doc binary
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/hdf4.git
More information about the Pkg-grass-devel
mailing list