File: rules

package info (click to toggle)
magics++ 2.30.0-5
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 105,040 kB
  • ctags: 32,903
  • sloc: cpp: 185,631; xml: 18,565; ansic: 11,002; perl: 6,357; python: 4,065; sh: 802; f90: 278; asm: 271; makefile: 157
file content (146 lines) | stat: -rwxr-xr-x 5,095 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/usr/bin/make -f

export DH_VERBOSE=1

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

# Set for build reproducibility
LC_ALL=C
export LC_ALL

export QT_SELECT=5

LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
AUTOGENERATED:= libmagplus3v5.links libmagics++-dev.links libmagplus3v5.install
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

%:
	dh $@ --parallel --with python2,python3 --with-buildsystem=cmake

# To fix cmake output change these
OLD_GF_PATH=$(shell gfortran -print-search-dirs | grep install | cut -f2 -d' '  )libgfortran.so
NEW_GF_PATH:=$(LIBDIR)/libgfortran.so.3

# -DCMAKE_PREFIX_PATH=${LIBDIR}/cmake/grib_api \

export extra_flags +=  \
	-DBUILD_SITE=debian \
	-DENABLE_LIBGD=1 \
	-DHAVE_BOOST=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_METVIEW=1 \
	-DMAGICS_GIF=1 \
	-DMAGICS_GIF_ANIMATED=1 \
	-DMAGICS_TIFF=1 \
	-DMAGICS_TTF=1 \
	-DMAGICS_TTF_PATH="share/magics/ttf/" \
	-DMAGICS_SITE="debian" \
	-DMAGICS_PYTHON=1 \
	-DMAGICS_THREADS=1 \
	-DDISABLE_OS_CHECK=ON \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_VERBOSE_MAKEFILE=ON \
	-DBUILD_DOCUMENTATION=ON \
	-DENABLE_FORTRAN=ON \
	-DENABLE_LARGE_FILE_SUPPORT=ON \
	-DENABLE_PYTHON=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_QT5=ON \
	-DENABLE_NETCDF=ON \
	-DCMAKE_CXX_FLAGS='$(CXXFLAGS) -I/usr/include/terralib -I/usr/include/terralib/kernel' \
	-DMAGICS_EXTRA_LIBRARIES='-lterralib -lgd -lemosR64' 

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

override_dh_auto_clean:
	rm -rf debian/build-py*
	rm -f bin/magjsonx  bin/magmlx  bin/metgramx
	find . -type l -delete
	rm -f src/params/*.h src/decoders/*Attributes.h
	rm -rf share/magics/ttf src/terralib debian/build
	rm -f $(patsubst %, debian/%, ${AUTOGENERATED})

override_dh_auto_configure:
	# 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
	for f in ${AUTOGENERATED} ; do \
                sed -e 's%@ARCH@%${DEB_HOST_MULTIARCH}%g' < debian/$$f.in  > debian/$$f ; \
                done
	dh_auto_configure --builddirectory=debian/build-py3 -- \
		-DPYTHON_EXECUTABLE=/usr/bin/python3 \
	       	$(extra_flags) 
	dh_auto_configure --builddirectory=debian/build-py2 -- \
		-DPYTHON_EXECUTABLE=/usr/bin/python \
	       	$(extra_flags) 
	(cd python/Magics && ln -s $(CURDIR)/debian/build-py3/python/Magics/Magics.i )

override_dh_auto_build:
	dh_auto_build  --builddirectory=debian/build-py2
	dh_auto_build  --builddirectory=debian/build-py3

override_dh_auto_test check:
	# echo "Tests disabled; see README-testfailures.txt for details"
	# (ulimit -s 8192; export PYTHONPATH=$(CURDIR)/debian/build-py2/python/Magics ; \
	#	export MAGPLUS_HOME=$(CURDIR) ; $(MAKE) -C debian/build-py2  check )
	#(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:
	(cd  debian/build-py2/python && python2 ./setup.py install --prefix=$(CURDIR)/debian/tmp/usr )
	(cd  debian/build-py3/python && python3 ./setup.py install --prefix=$(CURDIR)/debian/tmp/usr )
	dh_auto_install --builddirectory=debian/build-py3
	# Move lib stuff
	mkdir -p debian/tmp/$(LIBDIR)
	cp -a debian/tmp/usr/lib/*.a debian/tmp/usr/lib/pkgconfig debian/tmp/$(LIBDIR)
	cp debian/tmp/usr/lib/libMagPlus.so debian/tmp/$(LIBDIR)/libMagPlus.so.3.0.0
	# Fixup the cmake files.
	mkdir -p debian/tmp/$(LIBDIR)/cmake/magics
	cp -a debian/tmp/usr/share/magics/cmake/* debian/tmp/$(LIBDIR)/cmake/magics
	sed -e 's%$${_IMPORT_PREFIX}/lib%$(LIBDIR)%' \
		< debian/tmp/usr/share/magics/cmake/magics-targets-none.cmake \
	| sed -e 's%$${_IMPORT_PREFIX}/bin%/usr/bin%' \
	| sed -e 's%$(OLD_GF_PATH)%$(NEW_GF_PATH)%'   \
		> debian/tmp/$(LIBDIR)/cmake/magics/magics-targets-none.cmake
	rm -r debian/tmp/usr/share/magics/cmake
	dh_python2 /usr/lib/python2.7/site-packages/Magics
	dh_python3 /usr/lib/python3*/site-packages/Magics
	dh_numpy -p python-magics++
	dh_numpy3 -p python3-magics++
	-find debian/tmp/usr/bin -type f  -exec chrpath -d {} \;
	-find debian/tmp debian/libmagplus3v5   -name '*.so*' -exec chrpath -d {} \;

override_dh_fixperms-arch:
	dh_fixperms
	find debian/tmp debian/python*-magics++   -name '*.so*' -exec chrpath -d {} \;