- bootstrap: build pycurl, PlanetLabKeys, and yum before
[build.git] / Makefile
1 #
2 # PlanetLab RPM generation
3 #
4 # Copyright (c) 2003  The Trustees of Princeton University (Trustees).
5 # All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are
9 # met: 
10
11 #     * Redistributions of source code must retain the above copyright
12 #       notice, this list of conditions and the following disclaimer.
13
14 #     * Redistributions in binary form must reproduce the above
15 #       copyright notice, this list of conditions and the following
16 #       disclaimer in the documentation and/or other materials provided
17 #       with the distribution.
18
19 #     * Neither the name of the copyright holder nor the names of its
20 #       contributors may be used to endorse or promote products derived
21 #       from this software without specific prior written permission.
22
23 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR
27 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #
35 # $Id: Makefile,v 1.47 2004/10/04 22:29:18 mlhuang Exp $
36 #
37
38 # Default target
39 all:
40
41 #
42 # CVSROOT: CVSROOT to use
43 # INITIAL: CVS tag to use for Source0 tarball
44 # TAG: CVS tag to patch to
45 # MODULE: CVS module name to use
46 # SPEC: RPM spec file template
47 # RPMBUILD: If not rpmbuild
48 # RPMFLAGS: Miscellaneous RPM flags
49 # CVS_RSH: If not ssh
50 # ALL: default targets
51 #
52 # If INITIAL is different than TAG, PatchSets will be generated
53 # automatically with cvsps(1) to bring Source0 up to TAG. If TAG is
54 # HEAD, a %{date} variable will be defined in the generated spec
55 # file. If a Patch: tag in the spec file matches a generated PatchSet
56 # number, the name of the patch will be as specified. Otherwise, the
57 # name of the patch will be the PatchSet number. %patch tags in the
58 # spec file are generated automatically.
59 #
60
61 #
62 # kernel
63 #
64
65 kernel-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
66 kernel-INITIAL := HEAD
67 kernel-TAG := HEAD
68 kernel-MODULE := linux-2.6
69 kernel-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
70 ALL += kernel
71
72 #
73 # vnet
74 #
75
76 vnet-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
77 vnet-INITIAL := HEAD
78 vnet-TAG := HEAD
79 vnet-MODULE := vnet
80 vnet-SPEC := vnet/vnet.spec
81 vnet-RPMFLAGS := --define "kernelver $(shell rpmquery --queryformat '%{VERSION}-%{RELEASE}\n' --specfile SPECS/$(notdir $(kernel-SPEC)) | head -1)"
82 ALL += vnet
83
84 # Build kernel first so we can bootstrap off of its build
85 vnet: kernel
86
87 #
88 # vsh
89 #
90
91 vsh-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
92 vsh-INITIAL := HEAD
93 vsh-TAG := HEAD
94 vsh-MODULE := trampoline
95 vsh-SPEC := trampoline/vsh.spec
96 ALL += vsh
97
98 # Build kernel first so we can bootstrap off of its build
99 vsh: kernel
100
101 #
102 # util-vserver
103 #
104
105 util-vserver-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
106 util-vserver-INITIAL := HEAD
107 util-vserver-TAG := HEAD
108 util-vserver-MODULE := util-vserver
109 util-vserver-SPEC := util-vserver/util-vserver.spec
110 ALL += util-vserver
111
112 # Build kernel first so we can bootstrap off of its build
113 util-vserver: kernel
114
115 #
116 # vserver-reference
117 #
118
119 vserver-reference-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
120 vserver-reference-INITIAL := HEAD
121 vserver-reference-TAG := HEAD
122 vserver-reference-MODULE := vserver-reference
123 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
124 # Package must be built as root
125 vserver-reference-RPMBUILD := sudo rpmbuild
126 ALL += vserver-reference
127
128 # Build these first so that the reference copies are not stale
129 vserver-reference: yum pycurl PlanetLabKeys
130
131 #
132 # lkcdutils
133 #
134
135 lkcdutils-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
136 lkcdutils-INITIAL := HEAD
137 lkcdutils-TAG := HEAD
138 lkcdutils-MODULE := lkcdutils
139 lkcdutils-SPEC := lkcdutils/spec/lkcdutils.spec
140 ALL += lkcdutils
141
142 # Build kernel first so we can bootstrap off of its build
143 lkcdutils: kernel
144
145 #
146 # yum
147 #
148
149 yum-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
150 yum-INITIAL := HEAD
151 yum-TAG := HEAD
152 yum-MODULE := yum
153 yum-SPEC := yum/yum.spec
154 ALL += yum
155
156 #
157 # ksymoops
158 #
159
160 ksymoops-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
161 ksymoops-INITIAL := ksymoops-2_4_9
162 ksymoops-TAG := HEAD
163 ksymoops-MODULE := ksymoops
164 ksymoops-SPEC := ksymoops/ksymoops.spec
165 ALL += ksymoops
166
167 #
168 # PlanetLabAccounts
169 #
170
171 PlanetLabAccounts-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
172 PlanetLabAccounts-INITIAL := HEAD
173 PlanetLabAccounts-TAG := HEAD
174 PlanetLabAccounts-MODULE := PlanetLabAccounts
175 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
176 ALL += PlanetLabAccounts
177
178 #
179 # NodeUpdate
180 #
181
182 NodeUpdate-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
183 NodeUpdate-INITIAL := HEAD
184 NodeUpdate-TAG := HEAD
185 NodeUpdate-MODULE := NodeUpdate
186 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
187 ALL += NodeUpdate
188
189 #
190 # PlanetLabConf
191 #
192
193 PlanetLabConf-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
194 PlanetLabConf-INITIAL := HEAD
195 PlanetLabConf-TAG := HEAD
196 PlanetLabConf-MODULE := PlanetLabConf
197 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
198 ALL += PlanetLabConf
199
200 #
201 # PlanetLabKeys
202 #
203
204 PlanetLabKeys-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
205 PlanetLabKeys-INITIAL := HEAD
206 PlanetLabKeys-TAG := HEAD
207 PlanetLabKeys-MODULE := PlanetLabKeys
208 PlanetLabKeys-SPEC := PlanetLabKeys/PlanetLabKeys.spec
209 ALL += PlanetLabKeys
210
211 #
212 # BWLimit
213 #
214
215 BWLimit-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
216 BWLimit-INITIAL := HEAD
217 BWLimit-TAG := HEAD
218 BWLimit-MODULE := BWLimit
219 BWLimit-SPEC := BWLimit/BWLimit.spec
220 ALL += BWLimit
221
222 #
223 # ipod
224 #
225
226 ipod-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
227 ipod-INITIAL := HEAD
228 ipod-TAG := HEAD
229 ipod-MODULE := ipod
230 ipod-SPEC := ipod/ipod.spec
231 ALL += ipod
232
233 #
234 # sudo
235 #
236
237 sudo-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
238 sudo-INITIAL := HEAD
239 sudo-TAG := HEAD
240 sudo-MODULE := sudo
241 sudo-SPEC := sudo/planetlab_sudo.spec
242 ALL += sudo
243
244 #
245 # pycurl
246 #
247
248 pycurl-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
249 pycurl-INITIAL := HEAD
250 pycurl-TAG := HEAD
251 pycurl-MODULE := pycurl
252 pycurl-SPEC := pycurl/pycurl.spec
253 ALL += pycurl
254
255 #
256 # BootServerRequest
257 #
258
259 BootServerRequest-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
260 BootServerRequest-INITIAL := HEAD
261 BootServerRequest-TAG := HEAD
262 BootServerRequest-MODULE := BootServerRequest
263 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
264 ALL += BootServerRequest
265
266 #
267 # PlanetLabID
268 #
269
270 PlanetLabID-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
271 PlanetLabID-INITIAL := HEAD
272 PlanetLabID-TAG := HEAD
273 PlanetLabID-MODULE := PlanetLabID
274 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
275 ALL += PlanetLabID
276
277 #
278 # Node Manager
279 #
280
281 sidewinder-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
282 sidewinder-INITIAL := HEAD
283 sidewinder-TAG := HEAD
284 sidewinder-MODULE := sidewinder
285 sidewinder-SPEC := sidewinder/sidewinder.spec
286 ALL += sidewinder
287
288 #
289 # pl_sshd
290 #
291
292 pl_sshd-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
293 pl_sshd-INITIAL := HEAD
294 pl_sshd-TAG := HEAD
295 pl_sshd-MODULE := pl_sshd
296 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
297 ALL += pl_sshd
298
299 ifeq ($(findstring $(package),$(ALL)),)
300
301 # Build all packages
302 all: $(ALL)
303
304 # Recurse
305 $(ALL):
306         $(MAKE) package=$@
307
308 # Remove files generated by this package
309 $(foreach package,$(ALL),$(package)-clean): %-clean:
310         $(MAKE) package=$* clean
311
312 # Remove all generated files
313 clean:
314         rm -rf BUILD RPMS SOURCES SPECS SRPMS .rpmmacros .cvsps
315
316 .PHONY: all $(ALL) $(foreach package,$(ALL),$(package)-clean) clean
317
318 else
319
320 # Define variables for Makerules
321 CVSROOT := $($(package)-CVSROOT)
322 INITIAL := $($(package)-INITIAL)
323 TAG := $($(package)-TAG)
324 MODULE := $($(package)-MODULE)
325 SPEC := $($(package)-SPEC)
326 RPMFLAGS := $($(package)-RPMFLAGS)
327 RPMBUILD := $(if $($(package)-RPMBUILD),$($(package)-RPMBUILD),rpmbuild)
328 CVS_RSH := $(if $($(package)-CVS_RSH),$($(package)-CVS_RSH),ssh)
329
330 include Makerules
331
332 endif