File: rules

package info (click to toggle)
libhdf4 4.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,384 kB
  • sloc: ansic: 128,700; sh: 15,015; fortran: 12,444; java: 5,863; xml: 1,205; makefile: 794; yacc: 678; pascal: 418; perl: 360; javascript: 203; lex: 163; csh: 41
file content (71 lines) | stat: -rwxr-xr-x 2,358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/make -f
#
# Copyright (C) 2008 Francesco Paolo Lovergine <frankie@debian.org>
# Released under GPL. See /usr/share/common-licenses/GPL for
# more information about the license.
#

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk

UPSTREAM_VERSION = $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//')

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

export DEB_CPPFLAGS_MAINT_APPEND = -I/usr/include/tirpc/
export DEB_LDFLAGS_MAINT_APPEND = -ltirpc

ifneq (,$(filter $(DEB_BUILD_ARCH),armhf))
export CC=gcc-14
export CXX=g++-14
endif

ifneq (,$(findstring verbose,$(DEB_BUILD_OPTIONS)))
   DH_VERBOSE=1
   export DH_VERBOSE
endif

%:
	dh $@

override_dh_auto_configure:
	# configure the netcdf compatible flavor, without fortran functions.
	dh_auto_configure -- --includedir=/usr/include/hdf \
	                     --enable-shared \
	                     --disable-fortran \
	                     --disable-netcdf \
	                     --with-szlib=yes

override_dh_auto_test:
ifneq (,$(filter $(DEB_BUILD_ARCH),ppc64el s390x sparc64))
	dh_auto_test --no-parallel || echo "Ignoring test failures"
else
	dh_auto_test --no-parallel
endif

execute_after_dh_auto_install:
	# strip rpath from binaries
	-find $(CURDIR)/debian/tmp/usr/bin -type f -not -name h4cc -not -name h4redeploy -exec chrpath --delete {} \;

	# strip rpath from libraries
	-find $(CURDIR)/debian/tmp/usr/lib -name "*.so*" -type f -exec chrpath --delete {} \;

	# rename programs also provided by netcdf-bin
	mv $(CURDIR)/debian/tmp/usr/bin/ncdump $(CURDIR)/debian/tmp/usr/bin/ncdump-hdf
	mv $(CURDIR)/debian/tmp/usr/bin/ncgen $(CURDIR)/debian/tmp/usr/bin/ncgen-hdf

	# rename manuals also provided by netcdf-bin
	mv $(CURDIR)/debian/tmp/usr/share/man/man1/ncdump.1 $(CURDIR)/debian/tmp/usr/share/man/man1/ncdump-hdf.1
	sed -i -e 's/ncdump/ncdump-hdf/g' $(CURDIR)/debian/tmp/usr/share/man/man1/ncdump-hdf.1

	mv $(CURDIR)/debian/tmp/usr/share/man/man1/ncgen.1 $(CURDIR)/debian/tmp/usr/share/man/man1/ncgen-hdf.1
	sed -i -e 's/ncgen/ncgen-hdf/g' $(CURDIR)/debian/tmp/usr/share/man/man1/ncgen-hdf.1

execute_after_dh_installman:
	$(RM) $(CURDIR)/debian/hdf4-tools/usr/share/man/man1/hdf.1

override_dh_makeshlibs:
	dh_makeshlibs -- -v$(UPSTREAM_VERSION)