Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # See debhelper(7) (uncomment to enable)
3 # output every command that modifies files on the build system.
4 DH_VERBOSE = 1
5
6 LOGLEVEL = info
7 ifeq ($(DH_VERBOSE),1)
8 LOGLEVEL = debug
9 endif
10 ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
11 LOGLEVEL = warning
12 endif
13
14 DPKG_EXPORT_BUILDFLAGS = 1
15 include /usr/share/dpkg/default.mk
16 include /usr/share/dpkg/architecture.mk
17
18 #confgure qt5 generally, not just for configure
19 export QT_SELECT=5
20
21 LIBNAME=libdewalls
22 VERSION=$(shell dpkg-parsechangelog -S version | awk '{split($$0,a,"-"); print a[1]}')
23 PKGCONFDIR:=debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig
24
25 %:
26 dh $@
27
28 # Note that the dpkg-buildflags settings are currently static. We await a
29 # mechanism to convert them dynamically into Qbs-speak
30
31 override_dh_auto_configure:
32 qbs-setup-toolchains --settings-dir debian --detect
33 qbs-setup-qt --settings-dir debian /usr/bin/qmake deb
34 qbs config --settings-dir debian profiles.deb.qbs.installPrefix "usr/"
35 qbs config --settings-dir debian profiles.deb.cpp.debugInformation true
36 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
37 qbs config --settings-dir debian profiles.deb.cpp.optimization none
38 else ifeq ($(DEB_HOST_ARCH), ppc64el)
39 # 'fast' seems to cause segfaults during build
40 qbs config --settings-dir debian profiles.deb.cpp.optimization size
41 else
42 qbs config --settings-dir debian profiles.deb.cpp.optimization fast
43 endif
44 qbs config --settings-dir debian profiles.deb.cpp.commonCompilerFlags -Wdate-time
45 qbs config --settings-dir debian profiles.deb.cpp.defines '"_FORTIFY_SOURCE=2"'
46 qbs config --settings-dir debian profiles.deb.cpp.cFlags '[ "-fdebug-prefix-map=$(CURDIR)=.", "-fstack-protector-strong", "-Wformat", "-Werror=format-security" ]'
47 qbs config --settings-dir debian profiles.deb.cpp.cxxFlags '[ "-fdebug-prefix-map=$(CURDIR)=.", "-fstack-protector-strong", "-Wformat", "-Werror=format-security" ]'
48 qbs config --settings-dir debian profiles.deb.cpp.linkerFlags "-z,relro"
49
50 override_dh_auto_build:
51 qbs build --settings-dir debian --log-level $(LOGLEVEL) --command-echo-mode command-line --no-install \
52 profile:deb \
53 modules.qbs.installRoot:$(CURDIR)/debian/tmp \
54 project.libDir:lib/$(DEB_HOST_MULTIARCH) \
55 config:qbs-build
56 # Generate pkgconfig file
57 sed -e "s/@DEB_HOST_MULTIARCH@/${DEB_HOST_MULTIARCH}/;s/@VERSION@/$(VERSION)/" < debian/$(LIBNAME).pc.in > debian/$(LIBNAME).pc
58
59 override_dh_auto_test:
60 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
61 # run tests
62 qbs run --settings-dir debian --no-build --log-level $(LOGLEVEL) -p dewalls-test \
63 --install-root $(CURDIR)/qbs-build/install-root \
64 qbs.installDir:lib/$(DEB_HOST_MULTIARCH) \
65 profile:deb config:qbs-build
66 endif
67
68 override_dh_auto_install:
69 qbs install --settings-dir debian --no-build --log-level $(LOGLEVEL) \
70 --install-root $(CURDIR)/debian/tmp \
71 profile:deb \
72 qbs.installDir:lib/$(DEB_HOST_MULTIARCH) \
73 config:qbs-build
74 mkdir -p $(PKGCONFDIR)
75 mv debian/$(LIBNAME).pc $(PKGCONFDIR)/$(LIBNAME).pc
76 dh_install
77
78 override_dh_clean:
79 # tidy up qbs profile builddirs
80 - rm -r qbs-build
81 - rm debian/$(LIBNAME).pc
82 - rm -r debian/qbs
83 dh_clean