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
|
#!/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
|