File: rules

package info (click to toggle)
grads 3%3A2.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 17,336 kB
  • sloc: ansic: 61,642; sh: 10,612; makefile: 201; python: 3
file content (65 lines) | stat: -rwxr-xr-x 1,899 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

# The magic debhelper rule:
%:
	dh $@ 


DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
AUTOGENERATED:= udpt

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) \
	-fPIC

CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) \
	-I/usr/include/cairo  \
	-I/usr/include/freetype2 \
	-I/usr/include/fontconfig

export SUPPLIBS=/usr

# Build MPI version
ifneq (,$(findstring mpi,$(DEB_BUILD_OPTIONS)))
        COND_CC:= "CC=mpicc"
else
        COND_CC:=
endif

ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial/libhdf5.so),)
  WITH_HDF5:=-with-hdf5_include=/usr/include/hdf5/serial \
	--with-hdf5_libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial
else
  WITH_HDF5:=--with-hdf5
endif

override_dh_auto_clean:
	# Remove stuff added from tarballs
	rm -f doc/model.* doc/sample
	rm -f src/grads src/bufrscan src/wgrib src/stnmap src/gribmap src/gribscan
	find . -name '*.o' -delete
	rm -f $(patsubst %, debian/%, ${AUTOGENERATED})
	# rm -f data/font* data/mres data/lowres data/hires data/udunits.dat

override_dh_auto_configure:
	for f in ${AUTOGENERATED} ; do \
                sed -e 's%@ARCH@%${DEB_HOST_MULTIARCH}%g' < debian/$$f.in  > debian/$$f ; \
                done
	dh_auto_configure -- $(COND_CC) \
		--enable-dyn-supplibs --with-readline --with-printim \
		--with-grib2 --with-netcdf  --with-cairo --with-gui \
		$(WITH_HDF5) \
		--with-geotiff --with-sdf \
		--with-hdf4-include=/usr/include/hdf --with-hdf4-libdir=/usr/lib \
		--with-gadap \
		LIBS='-L/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial  -lcairo -lfreetype'
	mkdir -p  data doc
	( cd data ; tar xapf ../../grads_2.2.1.orig-data.tar.xz )
	( cd doc ; tar xapf ../../grads_2.2.1.orig-example.tar.xz )
	cp debian/favicon.png doc/favicon.png

override_dh_auto_install:
	dh_auto_install
	find debian/grads -name '*.la' -delete