| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
include /usr/share/dpkg/pkg-info.mk |
| 5 |
|
| 6 |
# Uncomment this to turn on verbose mode. |
| 7 |
#export DH_VERBOSE=1 |
| 8 |
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 9 |
|
| 10 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 11 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 12 |
include /usr/share/dpkg/buildflags.mk |
| 13 |
|
| 14 |
# For automating the d/*.links stuff. |
| 15 |
export LIBPAPPSOMSPP_VERSION=$(DEB_VERSION_UPSTREAM) |
| 16 |
export LIBPAPPSOMSPP_SOVERSION=0 |
| 17 |
|
| 18 |
ifneq (,$(filter $(DEB_HOST_ARCH_CPU), i386)) |
| 19 |
export DEB_CXXFLAGS_MAINT_APPEND += -ffloat-store |
| 20 |
endif |
| 21 |
|
| 22 |
|
| 23 |
MAKE_TESTS=1 |
| 24 |
BUILD_TESTING=1 |
| 25 |
|
| 26 |
# In two different statements: |
| 27 |
# ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 28 |
# MAKE_TESTS=0 |
| 29 |
# BUILD_TESTING=0 |
| 30 |
# endif |
| 31 |
# |
| 32 |
# ifeq ($(DEB_BUILD_ARCH),s390x) |
| 33 |
# MAKE_TESTS=0 |
| 34 |
# BUILD_TESTING=0 |
| 35 |
# endif |
| 36 |
|
| 37 |
# In one single statement: |
| 38 |
ifneq (,$(or $(filter nocheck,$(DEB_BUILD_OPTIONS)), $(filter s390x,$(DEB_BUILD_ARCH)))) |
| 39 |
MAKE_TESTS=0 |
| 40 |
BUILD_TESTING=0 |
| 41 |
endif |
| 42 |
|
| 43 |
|
| 44 |
%: |
| 45 |
dh $@ --buildsystem=cmake --builddirectory=build-dir-for-deb --no-parallel |
| 46 |
|
| 47 |
override_dh_auto_configure: |
| 48 |
dh_auto_configure -- \ |
| 49 |
-DCMAKE_INSTALL_PREFIX=/usr \ |
| 50 |
-DCMAKE_BUILD_TYPE=Release \ |
| 51 |
-DCMAKE_SKIP_RPATH=0 \ |
| 52 |
-DUSEPAPPSOTREE=0 \ |
| 53 |
-DMAKE_TESTS=$(MAKE_TESTS) \ |
| 54 |
-DBUILD_TESTING=$(BUILD_TESTING) |
| 55 |
|
| 56 |
override_dh_auto_clean: |
| 57 |
dh_auto_clean |
| 58 |
rm -f tests/typst/data/*.json |
| 59 |
|
| 60 |
override_dh_makeshlibs: |
| 61 |
dh_makeshlibs -V 'libpappsomspp-core$(LIBPAPPSOMSPP_SOVERSION) (>= $(shell dpkg-parsechangelog -SVersion))' |
| 62 |
dh_makeshlibs -V 'libpappsomspp-gui$(LIBPAPPSOMSPP_SOVERSION) (>= $(shell dpkg-parsechangelog -SVersion))' |
| 63 |
|
| 64 |
override_dh_auto_build: |
| 65 |
dh_auto_build |
| 66 |
dh_auto_build -- doc |
| 67 |
|
| 68 |
override_dh_auto_test: |
| 69 |
if [ $(MAKE_TESTS) = 1 ]; then \ |
| 70 |
cd build-dir-for-deb && make catch2-tests; \ |
| 71 |
cd ../ && dh_auto_test; \ |
| 72 |
fi |