File: rules

package info (click to toggle)
h5z-zfp 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,804 kB
  • sloc: ansic: 1,609; makefile: 929; f90: 494; sh: 48; python: 36
file content (57 lines) | stat: -rwxr-xr-x 1,990 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildtools.mk
include /usr/share/dpkg/buildflags.mk

# From https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules
# FIXME: is there a way to get these computed automatically? They are when not
# using make
INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -m  644
INSTALL_PROGRAM = $(INSTALL) -p    -m  755
INSTALL_SCRIPT  = $(INSTALL) -p    -m  755
INSTALL_DIR     = $(INSTALL) -p -d -m  755

PLUGIN_DIR_SERIAL = $(shell $(PKG_CONFIG) hdf5-serial  --variable=PluginDir)
INCLUDEDIR = /usr/include
LIBDIR = /usr/lib/$(DEB_HOST_MULTIARCH)
DESTDIR ?= debian/tmp

# Bug: buildtools.mk reports an executable for gfortran that does not actually
# exist. I need to override it here, and this is to be removed once
# buildtools.mk gives working results for FC/F77
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024421
FC=$(DEB_HOST_GNU_TYPE)-gfortran

CFLAGS += $(CPPFLAGS)
FCFLAGS += $(CPPFLAGS)

UPSTREAM_MAKE_ARGS_SERIAL = FC=$(FC) CC=$(CC) PREFIX=/usr ZFP_HOME=/usr \
			    HDF5_HOME=$(INCLUDEDIR)/hdf5/serial,$(LIBDIR)/hdf5/serial,/usr/bin

# Using make instead of cmake. Upstream has both, but their instructions cover
# make only, and building with cmake does not work out of the box. I assume
# that make is the supported build system for now
%:
	dh $@ --buildsystem=makefile --without autoreconf

override_dh_auto_clean:
	make $(UPSTREAM_MAKE_ARGS_SERIAL) clean

override_dh_auto_build:
	dh_auto_build -- $(UPSTREAM_MAKE_ARGS_SERIAL) all
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	make -C docs html
endif

override_dh_auto_test:
	cd test && make $(UPSTREAM_MAKE_ARGS_SERIAL) check

# Upstream's make install would install the plugin in /usr/plugin, so we do not
# rely on it and install manually
override_dh_auto_install:
	$(INSTALL_DIR) $(DESTDIR)$(PLUGIN_DIR_SERIAL)
	$(INSTALL_PROGRAM) src/plugin/libh5zzfp.so $(DESTDIR)$(PLUGIN_DIR_SERIAL)