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
KDE_VER=5
shellescape='$(subst ','\'',$(1))'
shellexport=$(1)=$(call shellescape,${$(1)})
CC?= gcc
CXX?= g++
EXTRA_CFLAGS= -Wall
EXTRA_CXXFLAGS= -Wall
EXTRA_LDFLAGS= -Wl,--as-needed
ifneq (,$(wildcard /usr/share/dpkg/buildflags.mk))
# dpkg-dev (>= 1.16.1~)
DEB_CFLAGS_MAINT_APPEND=${EXTRA_CFLAGS}
DEB_CXXFLAGS_MAINT_APPEND=${EXTRA_CXXFLAGS}
DEB_LDFLAGS_MAINT_APPEND=${EXTRA_LDFLAGS}
ifeq (5,${KDE_VER})
# recent Qt5 builds require the application to be built as PIC
DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
DEB_CPPFLAGS_MAINT_APPEND+=-DPIC
DEB_CFLAGS_MAINT_APPEND+=-fPIC
DEB_CXXFLAGS_MAINT_APPEND+=-fPIC
DEB_LDFLAGS_MAINT_APPEND+=-fPIC
else
DEB_BUILD_MAINT_OPTIONS=hardening=+all
endif
include /usr/share/dpkg/buildflags.mk
else
# old-fashioned way to determine build flags
CFLAGS= -O$(if $(findstring noopt,${DEB_BUILD_OPTIONS}),0,2) -g
CXXFLAGS= -O$(if $(findstring noopt,${DEB_BUILD_OPTIONS}),0,2) -g
CFLAGS+= ${EXTRA_CFLAGS}
CXXFLAGS+= ${EXTRA_CXXFLAGS}
LDFLAGS+= ${EXTRA_LDFLAGS}
endif
MAKE_INVOCATION= ${MAKE} -f GNUmakefile KDE_VER=${KDE_VER} INSTALL_STRIP=
build build-arch: .build_done
build-indep:
.build_done:
dh_testdir
$(foreach i,CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS,$(call shellexport,$i)); \
export CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS; \
exec ${MAKE_INVOCATION}
@:>$@
clean:
dh_testdir
${MAKE_INVOCATION} clean
-rm -f .build_done debian/copyright
cat debian/copyright.hdr LICENCE >debian/copyright
dh_clean
binary-indep: build-indep
binary-arch: build-arch
dh_testdir
dh_testroot
if test -x "$$(which dh_prep)"; then dh_prep; else dh_clean -k; fi
dh_installdirs
${MAKE_INVOCATION} DESTDIR="$$(pwd)/debian/kwalletcli" install
dh_installchangelogs
dh_installdocs
mkdir -p debian/kwalletcli/usr/share/lintian/overrides
cp -a debian/lintian-bp \
debian/kwalletcli/usr/share/lintian/overrides/kwalletcli
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep build build-arch build-indep clean
|