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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_PYTHON_INSTALL_LAYOUT=deb_system
include /usr/share/dpkg/pkg-info.mk
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
QGIS_BUILDDIR ?= debian/build
export QT_SELECT=5
QGIS_VERSION=$(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//')
ifeq (,$(DIST))
DISTRIBUTION := $(DEB_DISTRIBUTION)
else
DISTRIBUTION := $(DIST)
endif
QT_PLUGINS_DIR = lib/$(DEB_BUILD_MULTIARCH)/qt5/plugins
ifneq ($(DISTRIBUTION),$(findstring $(DISTRIBUTION),"bullseye focal jammy"))
DISTRIBUTION := sid
endif
DEB_BUILD_NAME ?= $(DISTRIBUTION)-$(DEB_BUILD_ARCH)
QGIS_MAJOR=$(shell sed -ne 's/SET(CPACK_PACKAGE_VERSION_MAJOR "\([0-9]*\)")/\1/ip' CMakeLists.txt)
QGIS_MINOR=$(shell sed -ne 's/SET(CPACK_PACKAGE_VERSION_MINOR "\([0-9]*\)")/\1/ip' CMakeLists.txt)
QGIS_PATCH=$(shell sed -ne 's/SET(CPACK_PACKAGE_VERSION_PATCH "\([0-9]*\)")/\1/ip' CMakeLists.txt)
QGIS_ABI=$(QGIS_MAJOR).$(QGIS_MINOR).$(QGIS_PATCH)
GRASS=grass$(subst .,,$(shell pkg-config --modversion grass|cut -d. -f1,2))
GRASSVER=$(subst .,,$(shell pkg-config --modversion grass|cut -d. -f1))
GRASSABI=$(subst .,,$(shell pkg-config --modversion grass|cut -d. -f1,2,3|sed -e 's/RC/-/'))
# Include percentage of started edges
export NINJA_STATUS=[%f/%t %p]
CMAKE_OPTS := \
-G Ninja \
-DBUILDNAME=$(DEB_BUILD_NAME) \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBINDINGS_GLOBAL_INSTALL=TRUE \
-DSIP_GLOBAL_INSTALL=TRUE \
-DPEDANTIC=TRUE \
-DSERVER_SKIP_ECW=TRUE \
-DQGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
-DWITH_APIDOC=TRUE \
-DGENERATE_QHP=TRUE \
-DWITH_CUSTOM_WIDGETS=TRUE \
-DWITH_INTERNAL_NLOHMANN_JSON=OFF \
-DWITH_SERVER=TRUE \
-DWITH_SERVER_PLUGINS=TRUE \
-DWITH_QSPATIALITE=TRUE \
-DWITH_QTWEBKIT=FALSE \
-DWITH_QWTPOLAR=FALSE \
-DWITH_3D=TRUE \
-DGEOS_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libgeos_c.so \
-DWITH_HANA=TRUE \
-DWITH_PDAL=FALSE \
-DWITH_EPT=TRUE \
-DWITH_DRACO=FALSE \
-DPython_FIND_UNVERSIONED_NAMES=FIRST \
-DQT_PLUGINS_DIR=$(QT_PLUGINS_DIR)
ifneq ($(SHA),)
CMAKE_OPTS += -DSHA=$(SHA)
endif
ifneq (,$(findstring ;$(GRASSVER);, ";7;8;"))
CMAKE_OPTS += \
-DWITH_GRASS=TRUE \
-DWITH_GRASS$(GRASSVER)=TRUE \
-DGRASS_PREFIX$(GRASSVER)=/usr/lib/$(GRASS)
endif
$(shell test -f /usr/include/$(DEB_BUILD_MULTIARCH)/qt5/Qt3DExtras/qt3dextrasversion.h -a -f /usr/lib/$(DEB_BUILD_MULTIARCH)/cmake/Qt53DExtras/Qt53DExtrasConfig.cmake)
ifneq (0,$(.SHELLSTATUS))
# Qt3DExtras intentionally removed from debian (#895386) and in turn ubuntu
CMAKE_OPTS += \
-DQt53DExtras_DIR=$(realpath external/qt3dextra-headers/cmake/Qt53DExtras) \
-DQT5_3DEXTRA_INCLUDE_DIR=$(realpath external/qt3dextra-headers) \
-DQT5_3DEXTRA_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libQt53DExtras.so
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CMAKE_OPTS += -DCMAKE_BUILD_TYPE=Debug
endif
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
CXXFLAGS += -O0
else
CFLAGS += -O2
CXXFLAGS += -O2
endif
ifneq (,$(findstring profile,$(DEB_BUILD_OPTIONS)))
CFLAGS += -pg
CXXFLAGS += -pg
LDFLAGS += -pg
endif
ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -DNDEBUG
CXXFLAGS += -DNDEBUG
endif
ifeq ($(DEB_BUILD_ARCH),mips64el)
CXXFLAGS += -mxgot
endif
%:
dh $@ --builddirectory=$(QGIS_BUILDDIR) --buildsystem=cmake+ninja
execute_after_dh_clean:
-$(RM) -r $(CURDIR)/$(QGIS_BUILDDIR)/
override_dh_auto_configure:
dh_auto_configure -- $(CMAKE_OPTS)
override_dh_auto_test:
@echo Skipping tests.
execute_after_dh_auto_install:
# remove unwanted files
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/doc/api/installdox
# Don't include a copy of the world.tif also included in osgearth-data
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/globe/world.tif
# remove extra license files
-find $(CURDIR)/debian/tmp/usr/share/qgis/resources/cpt-city-qgis-min/ -name COPYING.xml -delete
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/doc/LICENSE
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/python/plugins/db_manager/LICENSE
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/python/plugins/MetaSearch/LICENSE.txt
$(RM) $(CURDIR)/debian/tmp/usr/bin/qgis_bench
$(RM) $(CURDIR)/debian/tmp/usr/bin/test_provider_wcs
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/resources/wcs-servers.json
# remove documentation outside usr/share/doc
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/python/plugins/db_manager/README
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/python/plugins/db_manager/TODO
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/resources/cpt-city-qgis-min/README-qgis.txt
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/resources/cpt-city-qgis-min/README.txt
# Man pages are installed by dh_installman
$(RM) $(CURDIR)/debian/tmp/usr/man/man1/qgis.1
# Don't ship srs.db, automatically updated in postinst with crssync
mv $(CURDIR)/debian/tmp/usr/share/qgis/resources/srs.db $(CURDIR)/debian/tmp/usr/share/qgis/resources/srs-template.db
# Mime info
install -d $(CURDIR)/debian/tmp/usr/share/mime/packages
install -m 644 $(CURDIR)/debian/qgis.xml $(CURDIR)/debian/tmp/usr/share/mime/packages
# qgis binaries
install -m 755 -d $(CURDIR)/debian/qgis/usr/bin
install -m 755 $(CURDIR)/debian/tmp/usr/bin/qgis $(CURDIR)/debian/qgis/usr/bin/qgis.bin
install -m 755 $(CURDIR)/debian/tmp/usr/bin/qgis_process $(CURDIR)/debian/qgis/usr/bin/qgis_process.bin
$(RM) $(CURDIR)/debian/tmp/usr/bin/qgis $(CURDIR)/debian/tmp/usr/bin/qgis_process
# qgis binary wrappers
install -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis/usr/bin/qgis
install -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis/usr/bin/qgis_process
# default options for wrappers
install -m 755 -d $(CURDIR)/debian/qgis/etc/default
install -m 644 $(CURDIR)/debian/qgis.default $(CURDIR)/debian/qgis/etc/default/qgis
mkdir -p $(CURDIR)/debian/qgis-sip
cd $(CURDIR)/debian/tmp && find . -name "*.sip" | tar --remove-files -cf - -T - | tar -C $(CURDIR)/debian/qgis-sip -xf - --xform 's,\./usr/lib/python./dist-packages/qgis,usr/share/sip/qgis,'
find $(CURDIR)/debian/tmp/ -depth -empty -type d -delete
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
override_dh_installman:
cp qgis.1 qgis.bin.1
dh_installman -pqgis qgis.1 qgis.bin.1
override_dh_installmime:
dh_installmime -pqgis
override_dh_python3:
dh_python3 --shebang=/usr/bin/python3
dh_python3 --shebang=/usr/bin/python3 /usr/share/qgis/grass/scripts
dh_python3 --shebang=/usr/bin/python3 /usr/share/qgis/python
override_dh_compress:
dh_compress --exclude=pdf
override_dh_makeshlibs:
dh_makeshlibs -Xqgis-plugin-grass -Xlibqgis-customwidgets -- -c0 -v$(QGIS_VERSION)
override_dh_shlibdeps:
dh_shlibdeps -l/usr/lib/$(GRASS)/lib
override_dh_gencontrol:
dh_gencontrol -- -Vgrass:Depends="grass$(GRASSABI)"
|