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