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
|
#!/usr/bin/make -f
ifeq (,$(filter terse,${DEB_BUILD_OPTIONS}))
export DH_VERBOSE=1
export V=1
export VERBOSE=1
endif
LC_ALL:=C.UTF-8
export LC_ALL
shellescape='$(subst ','\'',$(1))'
shellexport=$(1)=$(call shellescape,${$(1)})
DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS?=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
include /usr/share/dpkg/pkg-info.mk
OUR_VSN:=${DEB_VERSION} ($(shell lsb_release -si) $(shell lsb_release -sc)/${DEB_HOST_ARCH})
OUR_CPPFLAGS:=
OUR_CFLAGS:=
OUR_CXXFLAGS:=
OUR_LDFLAGS:=
# branding and avoid -Wdate-time (reproducible builds)
OUR_CPPFLAGS+= -DANTIMICROX_PKG_VERSION=\"$(call shellescape,${OUR_VSN})\"
# unclutter build log; these are upstream’s to fix
OUR_CFLAGS+= -Wno-deprecated-declarations
OUR_CXXFLAGS+= -Wno-deprecated-declarations
OUR_CXXFLAGS+= -Wno-deprecated-copy
# only needed when backporting to buster and older
#OUR_LDFLAGS+= -Wl,--as-needed
# better debugging if requested
ifneq (,$(findstring optdbg,${DEB_BUILD_OPTIONS}))
OUR_CFLAGS+= -Og
OUR_CXXFLAGS+= -Og
endif
dpkgbuildflagsmkescape=$(subst \,\\\,$(1))
export DEB_BUILD_MAINT_OPTIONS:=hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CPPFLAGS})
export DEB_CFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CFLAGS})
export DEB_CXXFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CXXFLAGS})
export DEB_LDFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_LDFLAGS})
include /usr/share/dpkg/buildflags.mk
ifneq (,$(wildcard /usr/share/dpkg/buildtools.mk))
include /usr/share/dpkg/buildtools.mk
endif
%:
dh $@ --buildsystem=cmake
CMAKE_DEFS:= -DCMAKE_SKIP_RPATH=ON
CMAKE_DEFS+= -DUPDATE_TRANSLATIONS=ON
# https://github.com/AntiMicroX/antimicrox/issues/138
CMAKE_DEFS+= -DWITH_TESTS=OFF
CMAKE_DEFS+= -DAPPDATA=ON
ifeq (linux,${DEB_HOST_ARCH_OS})
CMAKE_DEFS+= -DWITH_UINPUT=ON
else
CMAKE_DEFS+= -DWITH_UINPUT=OFF
endif
CMAKE_DEFS+= -DWITH_X11=ON
CMAKE_DEFS+= -DWITH_XTEST=ON
override_dh_auto_configure:
exec dh_auto_configure -- ${CMAKE_DEFS}
execute_after_dh_auto_install:
# https://github.com/AntiMicroX/antimicrox/issues/87#issuecomment-770516939
rm -rf debian/antimicro/usr/include
# https://github.com/AntiMicroX/antimicrox/issues/87#issuecomment-770515628
rm -rf debian/antimicro/usr/share/doc/antimicrox
rm -f debian/antimicro/usr/share/antimicrox/CHANGELOG.md
override_dh_installchangelogs:
dh_installchangelogs -- CHANGELOG.md
|