~shnatsel/+junk/pkg-kde-tools-backport

« back to all changes in this revision

Viewing changes to qt-kde-team/2/debian-qt-kde.mk

  • Committer: Sergey "Shnatsel" Davidoff
  • Date: 2016-04-18 20:56:33 UTC
  • Revision ID: shnatsel@gmail.com-20160418205633-i7sh6o3o6yzm410a
Initial import of version 0.15.16ubuntu2 from vivid

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
ifndef dqk_dir
 
2
 
 
3
dqk_dir := $(dir $(lastword $(MAKEFILE_LIST)))
 
4
 
 
5
# Include dhmk file
 
6
include $(dqk_dir)dhmk.mk
 
7
 
 
8
# For performance reasons skip the rest in the override info mode. The slowdown
 
9
# is mostly caused by $(shell) functions (e.g. dpkg-parsechangelog).
 
10
ifneq ($(dhmk_override_info_mode),yes)
 
11
 
 
12
dqk_sourcepkg := $(shell dpkg-parsechangelog | sed -n '/^Source:/{ s/^Source:[[:space:]]*//; p; q }')
 
13
dqk_upstream_version ?= $(shell dpkg-parsechangelog | sed -n '/^Version:/{ s/^Version:[[:space:]]*\(.*\)-.*/\1/g; p; q }')
 
14
dqk_destdir = $(CURDIR)/debian/tmp
 
15
 
 
16
# We want to use kde and pkgkde-symbolshelper plugins by default
 
17
dh := --with=kde,pkgkde-symbolshelper $(dh)
 
18
 
 
19
# dqk_disable_policy_check lists distributions for which policy check should be
 
20
# disabled
 
21
dqk_disable_policy_check ?=
 
22
include $(dqk_dir)policy.mk
 
23
 
 
24
# Support list-missing target
 
25
include $(dqk_dir)list-missing.mk
 
26
 
 
27
# Support lintian target
 
28
include $(dqk_dir)lintian.mk
 
29
 
 
30
# KDE packages are parallel safe. Add --parallel to dh_auto_% commands
 
31
$(call set_command_options,dh_auto_%, += --parallel)
 
32
 
 
33
# Use xz compression by default
 
34
$(call set_command_options,dh_builddeb, += -u-Zxz)
 
35
 
 
36
# Link with --as-needed by default
 
37
# (subject to be moved to kde dh addon/debhelper buildsystem)
 
38
dqk_link_with_as_needed ?= yes
 
39
ifneq (,$(findstring yes, $(dqk_link_with_as_needed)))
 
40
    dqk_link_with_as_needed := no
 
41
    ifeq (,$(findstring no-as-needed, $(DEB_BUILD_OPTIONS)))
 
42
        dqk_link_with_as_needed := yes
 
43
        export LDFLAGS += -Wl,--as-needed
 
44
    endif
 
45
endif
 
46
 
 
47
# Set the link_with_no_undefined=no in order to disable linking with
 
48
# --no-undefined (default value is inherited from $(dqk_link_with_as_needed))
 
49
dqk_link_with_no_undefined ?= $(dqk_link_with_as_needed)
 
50
ifneq (,$(findstring yes, $(dqk_link_with_no_undefined)))
 
51
    dqk_link_with_no_undefined := no
 
52
    ifeq (,$(findstring no-no-undefined, $(DEB_BUILD_OPTIONS)))
 
53
        dqk_link_with_no_undefined := yes
 
54
        export LDFLAGS += -Wl,--no-undefined
 
55
    endif
 
56
endif
 
57
 
 
58
# Since cmake 2.6.2 or higher is required from now on, enable relative paths to
 
59
# get more ccache hits.
 
60
$(call set_command_options,dh_auto_configure, += "-u-DCMAKE_USE_RELATIVE_PATHS=ON")
 
61
 
 
62
# Run dh_sameversiondep
 
63
run_dh_sameversiondep:
 
64
        dh_sameversiondep
 
65
$(foreach t,$(dhmk_binary_targets),pre_$(t)_dh_gencontrol): run_dh_sameversiondep
 
66
 
 
67
debian/stamp-man-pages:
 
68
        if ! test -d debian/man/out; then mkdir -p debian/man/out; fi
 
69
        for f in $$(find debian/man -name '*.sgml'); do \
 
70
                docbook-to-man $$f > debian/man/out/`basename $$f .sgml`.1; \
 
71
        done
 
72
        for f in $$(find debian/man -name '*.man'); do \
 
73
                soelim -I debian/man $$f \
 
74
                > debian/man/out/`basename $$f .man`.`head -n1 $$f | awk '{print $$NF}'`; \
 
75
        done
 
76
        touch debian/stamp-man-pages
 
77
$(foreach t,build-arch build-indep build,post_$(t)_dh_auto_build): debian/stamp-man-pages
 
78
 
 
79
cleanup_manpages:
 
80
        rm -rf debian/man/out
 
81
        -rmdir debian/man
 
82
        rm -f debian/stamp-man-pages
 
83
post_clean: cleanup_manpages
 
84
 
 
85
# Install files to $(dqk_sourcepkg)-doc-html package if needed
 
86
dqk_doc-html_dir = $(CURDIR)/debian/$(dqk_sourcepkg)-doc-html
 
87
install_to_doc-html_package:
 
88
        set -e; \
 
89
        if [ -d "$(dqk_doc-html_dir)" ]; then \
 
90
            for doc in `cd $(dqk_destdir)/usr/share/doc/kde/HTML/en; find . -name index.docbook`; do \
 
91
                pkg=$${doc%/index.docbook}; pkg=$${pkg#./}; \
 
92
                echo Building $$pkg HTML docs...; \
 
93
                mkdir -p $(dqk_doc-html_dir)/usr/share/doc/kde/HTML/en/$$pkg; \
 
94
                cd $(dqk_doc-html_dir)/usr/share/doc/kde/HTML/en/$$pkg; \
 
95
                meinproc4 $(dqk_destdir)/usr/share/doc/kde/HTML/en/$$pkg/index.docbook; \
 
96
            done; \
 
97
            for pkg in $(DOC_HTML_PRUNE) ; do \
 
98
                rm -rf $(dqk_doc-html_dir)/usr/share/doc/kde/HTML/en/$$pkg; \
 
99
            done; \
 
100
        fi
 
101
$(foreach t,install-indep install,post_$(t)_dh_install): install_to_doc-html_package
 
102
 
 
103
post_binary: list-missing lintian
 
104
 
 
105
.PHONY: run_dh_sameversiondep cleanup_manpages install_to_doc-html_package
 
106
 
 
107
endif # ifneq ($(dhmk_override_info_mode),yes)
 
108
endif # ifndef dqk_dir