]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - debian/rules.d/3-binary-indep.mk
766d184911169d2f2dd0ea084c99679b12cf5a3f
[mirror_ubuntu-zesty-kernel.git] / debian / rules.d / 3-binary-indep.mk
1 build-indep:
2 @echo Debug: $@
3
4 # The binary-indep dependency chain is:
5 #
6 # install-headers <- install-doc <- install-source <- install-tools <- install-indep <- binary-indep
7 # install-headers <- binary-headers
8 #
9 indep_hdrpkg = $(indep_hdrs_pkg_name)
10 indep_hdrdir = $(CURDIR)/debian/$(indep_hdrpkg)/usr/src/$(indep_hdrpkg)
11 install-headers:
12 @echo Debug: $@
13 dh_testdir
14 dh_testroot
15 dh_prep
16
17 ifeq ($(do_flavour_header_package),true)
18 install -d $(indep_hdrdir)
19 find . -path './debian' -prune -o -path './$(DEBIAN)' -prune \
20 -o -path './include/*' -prune \
21 -o -path './scripts/*' -prune -o -type f \
22 \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
23 -name '*.sh' -o -name '*.pl' -o -name '*.lds' \) \
24 -print | cpio -pd --preserve-modification-time $(indep_hdrdir)
25 cp -a scripts include $(indep_hdrdir)
26 (find arch -name include -type d -print | \
27 xargs -n1 -i: find : -type f) | \
28 cpio -pd --preserve-modification-time $(indep_hdrdir)
29 endif
30
31 docpkg = $(doc_pkg_name)
32 docdir = $(CURDIR)/debian/$(docpkg)/usr/share/doc/$(docpkg)
33 install-doc: install-headers
34 @echo Debug: $@
35 ifeq ($(do_doc_package),true)
36 dh_testdir
37 dh_testroot
38
39 install -d $(docdir)
40 ifeq ($(do_doc_package_content),true)
41 # First the html docs. We skip these for autobuilds
42 if [ -z "$(AUTOBUILD)" ]; then \
43 install -d $(docdir)/$(doc_pkg_name)-tmp; \
44 $(kmake) O=$(docdir)/$(doc_pkg_name)-tmp htmldocs; \
45 mv $(docdir)/$(doc_pkg_name)-tmp/Documentation/DocBook \
46 $(docdir)/html; \
47 rm -rf $(docdir)/$(doc_pkg_name)-tmp; \
48 fi
49 endif
50 # Copy the rest
51 cp -a Documentation/* $(docdir)
52 rm -rf $(docdir)/DocBook
53 find $(docdir) -name .gitignore | xargs rm -f
54 endif
55
56 srcpkg = $(src_pkg_name)-source-$(release)
57 srcdir = $(CURDIR)/debian/$(srcpkg)/usr/src/$(srcpkg)
58 balldir = $(CURDIR)/debian/$(srcpkg)/usr/src/$(srcpkg)/$(srcpkg)
59 install-source: install-doc
60 @echo Debug: $@
61 ifeq ($(do_source_package),true)
62
63 install -d $(srcdir)
64 ifeq ($(do_source_package_content),true)
65 find . -path './debian' -prune -o -path './$(DEBIAN)' -prune -o \
66 -path './.*' -prune -o -print | \
67 cpio -pd --preserve-modification-time $(balldir)
68 (cd $(srcdir); tar cf - $(srcpkg)) | bzip2 -9c > \
69 $(srcdir)/$(srcpkg).tar.bz2
70 rm -rf $(balldir)
71 find './debian' './$(DEBIAN)' \
72 -path './debian/linux-*' -prune -o \
73 -path './debian/$(src_pkg_name)-*' -prune -o \
74 -path './debian/build' -prune -o \
75 -path './debian/files' -prune -o \
76 -path './debian/stamps' -prune -o \
77 -path './debian/tmp' -prune -o \
78 -print | \
79 cpio -pd --preserve-modification-time $(srcdir)
80 ln -s $(srcpkg)/$(srcpkg).tar.bz2 $(srcdir)/..
81 endif
82 endif
83
84 install-tools: toolspkg = $(tools_common_pkg_name)
85 install-tools: toolsbin = $(CURDIR)/debian/$(toolspkg)/usr/bin
86 install-tools: toolssbin = $(CURDIR)/debian/$(toolspkg)/usr/sbin
87 install-tools: toolsman = $(CURDIR)/debian/$(toolspkg)/usr/share/man
88 install-tools: install-source $(stampdir)/stamp-build-perarch
89 @echo Debug: $@
90 ifeq ($(do_tools),true)
91
92 install -d $(toolsbin)
93 install -d $(toolsman)/man1
94
95 install -m755 debian/tools/generic $(toolsbin)/cpupower
96 install -m644 $(CURDIR)/tools/power/cpupower/man/*.1 $(toolsman)/man1/
97
98 ifeq ($(do_tools_perf),true)
99 install -m755 debian/tools/generic $(toolsbin)/perf
100 endif
101 ifeq ($(do_tools_x86),true)
102 install -m755 debian/tools/generic $(toolsbin)/x86_energy_perf_policy
103 install -m755 debian/tools/generic $(toolsbin)/turbostat
104 endif
105 ifeq ($(do_tools_hyperv),true)
106 install -d $(toolssbin)
107 install -m755 debian/tools/generic $(toolssbin)/hv_kvp_daemon
108 install -m755 debian/tools/generic $(toolssbin)/hv_vss_daemon
109 endif
110
111 rm -rf $(builddir)/tools
112 install -d $(builddir)/tools
113 for i in *; do ln -s $(CURDIR)/$$i $(builddir)/tools/; done
114 rm $(builddir)/tools/tools
115 rsync -a tools/ $(builddir)/tools/tools/
116
117 ifeq ($(do_tools_perf),true)
118 cd $(builddir)/tools/tools/perf && make man
119 install -m644 $(builddir)/tools/tools/perf/Documentation/*.1 \
120 $(toolsman)/man1
121 endif
122 ifeq ($(do_tools_x86),true)
123 install -d $(toolsman)/man8
124 install -m644 $(CURDIR)/tools/power/x86/x86_energy_perf_policy/*.8 $(toolsman)/man8
125 install -m644 $(CURDIR)/tools/power/x86/turbostat/*.8 $(toolsman)/man8
126 endif
127 ifeq ($(do_tools_hyperv),true)
128 install -m644 $(CURDIR)/tools/hv/*.8 $(toolsman)/man8
129 endif
130 endif
131
132 install-indep: install-tools
133 @echo Debug: $@
134
135 # This is just to make it easy to call manually. Normally done in
136 # binary-indep target during builds.
137 binary-headers: install-headers
138 @echo Debug: $@
139 dh_installchangelogs -p$(indep_hdrpkg)
140 dh_installdocs -p$(indep_hdrpkg)
141 dh_compress -p$(indep_hdrpkg)
142 dh_fixperms -p$(indep_hdrpkg)
143 dh_installdeb -p$(indep_hdrpkg)
144 $(lockme) dh_gencontrol -p$(indep_hdrpkg)
145 dh_md5sums -p$(indep_hdrpkg)
146 dh_builddeb -p$(indep_hdrpkg)
147
148 binary-indep: install-indep
149 @echo Debug: $@
150
151 dh_installchangelogs -i
152 dh_installdocs -i
153 dh_compress -i
154 dh_fixperms -i
155 dh_installdeb -i
156 $(lockme) dh_gencontrol -i
157 dh_md5sums -i
158 dh_builddeb -i