/[kernel]/trunk/kernel/source/linux-kernel-2.6.12/debian/rules
ViewVC logotype

Contents of /trunk/kernel/source/linux-kernel-2.6.12/debian/rules

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3430 - (show annotations) (download)
Sat Jul 9 23:42:48 2005 UTC (7 years, 10 months ago) by dilinger
File size: 7197 byte(s)
minor comment about variable descriptions in README
1 #!/usr/bin/make -f
2 #
3 # Required variables. See README for a description of the variables.
4 #
5 version := $(shell dpkg-parsechangelog | sed -n 's/^Source: linux-kernel-\(.\+\)$$/\1/p')
6 major_v := $(wordlist 1,1,$(subst ., ,$(version)))
7 minor_v := $(wordlist 2,2,$(subst ., ,$(version)))
8 abiname := 1
9 ltver := 1
10 #
11 # Generally nothing needs to be modified below this line
12 #
13 SHELL := sh -e
14 karch := $(shell dpkg-architecture -qDEB_HOST_ARCH)
15 major := $(major_v).$(minor_v)
16 srcver := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
17 release := $(version)-$(ltver)
18 uver := $(subst .,_,$(version))
19 blah:
20 echo $(version)
21 echo $(major)
22 #
23 # Construct depends and provides for the linux-tree
24 #
25 lt_depends += $(shell seq -f 'linux-source-$(version) (= $(version)-%g)' \
26 -s ' | ' 1 $(ltver))
27 lt_provides := $(shell seq -f 'linux-tree-$(version)-%g' -s ', ' 1 $(ltver))
28 #
29 # If we are not passed a subarchs variable, we obtain the complete
30 # subarch list as a list of subdirectories in arch/$(karch). We
31 # also export the flavours variables, which allows to control which
32 # flavours are built.
33 #
34 ifndef subarchs
35 subarchs := $(shell find debian/arch/$(karch) \
36 -mindepth 1 -maxdepth 1 -type d \
37 ! -name '.svn' -printf '%f\n')
38 endif
39 ifeq (,$(subarchs))
40 subarchs := none
41 endif
42 #
43 # The following definition gets the list of relevant files in the top-level
44 # directory. At this point we cannot verify that we are in top-level dir
45 # (we probably are), so it should be referenced only in the targets which
46 # run dh_testdir in the beginning.
47 #
48 source_files = $(filter-out debian linux-source-$(version), $(shell echo *))
49
50 export version abiname ltver kbuildver flavours major uver
51
52 patch: debian/patch-stamp
53 debian/patch-stamp: debian/bin/apply
54 dh_testdir
55 override_version=$(release) home=debian/patches-debian debian/bin/apply
56 # make-kpkg does this when building kernel-source.
57 mv scripts/package/Makefile scripts/package/Makefile.dist
58 mv scripts/package/builddeb scripts/package/builddeb.dist
59 echo "# Dummy Makefile" > scripts/package/Makefile
60 echo "all:" >> scripts/package/Makefile
61 touch debian/patch-stamp
62
63 unpatch:
64 dh_testdir
65 if [ -e debian/patch-stamp ]; then \
66 override_version=$(release) home=debian/patches-debian \
67 debian/bin/apply $(version); \
68 cd scripts/package; \
69 mv Makefile.dist Makefile; \
70 mv builddeb.dist builddeb; \
71 fi
72 rm -f debian/patch-stamp
73 #
74 # linux-source package
75 #
76 spkg := linux-source-$(version)
77 sdir := debian/$(spkg)/usr/src
78 source: debian/source-stamp
79 debian/source-stamp: debian/patch-stamp
80 dh_testdir
81 dh_testroot
82 dh_installdirs -p$(spkg) /usr/src
83 # Link the files and create a tarball in correct location
84 mkdir $(spkg)
85 cp -al $(source_files) $(spkg)
86 tar -cjf $(sdir)/$(spkg).tar.bz2 $(spkg)
87 rm -rf $(spkg)
88 dh_installdocs -p$(spkg) README
89 dh_installchangelogs -p$(spkg)
90 dh_compress -p$(spkg)
91 dh_fixperms -p$(spkg)
92 dh_installdeb -p$(spkg)
93 dh_gencontrol -p$(spkg)
94 dh_md5sums -p$(spkg)
95 dh_builddeb -p$(spkg)
96 touch debian/source-stamp
97 #
98 # linux-tree package
99 #
100 tpkg := linux-tree-$(version)
101 tree: debian/tree-stamp
102 debian/tree-stamp:
103 dh_testdir
104 dh_testroot
105 dh_installdirs -p$(tpkg)
106 dh_installdocs -p$(tpkg)
107 dh_installchangelogs -p$(tpkg)
108 dh_compress -p$(tpkg)
109 dh_fixperms -p$(tpkg)
110 dh_installdeb -p$(tpkg)
111 dh_gencontrol -p$(tpkg)
112 dh_md5sums -p$(tpkg)
113 dh_builddeb -p$(tpkg)
114 touch debian/tree-stamp
115 #
116 # linux-patch-debian
117 #
118 ppkg := linux-patch-debian-$(version)
119 pbase := /usr/src/kernel-patches/all/$(version)
120 pfull := debian/$(ppkg)$(pbase)
121 pdirs := $(pbase) $(pbase)/apply $(pbase)/debian $(pbase)/unpatch
122 ptchs := $(notdir $(wildcard debian/patches-arch/*))
123 kptch := debian/$(ppkg).kpatches.arch
124 pcdir := debian/patches-arch
125 patch-debian: debian/patch-debian-stamp
126 debian/patch-debian-stamp: debian/bin/apply debian/bin/unpatch
127 dh_testdir
128 dh_testroot
129 dh_installdirs -p$(ppkg) $(pdirs)
130 dh_install -p$(ppkg) debian/patches-debian/* $(pbase)/debian
131 # Install the debian patches
132 sed 's/@version@/$(release)/g' debian/bin/apply > $(pfull)/apply/debian
133 sed 's/@upstream@/$(version)/g' debian/bin/unpatch > $(pfull)/unpatch/debian
134 chmod a+x $(pfull)/apply/debian $(pfull)/unpatch/debian
135 chmod -x $(pfull)/debian/*.patch
136 bzip2 -9 $(pfull)/debian/*.patch
137 # Now the arch/subarch-specific patches
138 for i in $(ptchs); do \
139 rm -f $(kptch); \
140 arch=$${i%%.*}; \
141 echo "Patch-name: $${arch}" >> $(kptch); \
142 echo "Patch-id: $${arch}_$(uver)" >> $(kptch); \
143 echo "Path-strip-level: 1" >> $(kptch); \
144 echo >> $(kptch); \
145 echo "Patch-file: $(pcdir)/$${i}" >> $(kptch); \
146 echo "Architecture: $${arch}" >> $(kptch); \
147 echo "Kernel-version: $(version)" >> $(kptch); \
148 dh_installkpatches -p$(ppkg); \
149 done
150 dh_fixperms -p$(ppkg)
151 dh_installdocs -p$(ppkg)
152 dh_installchangelogs -p$(ppkg)
153 dh_compress -p$(ppkg)
154 dh_installdeb -p$(ppkg)
155 dh_gencontrol -p$(ppkg)
156 dh_md5sums -p$(ppkg)
157 dh_builddeb -p$(ppkg)
158 touch debian/patch-debian-stamp
159 #
160 # linux-doc package
161 #
162 dbdir := debian/build-doc
163 dbddir := $(dbdir)/debian
164 doc: debian/doc-stamp
165 debian/doc-stamp: debian/patch-stamp
166 dh_testdir
167 dh_testroot
168 # Create a build tree
169 mkdir -p $(dbdir)
170 cp -al $(source_files) $(dbdir)
171 mkdir -p $(dbddir)
172 cp debian/changelog $(dbddir)
173 cp debian/control $(dbddir)
174 cp debian/copyright $(dbddir)
175 touch $(dbddir)/official
176 cd $(dbdir) && make-kpkg --stem linux kernel-doc
177 cat $(dbddir)/files >> debian/files
178 mv debian/*.deb ..
179 touch debian/doc-stamp
180
181 unpack: debian/unpack-stamp
182 debian/unpack-stamp: debian/patch-stamp
183 dh_testdir
184 cd debian; \
185 for i in $(subarchs); do \
186 $(MAKE) subarch=$${i} unpack; \
187 done
188 ln -s $$(command -v touch) debian/bin/touch.orig
189 touch debian/unpack-stamp
190
191 build: debian/build-stamp
192 debian/build-stamp: debian/unpack-stamp
193 dh_testdir
194 cd debian; \
195 for i in $(subarchs); do \
196 $(MAKE) subarch=$${i} build; \
197 done
198 touch debian/build-stamp
199
200 clean: unpatch
201 dh_testdir
202 rm -f version.Debian
203 rm -rf linux-source-$(version)
204 cd debian; \
205 rm -f *-stamp-* *-stamp config.* *.kpatches.arch; \
206 rm -f header-install-* post-install-* bin/touch.orig; \
207 rm -rf linux-source-* build-* install-*
208 dh_clean
209
210 binary-indep: source tree patch-debian doc
211 binary-arch: build
212 dh_testdir
213 cd debian; \
214 for i in $(subarchs); do \
215 $(MAKE) subarch=$${i} binary; \
216 done
217
218 binary: binary-indep binary-arch
219
220 #
221 # Makes the master debian/control file by substituting
222 # variable values into the template.
223 #
224 debian/control: debian/templates/control.main.in
225 cat debian/templates/control.source.in \
226 debian/templates/control.main.in | \
227 sed -e 's/@version@/$(version)/g' \
228 -e 's/@major@/$(major)/g' \
229 -e 's/@ltver@/$(ltver)/g' \
230 -e 's/@srcver@/$(srcver)/g' \
231 -e 's/@lt_depends@/$(lt_depends)/g' \
232 -e 's/@lt_provides@/$(lt_provides)/g' \
233 -e 's/@abiname@/$(abiname)/g' | \
234 sed '/^[[:space:]]*$$/d' | \
235 sed 's/^Package:/\n&/g' > debian/control
236
237 .PHONY: clean build unpack binary-indep binary-arch binary patch unpatch source tree

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5