#!/usr/bin/make -f # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/pkg-info.mk # DEB_LDFLAGS_MAINT_PREPEND:= -Wl,-z,defs -Wl,--as-needed DEB_BUILD_MAINT_OPTIONS:= hardening=+all,-format DEB_CFLAGS_MAINT_APPEND:= -Wall -pedantic -fPIC DEB_CXXFLAGS_MAINT_APPEND:= -Wall -pedantic -fPIC export DEB_BUILD_MAINT_OPTIONS DEB_CFLAGS_MAINT_APPEND DEB_LDFLAGS_MAINT_PREPEND CXXFLAGS:= $(shell dpkg-buildflags --get CXXFLAGS) -std=gnu++17 -I /usr/include/eigen3 # Needed for sbuild. metview creates temp directories during build export HOME:=/tmp export METVIEW_LOCALHOST:=127.0.0.1 export METVIEW_DEBUG:=1 # Test suite requires 4 processors. Fake it export OMPI_MCA_rmaps_base_oversubscribe=1 # Code should import these from eccodes-import but doesn't export ECCODES_SAMPLES_PATH=/usr/share/eccodes/samples export ECCODES_DEFINITION_PATH=/usr/share/eccodes/definitions export ECCODES_IFS_SAMPLES_PATH=/usr/share/eccodes/ifs_samples DESTDIR:=$(CURDIR)/debian/tmp/ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH) MV_DIR:=/usr/lib/$(DEB_HOST_MULTIARCH)/metview export METVIEW_DIR_DEV:=$(CURDIR)/debian/build export METVIEW_BIN:=$(METVIEW_DIR_DEV)/bin export BUILDDIR=$(METVIEW_DIR_DEV) # Hack until complter uses this directory FC:=$(shell basename $(shell readlink -f /usr/bin/f95)) FMODDIR:=$(LIBDIR)/fortran/$(FC) FCFLAGS:=$(shell dpkg-buildflags --get FCFLAGS) -I $(FMODDIR) # For bit reproducibility LC_ALL=C TZ=UTC+0 export LC_ALL TZ # magic debhelper rule %: dh $@ --buildsystem=ecbuild --builddirectory=$(BUILDDIR) #override_dh_auto_clean: # dh_auto_clean # rm -f metview/src/images/metview.png # magics++ upstream ships with a copy of terralib, which is not used in Debian. # Instead we use # a shared terralib library, and so need to include terralib. # Also -fPIC, for some reason. override_dh_auto_configure: mkdir -p $(BUILDDIR)/share/mir/masks ( cd $(BUILDDIR)/share/mir/masks ; tar axpf $(CURDIR)/../metview_$(DEB_VERSION_UPSTREAM).orig-data.tar.xz ) dh_auto_configure -- \ -DENABLE_EXPOSE_SUBPACKAGES=On \ -DENABLE_BUILD_TOOLS=On \ -DENABLE_PPROC_MIR=On \ -DENABLE_URL_DOWNLOAD=On \ -DENABLE_MPI=On \ -DENABLE_ODB=On \ -DENABLE_FDB5=On \ -DENABLE_PNG=On \ -DENABLE_RPC=On \ -DRPC_PATH=${LIBDIR} \ -DENABLE_MIR_DOWNLOAD_MASKS=On \ -DENABLE_EXPERIMENTAL=Off \ -DENABLE_CODE_WEBHELP=Off \ -DENABLE_CONTRIB=On \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_STANDARD_REQUIRED=On \ -DMETVIEW_SITE=debian \ -DMETVIEW_EXTRA_LIBRARIES='terralib -leccodes -leckit -leckit_option' \ -DMETVIEW_EXTRA_INCLUDE_DIRS=/usr/include/terralib/kernel \ -DMAGICS_PATH=/usr \ -DBUILD_SHARED_LIBS=On \ -DENABLE_RPATHS=Off \ -DENABLE_RELATIVE_RPATHS=Off \ -DFLEXTRA_PATH=/usr/bin/flextra \ -DDISABLE_OS_CHECK=On \ -DCMAKE_Fortran_FLAGS='$(FCFLAGS)' ( cd ${METVIEW_DIR_DEV}/share ; tar axpf $(CURDIR)/../metview_$(DEB_VERSION_UPSTREAM).orig-data.tar.xz ) # These get generated ok on a machine with network connection, but fail on sbuilds, etc. # so copy pre-generated versions stored in etc mkdir -p debian/build/share/metview/etc/ cp debian/etc/* debian/build/share/metview/etc/ # cd debian/build/share/metview/etc && $(MAKE) ObjectListAllTarget # cp metview/src/images/metview_logo.png metview/src/images/metview.png override_dh_auto_test: # Don't fail on tests in this build @echo "Ignoring test failures this build" # -( LD_LIBRARY_PATH=$(CURDIR)/debian/build/lib dh_auto_test ) override_dh_fixperms-arch: dh_fixperms rm -f debian/metview/usr/lib/*/metvidew/metview_post_install_tests.sh # chmod 755 debian/metview/$(MV_DIR)/mv_compress mv debian/metview/$(MV_DIR)/metview_bin/* debian/metview/$(MV_DIR) rmdir debian/metview/$(MV_DIR)/metview_bin chmod 644 debian/metview/$(MV_DIR)/metview_*.common chmod 644 debian/metview/$(MV_DIR)/metview_stat chmod 644 debian/metview/$(MV_DIR)/metview_patches chmod 644 debian/metview/usr/lib/*/metview/*.mv file debian/metview/$(MV_DIR)/* | grep ELF | cut -f1 -d: | xargs chrpath -d chrpath -d debian/libmetview0d/usr/lib/*/lib*so.* override_dh_fixperms-indep: dh_fixperms rm -rf debian/metview-data/usr/share/applications find debian/metview-data/usr/share/metview -type f -exec chmod 644 {} \; find debian/metview-data/usr/share/metview -type d -exec chmod 755 {} \;