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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DPKG_GENSYMBOLS_CHECK_LEVEL=4
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
# Skip tests on mips64el. The QmlTests crash with segmentation fault at various
# places which makes one guess that there is something odd going on with the
# QmlTest test suite... No deeper motivation to hunt this down on an architecture
# where Lomiri et al. will probably never used on.
testskip_architectures :=
BUILDHOME=/tmp/home
%:
dh $@
apparmor:
aa-easyprof -m ./debian/morph-browser-apparmor.manifest --no-verify | \
egrep -v '(# Click packages|CLICK_DIR)' | \
sed 's/@{APP_PKGNAME}_@{APP_APPNAME}_@{APP_VERSION}/@{APP_PKGNAME}/g' | \
sed 's#/run/shm/\.org\.chromium\.Chromium\.\*#/{dev,run}/shm/.org.chromium.Chromium.*#g' | \
egrep -v 'deny /run/udev/data/\*\* r,' | \
sed 's#^}$$#\n /sys/class/ r,\n /sys/class/input/ r,\n /run/udev/data/** r,\n}#g' | \
egrep -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' | \
sed 's#^}$$#\n @{HOME}/@{XDG_DOWNLOAD_DIR}/** rwk,\n}#g' \
> ./debian/usr.bin.morph-browser
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
apparmor_parser -QTK ./debian/usr.bin.morph-browser
endif
override_dh_auto_configure:
dh_auto_configure --builddirectory=build-qt6 -- -DENABLE_QT6=ON -DENABLE_WERROR=OFF
dh_auto_configure --builddirectory=build-qt5 -- -DENABLE_WERROR=OFF
override_dh_auto_build:
dh_auto_build --builddirectory=build-qt6 ..
dh_auto_build --builddirectory=build-qt5 ..
override_dh_auto_install:
dh_auto_install --builddirectory=build-qt6 --destdir=debian/tmp-qt6 ..
dh_auto_install --builddirectory=build-qt5 --destdir=debian/tmp-qt5 ..
override_dh_install: apparmor
mv debian/tmp-qt5/usr/share/doc/morph-web debian/tmp-qt5/usr/share/doc/qml-module-morph-web
rmdir debian/tmp-qt5/usr/share/doc/qml-module-morph-web/html/images
install -D -m644 ./debian/usr.bin.morph-browser ./debian/tmp-qt5/etc/apparmor.d/usr.bin.morph-browser
#install -D -m644 ./debian/usr.bin.morph-browser ./debian/tmp-qt6/etc/apparmor.d/usr.bin.morph-browser
dh_install -Nmorph-browser-qt6 -Nqml6-module-morph-web --sourcedir=debian/tmp-qt5
dh_install -pmorph-browser-qt6 -pqml6-module-morph-web --sourcedir=debian/tmp-qt6
override_dh_missing:
dh_missing --fail-missing
override_dh_installdeb:
dh_apparmor --profile-name=usr.bin.morph-browser -pmorph-browser
dh_installdeb
override_dh_auto_clean:
dh_auto_clean --builddirectory=build-qt6
dh_auto_clean --builddirectory=build-qt5
override_dh_clean:
dh_clean
rm -rf $(BUILDHOME)
override_dh_auto_test:
mkdir -p $(BUILDHOME)
ifneq (,$(filter $(DEB_HOST_ARCH),$(testskip_architectures)))
HOME=$(BUILDHOME) dh_auto_test --no-parallel -- ARGS+=-VV
else
# FIXME: Temporarily ignore unit test failures on testskip_architectures
-HOME=$(BUILDHOME) dh_auto_test --no-parallel -- ARGS+=-VV
endif
include /usr/share/dpkg/pkg-info.mk
PKD = $(word 1,$(abspath $(dir $(MAKEFILE_LIST))))
PKG = $(DEB_SOURCE)
UVER = $(shell echo $(DEB_VERSION) | cut -d "-" -f1)
DTYPE = +dfsg
VER ?= $(subst $(DTYPE),,$(UVER))
UURL = https://gitlab.com/ubports/development/core/morph-browser.git
UREV = $(shell echo $(VER) | cut -d"." -f4)
## http://wiki.debian.org/onlyjob/get-orig-source
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
@
$(PKG)_$(VER)$(DTYPE).orig.tar.xz: $(info I: GIT Revision=$(UREV))
$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
@echo "# Downloading..."
git clone $(UURL) $(PKG)-$(VER) \
|| $(RM) -r $(PKG)-$(VER)
cd $(PKG)-$(VER) \
&& git checkout "$(UREV)" \
&& ( echo "# Generating ChangeLog..." \
; git --no-pager log --format="%ai %aN (%h) %n%n%x09*%w(68,0,10) %s%n" > ChangeLog \
; touch -d "$$(git log -1 --format='%ci')" ChangeLog) \
&& echo "# Setting times..." \
&& for F in $$(git ls-tree -r --name-only HEAD); do touch --no-dereference -d "$$(git log -1 --format="%ai" -- $$F)" "$$F"; done \
&& echo "# Cleaning-up..." \
&& rm -rf debian \
&& rm -rf src/Ubuntu \
&& rm -rf tests/autopilot \
&& rm -rf .git .git*
@echo "# Packing..."
find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
| XZ_OPT="-6v" tar -caf "../$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
&& $(RM) -r "$(PKG)-$(VER)"
|