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