File: rules

package info (click to toggle)
cmor 3.13.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 16,952 kB
  • sloc: ansic: 28,083; f90: 13,872; python: 12,399; sh: 3,731; makefile: 113
file content (83 lines) | stat: -rwxr-xr-x 2,711 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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

export PYBUILD_NAME = cmor

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)
PY3DEFAULT:=$(shell py3versions --default)
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:=$(if $(filter $(BUILD_ARCH_CPU),s390x), true, false)
DO_TEST:=false

%:
	dh $@ 

override_dh_auto_configure:
	ln -sf  /usr/share/misc/config.sub 
	dh_auto_configure -- --disable-color --enable-verbose-test  --without-python \
		UUIDLDFLAGS="-lossp-uuid" UUIDFLAGS="-I/usr/include/ossp" PYTHONEXEC=$(PY3DEFAULT) \
		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" SZLIBFLAGS=" -lsz"
	dh_auto_configure --buildsystem=pybuild

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
	# Delete pyproject.toml; causes pip to ignore -no-cache-dir and try downloads
	rm -f pyproject.toml

override_dh_auto_build:
	$(MAKE) FC=f95

execute_after_dh_auto_build:
	dh_auto_build --buildsystem=pybuild

override_dh_auto_test:
ifeq ($(DO_TEST),false)
	@echo "Tests disabled"
else
	for p in $(PY3VERS)  ; do \
		PYTHONEXEC=$$p dh_auto_test ; done
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

execute_after_dh_install:
	dh_numpy3