#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk export DPKG_GENSYMBOLS_CHECK_LEVEL=1 include /usr/share/dpkg/architecture.mk # Skip tests on the archs they are known to be flaky with current configuration # Ref.: https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/1585942 testskip_architectures := s390x powerpc ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) CONFIGURE_OPTS += -DENABLE_TESTS=OFF endif ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) DEB_BUILD_PROFILES += cross endif %: dh $@ apparmor: aa-easyprof -m ./debian/lomiri-messaging-app-apparmor.manifest --no-verify | \ grep -E -v '(# Click packages|CLICK_DIR)' | \ sed 's/@{APP_PKGNAME}_@{APP_APPNAME}_@{APP_VERSION}/@{APP_PKGNAME}/g' | \ sed 's,Apps/@{APP_PKGNAME},Apps/lomiri-messaging-app,g' | \ sed '/dconf.user rw/c\ \/run\/user\/\[0-9\]*\/dconf\/user rw,' | \ sed 's,deny owner .*dconf/user r,owner @\{HOME\}/.config/dconf/user r,g' | \ grep -E -v 'deny /run/udev/data/\*\* r,' | \ sed 's#^}$$#\n /sys/class/ r,\n /sys/class/input/ r,\n /run/udev/data/** r,\n}#g' | \ grep -E -v '^\s*deny /dev/ r,\s*$$' | \ sed 's#^\(\s*\)deny\(\s\+/{run,dev}/shm/pulse-shm\*\s\+w,\).*$$#\1owner\2#g' | \ sed 's#^}$$#\n /dev/dri/ r,\n /sys/devices/pci[0-9]*/**/config r,\n}#g' \ > ./debian/usr.bin.lomiri-messaging-app (head -n -2 ./debian/usr.bin.lomiri-messaging-app; cat ./debian/lomiri-messaging-app-apparmor.additions; \ echo } ) > ./debian/usr.bin.lomiri-messaging-app2 mv ./debian/usr.bin.lomiri-messaging-app2 ./debian/usr.bin.lomiri-messaging-app ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) apparmor_parser -QTK ./debian/usr.bin.lomiri-messaging-app endif override_dh_auto_install: dh_auto_install # remove autopilot files rm -rf debian/lomiri-messaging-app/usr/lib/python3/ rmdir debian/lomiri-messaging-app/usr/lib/ override_dh_install: # apparmor dh_install override_dh_installdeb: # dh_apparmor --profile-name=usr.bin.lomiri-messaging-app -plomiri-messaging-app dh_installdeb override_dh_auto_configure: dh_auto_configure -- \ $(CONFIGURE_OPTS) override_dh_auto_test: # python3 -m flake8 tests/autopilot/lomiri_messaging_app/ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) ifneq (,$(filter $(DEB_HOST_ARCH),$(testskip_architectures))) -dh_auto_test else dh_auto_test endif endif override_dh_translations: # Override dh_translations to work around http://pad.lv/1183262. # Unfortunately, the default build directory is not exposed # (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601774). $(MAKE) -C obj-$(DEB_HOST_GNU_TYPE) lomiri-messaging-app.pot get-orig-source: uscan --noconf --force-download --rename --download-current-version --destdir=..