#!/usr/bin/make -f # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) #DEB_BUILD_MAINT_OPTIONS:= hardening=+all DEB_CFLAGS_MAINT_APPEND:= -Wall export DEB_BUILD_MAINT_OPTIONS #export DEB_CFLAGS_MAINT_APPEND BUILD_ARCH_OS :-= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) BUILD_ARCH_CPU := $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU) NETCDF_LIBS := $(shell pkg-config --libs heimdal-gssapi netcdf libffi) PY3VERS:=$(shell py3versions --supported) DESTDIR:=$(shell pwd)/debian/tmp export CFLAGS:=-I/usr/include/ossp -fstack-protector \ --param=ssp-buffer-size=4 -Wformat -Wformat-security\ -Werror=format-security $(CFLAGS) DO_TEST:=false ifeq ($(BUILD_ARCH_OS)-$(BUILD_ARCH_CPU),kfreebsd-i386) DO_TEST:=false endif ifeq ($(BUILD_ARCH_CPU),s390x) DO_TEST:=false endif %: dh $@ override_dh_auto_configure: ln -sf /usr/share/misc/config.sub dh_auto_configure -- --disable-color --enable-verbose-test --with-uuid --without-python \ UUIDLDFLAGS="-lossp-uuid" UUIDFLAGS="-I/usr/include/ossp" \ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" SZLIBFLAGS=" -lsz" override_dh_auto_clean: rm -rf config.sub config.log config.status libcmor.a libcmor.so.2 build test_grid configure CMIP5 rm -rf CMOR.egg-info rm -f ipcc_test_code Makefile setup.py *.mod compile_line.txt include/cmor_locale.h cmor.pc test_unit_cat_unique find . -name '*.nc' -delete find . -name '*.o' -delete find . -name '*.pic_o' -delete find . -name '*.pyc' -delete override_dh_auto_build: $(MAKE) FC=f95 override_dh_auto_test: ifeq ($(DO_TEST),false) @echo "Tests disabled; see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598745" else dh_auto_test endif override_dh_auto_install: $(MAKE) install DESTDIR=$(DESTDIR) $(MAKE) install_shlib DESTDIR=$(DESTDIR) mkdir -p $(DESTDIR)/usr/lib/python3/dist-packages PYTHONPATH=$(DESTDIR)/usr/lib/python3/dist-packages \ python3 ./setup.py install --prefix=/usr --install-layout=deb \ --single-version-externally-managed --root=$(DESTDIR) for p in $(PY3VERS) ; do \ PYTHONPATH=$(DESTDIR)/usr/lib/python3/dist-packages \ $$p ./setup.py install --prefix=/usr --install-layout=deb \ --single-version-externally-managed --root=$(DESTDIR); \ done dh_install -p libcmor-dev cmor.pc $(LIBDIR)/pkgconfig dh_link -p libcmor-dev $(LIBDIR)/libcmor.so.2 $(LIBDIR)/libcmor.so dh_numpy3 # Fix path sed -i -e 's%/usr/bin/python3.1[0-9]%/usr/bin/python3%' debian/tmp/usr/bin/PrePARE