File: rules

package info (click to toggle)
gdal 3.6.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 89,664 kB
  • sloc: cpp: 1,136,033; ansic: 197,355; python: 35,910; java: 5,511; xml: 4,011; sh: 3,950; cs: 2,443; yacc: 1,047; makefile: 288
file content (144 lines) | stat: -rwxr-xr-x 4,098 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
#!/usr/bin/make -f
# -*- makefile -*-
#
# Original debian package by Alessandro Amici 2002-2003.
# Currently maintained by DebianGis contributors.
# Based on: GNU copyright 1997 to 1999 by Joey Hess.

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

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/pkg-info.mk

UPSTREAM_VERSION = $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//')

PYVERS=$(shell py3versions -sv)
PYDEF=$(shell py3versions -dv)
SWIGVER=$(shell swig -version |grep Version|cut -d' ' -f3|sed -e 's/\.//g')

GDALVER=$(shell cat VERSION|sed -e 's/\./ /g')
GDAL_MAJOR=$(word 1,$(GDALVER))
GDAL_MINOR=$(word 2,$(GDALVER))
GDAL_PATCH=$(word 3,$(GDALVER))

ifeq (,$(DEB_HOST_MULTIARCH))
  DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
endif

# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98189
ifneq (,$(filter $(DEB_HOST_ARCH),sh3 sh4))
  export DEB_CXXFLAGS_MAINT_APPEND=-fno-guess-branch-probability
endif

versions:
	@echo Gdal version: $(GDAL_MAJOR).$(GDAL_MINOR).$(GDAL_PATCH)
	@echo Swig version: $(SWIGVER)
	@echo Python default: $(PYDEF)
	@echo Python versions: $(PYVERS)

%:
	dh $@ --with python3,numpy3,pkgkde_symbolshelper --buildsystem cmake

override_dh_auto_clean:
	for V in $(PYVERS); do \
		dh_auto_clean --builddir=build-py$$V ; \
	done

override_dh_auto_configure:
	for V in $(PYVERS); do \
		dh_auto_configure --builddir=build-py$$V -- \
			-DPython_LOOKUP_VERSION=$$V \
			-DBUILD_DOCS=OFF \
			-DBUILD_PYTHON_BINDINGS:BOOL=ON \
			-DCMAKE_INSTALL_INCLUDEDIR=include/gdal \
			-DGDAL_HIDE_INTERNAL_SYMBOLS=ON \
			-DRENAME_INTERNAL_TIFF_SYMBOLS=ON \
			-DRENAME_INTERNAL_GEOTIFF_SYMBOLS=ON \
			-DGDAL_USE_ARMADILLO=ON \
			-DGDAL_USE_BLOSC=ON \
			-DGDAL_USE_CFITSIO=ON \
			-DGDAL_USE_CURL=ON \
			-DGDAL_USE_DEFLATE=ON \
			-DGDAL_USE_ECW=OFF \
			-DGDAL_USE_EXPAT=ON \
			-DGDAL_USE_FREEXL=ON \
			-DGDAL_USE_FYBA=ON \
			-DGDAL_USE_GEOS=ON \
			-DGDAL_USE_GEOTIFF=ON \
			-DGDAL_USE_HDF5=ON \
			-DGDAL_USE_HEIF=ON \
			-DGDAL_USE_JSONC=ON \
			-DGDAL_USE_LERC_INTERNAL=ON \
			-DGDAL_USE_LIBKML=ON \
			-DGDAL_USE_LIBLZMA=ON \
			-DGDAL_USE_LZ4=ON \
			-DGDAL_USE_MRSID=OFF \
			-DGDAL_USE_MYSQL=ON \
			-DGDAL_USE_NETCDF=ON \
			-DGDAL_USE_ODBC=ON \
			-DGDAL_USE_OGDI=ON \
			-DGDAL_USE_OPENCAD_INTERNAL=ON \
			-DGDAL_USE_OPENJPEG=ON \
			-DGDAL_USE_PCRE2=ON \
			-DGDAL_USE_POPPLER=ON \
			-DGDAL_USE_POSTGRESQL=ON \
			-DGDAL_USE_QHULL=ON \
			-DGDAL_USE_SPATIALITE=ON \
			-DGDAL_USE_SQLITE3=ON \
			-DGDAL_USE_TIFF=ON \
			-DGDAL_USE_WEBP=ON \
			-DGDAL_USE_XERCESC=ON \
			-DGDAL_USE_ZSTD=ON \
		; \
	done

override_dh_auto_build:
	for V in $(PYVERS); do \
		dh_auto_build --builddir=build-py$$V ; \
	done

override_dh_auto_test:
	for V in $(PYVERS); do \
		dh_auto_test --builddir=build-py$$V ; \
	done

override_dh_auto_install:
	for V in $(PYVERS); do \
		dh_auto_install --builddir=build-py$$V ; \
	done

	# install man pages
	install -d $(CURDIR)/debian/tmp/usr/share/man/man1
	install -m 644 $(CURDIR)/man/man1/*.1 $(CURDIR)/debian/tmp/usr/share/man/man1

	# removing useless autogenerated man pages
	rm -f $(CURDIR)/debian/tmp/usr/share/man/man1/_*_apps_.1

	# removing license file
	rm -f $(CURDIR)/debian/tmp/usr/share/gdal/LICENSE.TXT

	# removing embedded rpath in main lib
	-find $(CURDIR)/debian/tmp/usr/lib -type f -name "*.so*" -exec chrpath --delete {} \;

	# copy sample programs for python3-gdal
	install -d $(CURDIR)/debian/tmp/usr/share/doc/python3-gdal/examples
	install -m 644 $(CURDIR)/swig/python/gdal-utils/osgeo_utils/samples/*.py $(CURDIR)/debian/tmp/usr/share/doc/python3-gdal/examples/.
	rm -f $(CURDIR)/debian/tmp/usr/share/doc/python3-gdal/examples/__init__.py

override_dh_installchangelogs:
	dh_installchangelogs NEWS.md

override_dh_installdocs:
	dh_installdocs -A third_party/LercLib/NOTICE

override_dh_python3:
	dh_python3 -X.info -pgdal-bin -ppython3-gdal --shebang=/usr/bin/python3

override_dh_numpy3:
	dh_numpy3 -pgdal-bin -ppython3-gdal

override_dh_makeshlibs:
	dh_makeshlibs -- -c0 -v$(UPSTREAM_VERSION)