File: rules

package info (click to toggle)
odc 1.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,144 kB
  • sloc: cpp: 21,984; f90: 3,707; sh: 966; ansic: 477; python: 389; makefile: 33
file content (37 lines) | stat: -rwxr-xr-x 1,133 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

include /usr/share/debhelper/dh-fortran/fortran-support.mk

export FC_DEFAULT

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
TMPDIR:=$(CURDIR)/debian/tmp
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)

DO_TEST:=true

# The magic debhelper  rule
%:
	dh $@ --buildsystem=ecbuild --with fortran

BUILD_FLAGS:= -DENABLE_FORTRAN=ON \
			-DENABLE_RPATHS=OFF \

override_dh_auto_configure:
	dh_auto_configure -- \
		      ${BUILD_FLAGS} -DCMAKE_Fortran_COMPILER=$(FC_DEFAULT)

override_dh_auto_test:
	$(DO_TEST) && ( LD_LIBRARY_PATH=$(CURDIR)/debian/build/lib dh_auto_test  ) || true

override_dh_dwz:
	@echo bypass dwz that causes build failures due to patchelf changes

override_dh_auto_install:
	dh_auto_install 
	# Fixup cmake files
	sed -i -e 's%$${_IMPORT_PREFIX}/include%/usr/include/${DEB_HOST_MULTIARCH}%g' $(TMPDIR)/$(LIBDIR)/cmake/odc/odc-targets.cmake
	sed -i -e 's%/include/odc%/usr/include/${DEB_HOST_MULTIARCH}/odc%g' $(TMPDIR)/$(LIBDIR)/cmake/odc/odc-targets.cmake
	sed -i -e 's%libfodc.so%libfodc-gnu.so%g'   $(TMPDIR)/$(LIBDIR)/cmake/odc/odc-targets-release.cmake