QGIS/debian/rules
Juergen E. Fischer cb16993d14 fix 0b1ba631b
2025-09-23 12:24:17 +10:00

597 lines
20 KiB
Makefile
Executable File

#!/usr/bin/make -f
# -*- makefile -*-
# custom DEB_BUILD_OPTIONS:
# oracle - build oracle provider
# apidoc - build api documentation
# pdal - build pdal provider
MAKEFLAGS += --warn-undefined-variables
DEB_TEST_TARGET ?= Experimental
QGIS_BUILDDIR ?= debian/build
export CCACHE_BASEDIR=$(CURDIR)
DIST ?=
SHA ?=
DISPLAY ?=
DEB_BUILD_OPTIONS ?=
# 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)
export QGIS_TEST_ACCEPT_GITSTATUS_CHECK_FAILURE=1
QGIS_VERSION=$(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//')
ifeq (,$(DIST))
DISTRIBUTION := $(DEB_DISTRIBUTION)
else
DISTRIBUTION := $(DIST)
endif
ifeq (,$(filter $(DISTRIBUTION),bookworm trixie noble plucky questing))
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 2>/dev/null|cut -d. -f1,2))
GRASSVER=$(subst .,,$(shell pkg-config --modversion grass 2>/dev/null|cut -d. -f1))
GRASSABI=$(subst .,,$(shell pkg-config --modversion grass 2>/dev/null|cut -d. -f1,2,3|sed -e 's/RC/-/'))
# multi distribution support:
# - remove lines with applicable excludes
# - remove prefixes with applicable includes
# - remove prefixes with not applicable excludes
# - remove remaining comments
CONTROL_EXPRESSIONS = $(DISTRIBUTION) grass$(GRASSVER)
shlibs :=
ifneq (,$(filter $(DISTRIBUTION),bookworm trixie noble plucky questing sid))
CONTROL_EXPRESSIONS += qt5
shlibs += -Xqgis-plugin-grass -Xlibqgis-customwidgets
ifneq (,$(filter $(DISTRIBUTION),bookworm noble))
CONTROL_EXPRESSIONS += webkit
endif
endif
# bookworm: no qca for qt6
# noble: sip errors
ifneq (,$(filter $(DISTRIBUTION),trixie plucky questing sid))
CONTROL_EXPRESSIONS += qt6
shlibs += -Xqgis-plugin-grass-qt6 -Xlibqgis-customwidgets-qt6
endif
ifeq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
ifeq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
$(error neither qt5 nor qt6)
endif
endif
ifneq (,$(filter $(DISTRIBUTION),trixie plucky questing sid))
CONTROL_EXPRESSIONS += sfcgal
endif
ifneq (,$(filter oracle,$(DEB_BUILD_OPTIONS)))
CONTROL_EXPRESSIONS += oracle
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
shlibs += -Xqgis-provider-oracle
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
shlibs += -Xqgis-provider-oracle-qt6
endif
endif
ifneq (,$(filter apidoc,$(DEB_BUILD_OPTIONS)))
CONTROL_EXPRESSIONS += apidoc
endif
ifneq (,$(filter pdal,$(DEB_BUILD_OPTIONS)))
CONTROL_EXPRESSIONS += pdal
ifeq ($(shell pkg-config --exists pdal && dpkg --compare-versions $$(pkg-config --modversion pdal) ge 2.5 && echo 1 || echo 0),1)
CONTROL_EXPRESSIONS += pdal_wrench
endif
endif
ifneq (,$(filter sfcgal,$(DEB_BUILD_OPTIONS)))
CONTROL_EXPRESSIONS += sfcgal
endif
define gentemplate
$(2): $(1)
rm -f $$@
sed -r \
-e '/#(.+ |)!($(subst $(subst ,, ),|,$(CONTROL_EXPRESSIONS)))( .+|)#/d' \
-e 's/#([^#]+ |)($(subst $(subst ,, ),|,$(CONTROL_EXPRESSIONS)))( [^#]+|)#//g' \
-e 's/#([^#]+ |)![^#]+( [^#]*|)#//g' \
-e '/^#/d' \
-e "s/\{DEB_BUILD_GNU_TYPE\}/$(DEB_BUILD_GNU_TYPE)/g" \
-e "s/\{QGIS_ABI\}/$(QGIS_ABI)/g" \
-e "s/\{GRASS\}/$(GRASS)/g" \
-e "s/\{GRASSVER\}/$(GRASSVER)/g" \
-e "s/\{GRASSVER_QGISABI\}/$(GRASSVER)-$(QGIS_ABI)/g" \
$$^ >$$@
templates:: $(2)
templateclean::
rm -f $(2)
endef
$(foreach t,$(shell find debian -maxdepth 1 \( -name "*.in" -o -name "*{QGIS_ABI}*" -o -name "*{GRASSVER_QGIS_ABI}*" \) -print),$(eval $(call gentemplate,$(t),$(patsubst %.in,%,$(subst {GRASSVER_QGIS_ABI},$(GRASSVER)-$(QGIS_ABI),$(subst {QGIS_ABI},$(QGIS_ABI),$(t)))))))
refreshtemplates:
$(MAKE) -f debian/rules templateclean
$(MAKE) -f debian/rules templates
# Include percentage of started edges
export NINJA_STATUS=[%f/%t %p]
ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
NINJA_OPTS += -v
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
NINJA_OPTS += -j$(NUMJOBS)
endif
ifeq (,$(DISPLAY))
TESTMAKE=xvfb-run -a -n 1 -s "-screen 0 1280x1024x24 -dpi 96" ninja $(NINJA_OPTS)
else
TESTMAKE=ninja $(NINJA_OPTS)
endif
PYTHON_LIBRARY=$(shell python3-config --ldflags --embed | sed -e 's,-L\(.*\) -L[^ ]* -l\([^ ]*\) .*$$,\1/lib\2.so,')
CMAKE_OPTS := \
-G Ninja \
-DBUILDNAME=$(DEB_BUILD_NAME) \
-DWITH_INTERNAL_NLOHMANN_JSON=OFF \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DPEDANTIC=TRUE \
-DSERVER_SKIP_ECW=TRUE \
-DQGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
-DWITH_CUSTOM_WIDGETS=TRUE \
-DWITH_SERVER=TRUE \
-DWITH_SERVER_PLUGINS=TRUE \
-DWITH_SERVER_LANDINGPAGE_WEBAPP=FALSE \
-DWITH_INTERNAL_MESHOPTIMIZER=FALSE \
-DWITH_INTERNAL_QWT=TRUE \
-DWITH_QUICK=TRUE \
-DPYTHON_LIBRARY=$(PYTHON_LIBRARY) \
-DDOXYGEN_ON_DEMAND=TRUE \
-DWITH_QSPATIALITE=TRUE \
-DWITH_3D=TRUE \
-DGEOS_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libgeos_c.so \
-DWITH_HANA=TRUE \
-DWITH_EPT=TRUE \
-DSUBMIT_URL="https://cdash.orfeo-toolbox.org/submit.php?project=QGIS" \
-DPUSH_TO_CDASH=TRUE
ifneq (,$(filter $(DISTRIBUTION),trixie plucky questing sid))
CMAKE_OPTS += -DWITH_INTERNAL_SPATIALINDEX=TRUE
endif
QT5_CMAKE_OPTS = \
-D BUILD_WITH_QT5=TRUE -D BUILD_WITH_QT6=FALSE -D WITH_QTWEBENGINE=OFF \
-D QGIS_INCLUDE_SUBDIR=include/qgis \
-D QT_PLUGINS_DIR=lib/$(DEB_BUILD_MULTIARCH)/qt5/plugins \
-D QGIS_QML_SUBDIR=share/qgis/qml
ifneq (,$(filter webkit,$(CONTROL_EXPRESSIONS)))
QT5_CMAKE_OPTS += \
-D WITH_QTWEBKIT=ON
endif
QT6_CMAKE_OPTS = \
-D QGIS_LIBEXEC_SUBDIR=lib/qgis-qt6 \
-D QGIS_PLUGIN_SUBDIR=lib/qgis-qt6/plugins \
-D QGIS_SERVER_MODULE_SUBDIR=lib/qgis-qt6/server \
-D QGIS_DATA_SUBDIR=share/qgis-qt6 \
-D QGIS_INCLUDE_SUBDIR=include/qgis-qt6 \
-D QGIS_QML_SUBDIR=share/qgis-qt6/qml \
-D QGISPOSTFIX=-qt6 \
-D QT_PLUGINS_DIR=lib/$(DEB_BUILD_MULTIARCH)/qt6/plugins \
ifneq ($(SHA),)
CMAKE_OPTS += -DSHA=$(SHA)
endif
ifneq (,$(filter $(GRASSVER),7 8))
CMAKE_OPTS += \
-DWITH_GRASS=TRUE \
-DWITH_GRASS$(GRASSVER)=TRUE \
-DGRASS_PREFIX$(GRASSVER)=/usr/lib/$(GRASS)
endif
ifneq (,$(filter $(DISTRIBUTION),trixie sid noble plucky questing))
CMAKE_OPTS += \
-DGDAL_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libgdal.so
endif
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
$(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
QT5_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
endif
ifneq (,$(filter apidoc,$(CONTROL_EXPRESSIONS)))
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
QT5_CMAKE_OPTS += -DWITH_APIDOC=TRUE -DGENERATE_QHP=TRUE
QT6_CMAKE_OPTS += -DWITH_APIDOC=OFF -DGENERATE_QHP=OFF
else
QT6_CMAKE_OPTS += -DWITH_APIDOC=TRUE -DGENERATE_QHP=TRUE
QT5_CMAKE_OPTS += -DWITH_APIDOC=OFF -DGENERATE_QHP=OFF
endif
else
CMAKE_OPTS += -DWITH_APIDOC=OFF -DGENERATE_QHP=OFF
endif
ifneq (,$(filter pdal,$(CONTROL_EXPRESSIONS)))
CMAKE_OPTS += -DWITH_PDAL=TRUE
else
CMAKE_OPTS += -DWITH_PDAL=FALSE
endif
ifneq (,$(filter sfcgal,$(CONTROL_EXPRESSIONS)))
CMAKE_OPTS += -DWITH_SFCGAL=TRUE
else
CMAKE_OPTS += -DWITH_SFCGAL=FALSE
endif
ifneq (,$(filter oracle,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_BUILD_ARCH),amd64)
ORACLE_INCLUDEDIR=$(wildcard /usr/include/oracle/*/client64/)
ORACLE_LIBDIR=$(wildcard /usr/lib/oracle/*/client64/lib/)
endif
ifeq ($(DEB_BUILD_ARCH),i386)
ORACLE_INCLUDEDIR=$(wildcard /usr/include/oracle/*/client/)
ORACLE_LIBDIR=$(wildcard /usr/lib/oracle/*/client/lib/)
endif
CMAKE_OPTS += \
-DWITH_ORACLE=TRUE \
-DORACLE_LIBDIR=$(ORACLE_LIBDIR) \
-DORACLE_INCLUDEDIR=$(ORACLE_INCLUDEDIR)
else
ORACLE_LIBDIR =
endif
ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
CMAKE_OPTS += -DCMAKE_BUILD_TYPE=Debug
endif
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
CMAKE_OPTS += -DENABLE_TESTS=FALSE
else
CMAKE_OPTS += -DENABLE_TESTS=TRUE -DDART_TESTING_TIMEOUT=60
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 (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
CXXFLAGS += -O0
else
CFLAGS += -O2
CXXFLAGS += -O2
endif
ifneq (,$(filter profile,$(DEB_BUILD_OPTIONS)))
CFLAGS += -pg
CXXFLAGS += -pg
LDFLAGS += -pg
endif
ifeq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -DNDEBUG
CXXFLAGS += -DNDEBUG
endif
binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep: templates
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
dh $@ --with python3 --parallel --builddirectory=$(QGIS_BUILDDIR)-qt5
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
dh $@ --with python3 --parallel --builddirectory=$(QGIS_BUILDDIR)-qt6
endif
override_dh_clean: refreshtemplates
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
dh_clean qgis.bin.1
-$(RM) -r $(CURDIR)/$(QGIS_BUILDDIR)-qt5/
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
dh_clean qgis-qt6.bin.1
-$(RM) -r $(CURDIR)/$(QGIS_BUILDDIR)-qt6/
endif
override_dh_auto_configure:
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
-$(RM) -r $(CURDIR)/$(QGIS_BUILDDIR)-qt5/
dh_auto_configure --builddirectory=$(QGIS_BUILDDIR)-qt5 -- $(CMAKE_OPTS) $(QT5_CMAKE_OPTS)
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
-$(RM) -r $(CURDIR)/$(QGIS_BUILDDIR)-qt6/
dh_auto_configure --builddirectory=$(QGIS_BUILDDIR)-qt6 -- $(CMAKE_OPTS) $(QT6_CMAKE_OPTS)
endif
override_dh_auto_build:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt5 $(DEB_TEST_TARGET)Build
! grep -q "<Error>" $(QGIS_BUILDDIR)-qt5/Testing/$$(head -1 $(QGIS_BUILDDIR)-qt5/Testing/TAG)/Build.xml || { \
cat $(QGIS_BUILDDIR)-qt5/Testing/Temporary/LastBuild_$$(head -1 $(QGIS_BUILDDIR)-qt5/Testing/TAG).log; \
ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt5 $(DEB_TEST_TARGET)Submit; \
false; }
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt6 $(DEB_TEST_TARGET)Build
! grep -q "<Error>" $(QGIS_BUILDDIR)-qt6/Testing/$$(head -1 $(QGIS_BUILDDIR)-qt6/Testing/TAG)/Build.xml || { \
cat $(QGIS_BUILDDIR)-qt6/Testing/Temporary/LastBuild_$$(head -1 $(QGIS_BUILDDIR)-qt6/Testing/TAG).log; \
ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt6 $(DEB_TEST_TARGET)Submit; \
false; }
endif
else
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt5
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt6
endif
endif
ifneq (,$(filter apidoc,$(CONTROL_EXPRESSIONS)))
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt5 apidoc
else
ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt6 apidoc
endif
endif
override_dh_auto_test: test-stamp
test-stamp:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# Code to run the package test suite
mkdir -p debian/tmp/locale/
localedef -f UTF-8 -i en_US ./debian/tmp/locale/en_US.UTF-8/
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
rm -f $(QGIS_BUILDDIR)-qt5/.error
LOCPATH=$(CURDIR)/debian/tmp/locale/ \
LC_ALL=en_US.UTF-8 \
LD_LIBRARY_PATH=$(CURDIR)/$(QGIS_BUILDDIR)-qt5/output/lib:$(LD_LIBRARY_PATH) \
PATH=/usr/sbin:$(PATH) \
$(TESTMAKE) -C $(QGIS_BUILDDIR)-qt5 $(DEB_TEST_TARGET)Test || touch $(QGIS_BUILDDIR)-qt5/.error
# ignore submission errors
-$(TESTMAKE) -C $(QGIS_BUILDDIR)-qt5 $(DEB_TEST_TARGET)Submit
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
rm -f $(QGIS_BUILDDIR)-qt6/.error
LOCPATH=$(CURDIR)/debian/tmp/locale/ \
LC_ALL=en_US.UTF-8 \
LD_LIBRARY_PATH=$(CURDIR)/$(QGIS_BUILDDIR)-qt6/output/lib:$(LD_LIBRARY_PATH) \
PATH=/usr/sbin:$(PATH) \
$(TESTMAKE) -C $(QGIS_BUILDDIR)-qt6 $(DEB_TEST_TARGET)Test || touch $(QGIS_BUILDDIR)-qt6/.error
# ignore submission errors
-$(TESTMAKE) -C $(QGIS_BUILDDIR)-qt6 $(DEB_TEST_TARGET)Submit
endif
# ignore the test outcome for now
# ! [ -f $(QGIS_BUILDDIR)-qt5/.error ]
# ! [ -f $(QGIS_BUILDDIR)-qt6/.error ]
else
@echo Skipping tests.
endif
touch test-stamp
override_dh_auto_install:
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
DESTDIR=$(CURDIR)/debian/tmp ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt5 install
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
DESTDIR=$(CURDIR)/debian/tmp ninja $(NINJA_OPTS) -C $(QGIS_BUILDDIR)-qt6 install
endif
# replace leaflet and jquery urls
perl -i -p \
-e 's#http://.*/leaflet.css#leaflet/leaflet.css#;s#http://.*/leaflet.js#leaflet/leaflet.js#;s#http://.*/jquery-.*.min.js#jquery-min.js#' \
$(CURDIR)/debian/tmp/usr/share/qgis/doc/developersmap.html
# 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*/resources/cpt-city-qgis-min/README-qgis.txt
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis*/resources/cpt-city-qgis-min/README.txt
$(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/share/qgis*/resources/wcs-servers.json
$(RM) $(CURDIR)/usr/share/qgis*/python/plugins/db_manager/README
$(RM) $(CURDIR)/debian/tmp/usr/bin/qgis_bench*
$(RM) $(CURDIR)/debian/tmp/usr/bin/test_provider_wcs*
$(RM) $(CURDIR)/debian/tmp/usr/bin/qgis_quickapp*
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/doc
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/resources
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/svg
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/i18n
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/grass
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/images
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/python/plugins
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/python/console
endif
# landing page not packaged
$(RM) $(CURDIR)/debian/tmp/usr/lib/qgis*/server/liblandingpage*.so
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis*/resources/server/src/landingpage
# 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
# qgis 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.xml
# qgis binaries info
install -m 755 -d $(CURDIR)/debian/qgis/usr/bin
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
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
install -m 755 -d $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/qt5/qml/QgsQuick
install -m 755 \
$(CURDIR)/debian/tmp/usr/share/qgis/qml/QgsQuick/libqgis_quick_plugin.so \
$(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/qt5/qml/QgsQuick/libqgis_quick_plugin.so
$(RM) \
$(CURDIR)/debian/tmp/usr/bin/qgis \
$(CURDIR)/debian/tmp/usr/bin/qgis_process \
$(CURDIR)/debian/tmp/usr/share/qgis/qml/QgsQuick/libqgis_quick_plugin.so
# qgis binary wrappers
sed -r \
-e "s/\{GRASS\}/$(GRASS)/g" \
-e "s#\{ORACLE_LIBDIR\}#$(ORACLE_LIBDIR)#g" \
-e "s#\{QGISPOSTFIX\}##g" \
$(CURDIR)/debian/qgis.sh.in >$(CURDIR)/debian/qgis.sh
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
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
install -m 755 $(CURDIR)/debian/tmp/usr/bin/qgis-qt6 $(CURDIR)/debian/qgis/usr/bin/qgis-qt6.bin
install -m 755 $(CURDIR)/debian/tmp/usr/bin/qgis_process-qt6 $(CURDIR)/debian/qgis/usr/bin/qgis_process-qt6.bin
install -m 755 -d $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/qt6/qml/QgsQuick
install -m 755 \
$(CURDIR)/debian/tmp/usr/share/qgis-qt6/qml/QgsQuick/libqgis_quick_plugin-qt6.so \
$(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/qt6/qml/QgsQuick/libqgis_quick_plugin.so
$(RM) \
$(CURDIR)/debian/tmp/usr/bin/qgis-qt6 \
$(CURDIR)/debian/tmp/usr/bin/qgis_process-qt6
# replaced by links
$(RM) -r $(CURDIR)/debian/tmp/usr/share/qgis-qt6/qml
# qgis binary wrappers
sed -r \
-e "s/\{GRASS\}/$(GRASS)/g" \
-e "s#\{ORACLE_LIBDIR\}#$(ORACLE_LIBDIR)#g" \
-e "s#\{QGISPOSTFIX\}#-qt6#g" \
$(CURDIR)/debian/qgis.sh.in >$(CURDIR)/debian/qgis.sh
install -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis/usr/bin/qgis-qt6
install -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis/usr/bin/qgis_process-qt6
sed -i \
-e "s#<binary>qgis</binary>#<binary>qgis-qt6</binary>#" \
$(CURDIR)/debian/tmp/usr/share/metainfo/org.qgis.qgis.appdata.xml \
>$(CURDIR)/debian/tmp/usr/share/metainfo/org.qgis.qgis-qt6.appdata.xml
sed -i \
-e "s#^TryExec=qgis\$$#TryExec=qgis-qt6#" \
-e "s#^Exec=qgis #Exec=qgis-qt6 #" \
$(CURDIR)/debian/tmp/usr/share/applications/org.qgis.qgis.desktop \
>$(CURDIR)/debian/tmp/usr/share/applications/org.qgis.qgis-qt6.desktop
endif
mkdir -p $(CURDIR)/debian/libqgis-dev
cd $(CURDIR)/debian/tmp && find . -name "*.sip" | tar --remove-files -cf - -T - | tar -C $(CURDIR)/debian/libqgis-dev -xf - --xform 's,\./usr/lib/python./dist-packages/qgis,usr/share/sip/qgis,'
find $(CURDIR)/debian/tmp/ -depth -empty -type d -delete
ifneq (,$(filter apidoc,$(CONTROL_EXPRESSIONS)))
# remove unwanted files
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/doc/api/installdox
endif
override_dh_missing:
dh_missing --fail-missing
override_dh_install:
dh_install --autodest
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
override_dh_installman:
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
cp qgis.1 qgis.bin.1
dh_installman -pqgis qgis.1 qgis.bin.1
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
cp qgis.1 qgis-qt6.bin.1
cp qgis.1 qgis-qt6.1
dh_installman -pqgis-qt6 qgis-qt6.1 qgis-qt6.bin.1
endif
override_dh_installmime:
ifneq (,$(filter qt5,$(CONTROL_EXPRESSIONS)))
dh_installmime -pqgis
endif
ifneq (,$(filter qt6,$(CONTROL_EXPRESSIONS)))
dh_installmime -pqgis-qt6
endif
override_dh_python3:
dh_python3
dh_python3 usr/share/qgis/grass/scripts
override_dh_compress:
dh_compress --exclude=pdf
override_dh_makeshlibs:
dh_makeshlibs $(shlibs) -- -c0 -v$(QGIS_VERSION)
override_dh_shlibdeps:
ifneq (,$(filter oracle,$(CONTROL_EXPRESSIONS)))
dh_shlibdeps -l/usr/lib/$(GRASS)/lib -l$(ORACLE_LIBDIR)
else
dh_shlibdeps -l/usr/lib/$(GRASS)/lib
endif
override_dh_gencontrol:
dh_gencontrol -- -Vgrass:Depends="grass$(GRASSABI)"