Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 export DH_VERBOSE=1
5
6 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
7 LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
8 BUILDDIR:=$(shell pwd)
9
10 LIBS := -ljpeg -lz -lm -lsz
11
12 CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
13 CFLAGS_NOWARN:=$(shell dpkg-buildflags --get CFLAGS | sed -e 's/-Werror=implicit-function-declaration//' )
14 CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)
15
16 # Set SHELL in examples/ makefiles to /bin/sh ?
17 # if set to sh then autoconf breaks
18 # export CONFIG_SHELL=/bin/sh
19
20 # Magic debhelper rule
21 %:
22 dh $@
23
24 override_dh_auto_clean:
25 find . -type l -delete
26 find . -name '*.o' -delete
27 find . -name '*.lo' -delete
28
29 override_dh_auto_test:
30 @echo "Tests disabled"
31
32 override_dh_auto_configure:
33 dh_auto_configure -- --enable-shared --with-pic \
34 --enable-fortran \
35 CFLAGS="$(CFLAGS_NOWARN)" \
36 CPPFLAGS="$(CPPFLAGS) -Df2cFortran -I/usr/include/hdf" \
37 LIBS="$(LIBS)"
38 # FIXME: a sort of hack
39 ln -sf testswath.f testdrivers/swath/testswath77.f
40 ln -sf testpoint.f testdrivers/point/testpoint77.f
41
42 override_dh_auto_install:
43 dh_auto_install
44 # Undo permissions we don't want
45 $(MAKE) -C samples clean
46 chmod -x samples/*
47 # Lose the builddir for reproducibility
48 sed -e 's%${BUILDDIR}%/nonexistant%' < samples/Makefile > x
49 mv x samples/Makefile
50 # Symlinks
51 dh_link -p libhdfeos0t64 $(LIBDIR)/libhdfeos.so.0.0.0 $(LIBDIR)/libhdfeos.so.0
52 dh_link -p libhdfeos-dev $(LIBDIR)/libhdfeos.so.0.0.0 $(LIBDIR)/libhdfeos.so
53 # Don't ship
54 rm -f debian/tmp/usr/lib/*/libhdfeos.la