File: rules

package info (click to toggle)
magics%2B%2B 4.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 372,684 kB
  • sloc: cpp: 167,682; xml: 37,400; fortran: 26,295; python: 19,861; perl: 8,096; ansic: 4,114; javascript: 2,298; sh: 1,475; csh: 136; f90: 97; makefile: 87
file content (119 lines) | stat: -rwxr-xr-x 3,899 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/make -f

export DH_VERBOSE=1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# To enable all, uncomment following line
# DEB_BUILD_MAINT_OPTIONS:= hardening=+all,-pie
CXXFLAGS:= -fPIC $(shell dpkg-buildflags --get CXXFLAGS) # -std=c++14
# CFLAGS:= -fPIC $(shell dpkg-buildflags --get CFLAGS) 
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Set for build reproducibility
LC_ALL=C
export LC_ALL

LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
CMAKEDIR:=debian/tmp/$(LIBDIR)/cmake/magics

# Fixes for 32-bit archss
ARCH_32BIT:=   i386 armel armhf mipsel hppa hurd-i386 m68k powerpc sh4 x32
DO_ODB:= $(if $(filter $(DEB_TARGET_ARCH), $(ARCH_32BIT)),OFF,ON)

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

%:
	dh $@ --with-buildsystem=ecbuild

export extra_flags +=  \
	-DBUILD_SITE=debian \
	-DENABLE_LIBGD=1 \
	-DHAVE_BOOST=1 \
	-DENABLE_ODB=$(DO_ODB) \
	-DENABLE_EFAS=1 \
	-DHAVE_DLFCN_H=1 \
	-DHAVE_INTTYPES_H=1 \
	-DHAVE_LIBEXPAT=1 \
	-DHAVE_LIBPROJ=1 \
	-DHAVE_LIBPTHREAD=1 \
	-DHAVE_LIBZ=1 \
	-DHAVE_MEMORY_H=1 \
	-DHAVE_STDINT_H=1 \
	-DHAVE_STDLIB_H=1 \
	-DHAVE_STRINGS_H=1 \
	-DHAVE_STRING_H=1 \
	-DHAVE_SYS_STAT_H=1 \
	-DHAVE_STS_TYPES_H=1 \
	-DHAVE_UNISTD_H=1 \
	-DMAGICS_ALLHEADERS=1 \
	-DMAGICS_GRIB=1 \
	-DMAGICS_JSON=1 \
	-DMAGICS_GIF=1 \
	-DMAGICS_GIF_ANIMATED=1 \
	-DMAGICS_TIFF=1 \
	-DMAGICS_TTF=1 \
	-DMAGICS_TTF_PATH="share/magics/ttf/" \
	-DMAGICS_SITE="debian" \
	-DMAGICS_THREADS=1 \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_VERBOSE_MAKEFILE=ON \
	-DBUILD_DOCUMENTATION=ON \
	-DENABLE_FORTRAN=ON \
	-DENABLE_LARGE_FILE_SUPPORT=ON \
	-DBUILD_EXAMPLES=ON \
	-DBUILD_SHARED_LIBS=ON \
	-DENABLE_TESTS=ON \
	-DENABLE_GEOTIFF=ON \
	-DGEOTIFF_INCLUDE_DIR=/usr/include/geotiff \
	-DENABLE_RPATHS=OFF \
	-DENABLE_CAIRO=ON \
	-DENABLE_BUFR=ON \
	-DENABLE_GRIB=ON \
	-DENABLE_METVIEW=ON \
	-DENABLE_NETCDF=ON \
	-DCMAKE_C_FLAGS='$(CFLAGS) ' \
	-DCMAKE_CXX_FLAGS='$(CXXFLAGS) -I/usr/include/terralib -I/usr/include/terralib/kernel -I/usr/include/geotiff' \
	-DMAGICS_EXTRA_LIBRARIES='-lterralib -lgd -lemosR64' 

export LD_LIBRARY_PATH:=$(CURDIR)/debian/tmp/usr/lib:$(LD_LIBRARY_PATH)

override_dh_auto_clean:
	# remove Makefile: it attempts a Docker build from git ...
	rm -f Makefile
	rm -rf debian/build-py* build/*x
	rm -f bin/magjsonx  bin/magmlx  bin/metgramx
	find . -type l -delete
	find . -name '.DS_Store' -delete
	rm -f src/params/*.h src/decoders/*Attributes.h
	rm -rf share/magics/ttf src/terralib debian/build src/boost

override_dh_auto_configure:
	dh_auto_configure -- $(extra_flags)
	# link for font for tesing.
	mkdir -p share/fonts/truetype/ttf-dejavu/
	ln -sf /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf share/fonts/truetype/ttf-dejavu/
	# Link terralib
	[ -e src/terralib ] || ln -sf  /usr/include/terralib src/terralib

override_dh_auto_test check:
	# echo "Tests disabled; see README-testfailures.txt for details"
	#(ulimit -s 8192; export PYTHONPATH=$(CURDIR)/debian/build-py3/python/Magics ; \
	#	export MAGPLUS_HOME=$(CURDIR) ; $(MAKE) -C debian/build-py3  check )

override_dh_auto_install:
	dh_auto_install 
	# sed -i -e 's%$${_IMPORT_PREFIX}/${LIBDIR}%${LIBDIR}%g' $(CMAKEDIR)/magics-targets-none.cmake
	#sed -i -e 's%$${_IMPORT_PREFIX}/bin%/usr/bin%g'  $(CMAKEDIR)/magics-targets-none.cmake
	sed -i -e 's%${CURDIR}%/build/magics++%g'       $(CMAKEDIR)/magics-config.cmake 
	sed -i -e 's%${CURDIR}%/build/magics++%g'       $(CMAKEDIR)/magics-import.cmake 
	#sed -i -e 's%$${_IMPORT_PREFIX}/include/magics%/usr/include/magics%g' $(CMAKEDIR)/magics-targets.cmake
	sed -i -e 's%$${CURDIR}%/build/magics++%g' $(CMAKEDIR)/magics-import.cmake 
	-find debian/tmp/usr/bin -type f  -exec chrpath -d {} \;
	-find debian/tmp debian/libmagplus3v5   -name '*.so*' -exec chrpath -d {} \;

override_dh_makeshlibs:
	# For new symbols when compiled with GCC 7
	dh_makeshlibs -V'libmagplus3v5 (>= 2.34.1-2~)'