d929bd56b315e62a4f683ef378a38f0b304b42c9
[linux-flexiantxendom0-natty.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
89         rm -rf $(builddir)/tools
90         install -d $(builddir)/tools
91         for i in *; do ln -s $(CURDIR)/$$i $(builddir)/tools/; done
92         rm $(builddir)/tools/tools
93         rsync -a tools/ $(builddir)/tools/tools/
94
95         cd $(builddir)/tools/tools/perf && make man
96         install -m644 $(builddir)/tools/tools/perf/Documentation/*.1 \
97                 $(toolsman)/man1
98
99 ifeq ($(do_common_headers_indep),true)
100 install-indep-deps-$(do_flavour_header_package) += install-headers
101 endif
102 install-indep-deps-$(do_doc_package) += install-doc
103 install-indep-deps-$(do_source_package) += install-source
104 install-indep-deps-$(do_tools) += install-tools
105 install-indep: $(install-indep-deps-true)
106
107 # This is just to make it easy to call manually. Normally done in
108 # binary-indep target during builds.
109 binary-headers: install-headers
110         dh_testdir
111         dh_testroot
112         dh_installchangelogs -p$(indep_hdrpkg)
113         dh_installdocs -p$(indep_hdrpkg)
114         dh_compress -p$(indep_hdrpkg)
115         dh_fixperms -p$(indep_hdrpkg)
116         dh_installdeb -p$(indep_hdrpkg)
117         dh_gencontrol -p$(indep_hdrpkg)
118         dh_md5sums -p$(indep_hdrpkg)
119         dh_builddeb -p$(indep_hdrpkg)
120
121 binary-indep: install-indep
122         dh_testdir
123         dh_testroot
124
125         dh_installchangelogs -i
126         dh_installdocs -i
127         dh_compress -i
128         dh_fixperms -i
129         dh_installdeb -i
130         dh_gencontrol -i
131         dh_md5sums -i
132         dh_builddeb -i