File: rules

package info (click to toggle)
qtpim-opensource-src 5.0~git20190618.8fec622c+dfsg1-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 15,028 kB
  • sloc: cpp: 82,576; ansic: 245; xml: 91; makefile: 80; javascript: 67
file content (111 lines) | stat: -rwxr-xr-x 4,754 bytes parent folder | download
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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

NULL =

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

include /usr/share/dpkg/architecture.mk

export QT_SELECT := qt5

%:
	dh $@ --with pkgkde_symbolshelper

override_dh_auto_build:
	dh_auto_build
	make docs

override_dh_missing:
	dh_missing --fail-missing

override_dh_auto_clean:
	dh_auto_clean
	rm -f plugins/*/*.so
	rm -f qml/*/*.so

override_dh_auto_configure:
	dh_auto_configure -- QT_BUILD_PARTS+=tests

override_dh_auto_build-indep:
	dh_auto_build -Smakefile -- docs

override_dh_auto_install:
	dh_auto_install
	$(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install_docs
	
	# Remove private stuff
	rm -rfv debian/tmp/usr/include/*/qt5/QtContacts/*/QtContacts/private/
	rm -rfv debian/tmp/usr/include/*/qt5/QtOrganizer/*/QtOrganizer/private/
	rm -rfv debian/tmp/usr/include/*/qt5/QtVersit/*/QtVersit/private/
	rm -rfv debian/tmp/usr/include/*/qt5/QtVersitOrganizer/*/QtVersitOrganizer/private/
	rm -fv $(CURDIR)/debian/tmp/usr/lib/*/qt5/mkspecs/modules/qt_lib_*_private.pri

	# drop unneeded .pro file
	rm -fv debian/tmp/usr/lib/*/qt5/examples/contacts/contacts.pro

	mkdir -p debian/tmp/usr/share/doc/qtpim5-examples/examples/organizer/
	cp -av examples/organizer/qmlorganizerlistview/ debian/tmp/usr/share/doc/qtpim5-examples/examples/organizer/
	cp -av examples/contacts/ debian/tmp/usr/share/doc/qtpim5-examples/examples/
	rm -rfv debian/tmp/usr/lib/x86_64-linux-gnu/qt5/examples/contacts/
	rm -fv debian/tmp/usr/share/doc/qtpim5-examples/examples/contacts/Makefile

	# Remove libtool-like files
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la
	# Don't install the skeleton plugin
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/plugins/organizer/libqtorganizer_skeleton.so

override_dh_auto_test:
	xvfb-run -a dh_auto_test --no-parallel -- QML2_IMPORT_PATH=$(CURDIR)/qml QT_PLUGIN_PATH=$(CURDIR)/plugins LD_LIBRARY_PATH=$(CURDIR)/lib

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 = +dfsg1
VER  ?= $(subst $(DTYPE),,$(UVER))

UURL = https://code.qt.io/qt/qtpim.git
UREV = $(shell echo $(VER) | cut -d"." -f3)

QT_MODULE_VERSION = $(shell test -e .qmake.conf && ( cat .qmake.conf | grep MODULE_VERSION | sed -re 's/MODULE_VERSION\s*=\s*([^\s]+)\s*/\1/' ) || echo 5.0.0 )

## 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 -Rfv doc/src/ \
	    && $(RM) -r .git .git* \
	    $(NULL)
	@echo "# Running syncqt.pl (QT_MODULE_VERSION=$(QT_MODULE_VERSION))"
	cd $(PKG)-$(VER) \
	    && cd src/contacts/ && perl /usr/lib/qt5/bin/syncqt.pl -module QtContacts -version $(QT_MODULE_VERSION) -outdir $(CURDIR)/$(PKG)-$(VER) -builddir $(CURDIR)/$(PKG)-$(VER) $(CURDIR)/$(PKG)-$(VER) && cd - 1>/dev/null \
	    && cd src/organizer/ && perl /usr/lib/qt5/bin/syncqt.pl -module QtOrganizer -version $(QT_MODULE_VERSION) -outdir $(CURDIR)/$(PKG)-$(VER) -builddir $(CURDIR)/$(PKG)-$(VER) $(CURDIR)/$(PKG)-$(VER) && cd - 1>/dev/null \
	    && cd src/versit/ && perl /usr/lib/qt5/bin/syncqt.pl -module QtVersit -version $(QT_MODULE_VERSION) -outdir $(CURDIR)/$(PKG)-$(VER) -builddir $(CURDIR)/$(PKG)-$(VER) $(CURDIR)/$(PKG)-$(VER) && cd - 1>/dev/null \
	    && cd src/versitorganizer/ && perl /usr/lib/qt5/bin/syncqt.pl -module QtVersitOrganizer -version $(QT_MODULE_VERSION) -outdir $(CURDIR)/$(PKG)-$(VER) -builddir $(CURDIR)/$(PKG)-$(VER) $(CURDIR)/$(PKG)-$(VER) && cd - 1>/dev/null \
	    && find $(CURDIR)/$(PKG)-$(VER)/include -type f | while read F; do touch -d "$$(git log -1 --format='%ci')" $$F; done
	    $(NULL)
	@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)" \
	    $(NULL)