File: rules

package info (click to toggle)
odc 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,252 kB
  • sloc: cpp: 21,453; f90: 2,610; python: 382; sh: 365; makefile: 30; sql: 25
file content (46 lines) | stat: -rwxr-xr-x 1,724 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

# FC set to f77 by default in make
# Read default compiler name unless FC is actually set
ifeq ($(FC),f77)
  FC:=$(shell basename $(shell readlink /etc/alternatives/f77))
endif

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

FORTRAN_VERSION:=$(shell basename $(shell readlink  /usr/bin/$(FC)))

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

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

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

override_dh_auto_test:
	@echo "Ignoring test failures in this build"
	# dh_auto_test ||  echo "Ignoring test failures" 

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

override_dh_auto_install:
	dh_auto_install 
	mv $(TMPDIR)/$(LIBDIR)/libfodc.so.0d $(TMPDIR)/$(LIBDIR)/libfodc-$(FC).so.0d
	rm $(TMPDIR)/$(LIBDIR)/libfodc.so
	patchelf  --set-soname libfodc-$(FC).so.0d $(TMPDIR)/$(LIBDIR)/libfodc-$(FC).so.0d
	#patchelf  --remove-rpath $(TMPDIR)/$(LIBDIR)/libt-gfortran.so.0d
	dh_link -p libodc-dev $(LIBDIR)/libfodc-$(FC).so.0d $(LIBDIR)/fortran/$(FORTRAN_VERSION)/libfodc.so
	dh_link -p libodc-dev $(LIBDIR)/libfodc-$(FC).so.0d $(LIBDIR)/libfodc-$(FC).so
	# 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-${FC}.so%g'   $(TMPDIR)/$(LIBDIR)/cmake/odc/odc-targets-release.cmake