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