2 # PlanetLab RPM generation
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2003-2005 The Trustees of Princeton University
7 # $Id: Makefile,v 1.80 2005/11/21 22:37:15 mlhuang Exp $
14 # CVSROOT: CVSROOT to use
15 # INITIAL: CVS tag to use for Source0 tarball
16 # TAG: CVS tag to patch to (if not HEAD)
17 # MODULE: CVS module name to use (if not HEAD)
18 # SPEC: RPM spec file template
19 # RPMBUILD: If not rpmbuild
20 # RPMFLAGS: Miscellaneous RPM flags
22 # ALL: default targets
24 # If INITIAL is different than TAG, PatchSets will be generated
25 # automatically with cvsps(1) to bring Source0 up to TAG. If TAG is
26 # HEAD, a %{date} variable will be defined in the generated spec
27 # file. If a Patch: tag in the spec file matches a generated PatchSet
28 # number, the name of the patch will be as specified. Otherwise, the
29 # name of the patch will be the PatchSet number. %patch tags in the
30 # spec file are generated automatically.
36 CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
38 # By default, the naming convention for built RPMS is
39 # <name>-<version>-<release>.planetlab.<arch>.rpm
40 # Set PLDISTRO on the command line to differentiate between downstream
48 kernel-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
49 kernel-MODULE := linux-2.6
50 kernel-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
57 vnet-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
59 vnet-SPEC := vnet/vnet.spec
62 # Build kernel first so we can bootstrap off of its build
69 util-vserver-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
70 util-vserver-MODULE := util-vserver
71 util-vserver-SPEC := util-vserver/util-vserver.spec
78 lkcdutils-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
79 lkcdutils-MODULE := lkcdutils
80 lkcdutils-SPEC := lkcdutils/spec/lkcdutils.spec
83 # Build kernel first so we can bootstrap off of its build
90 yum-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
92 yum-SPEC := yum/yum.spec
99 ksymoops-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
100 ksymoops-INITIAL := ksymoops-2_4_9
101 ksymoops-MODULE := ksymoops
102 ksymoops-SPEC := ksymoops/ksymoops.spec
109 PlanetLabAccounts-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
110 PlanetLabAccounts-MODULE := PlanetLabAccounts
111 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
112 ALL += PlanetLabAccounts
118 NodeUpdate-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
119 NodeUpdate-MODULE := NodeUpdate
120 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
127 PlanetLabConf-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
128 PlanetLabConf-MODULE := PlanetLabConf
129 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
136 PlanetLabKeys-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
137 PlanetLabKeys-MODULE := PlanetLabKeys
138 PlanetLabKeys-SPEC := PlanetLabKeys/PlanetLabKeys.spec
145 ipod-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
147 ipod-SPEC := ipod/ipod.spec
154 sudo-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
156 sudo-SPEC := sudo/planetlab_sudo.spec
163 pycurl-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
164 pycurl-MODULE := pycurl
165 pycurl-SPEC := pycurl/pycurl.spec
172 BootServerRequest-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
173 BootServerRequest-MODULE := BootServerRequest
174 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
175 ALL += BootServerRequest
181 PlanetLabID-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
182 PlanetLabID-MODULE := PlanetLabID
183 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
190 sidewinder-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
191 sidewinder-MODULE := sidewinder
192 sidewinder-SPEC := sidewinder/sidewinder.spec
199 pl_sshd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
200 pl_sshd-MODULE := pl_sshd
201 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
205 # Resource Management Tools
208 resman-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
209 resman-MODULE := resman
210 resman-SPEC := resman/resman.spec
214 # Proper: Privileged Operations Service
217 proper-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
218 proper-MODULE := proper
219 proper-SPEC := proper/proper.spec
226 ulogd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
227 ulogd-MODULE := ulogd
228 ulogd-SPEC := ulogd/ulogd.spec
237 netflow-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
238 netflow-MODULE := netflow
239 netflow-SPEC := netflow/netflow.spec
243 # PlanetLab Mom: Cleans up your mess
246 pl_mom-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
247 pl_mom-MODULE := pl_mom
248 pl_mom-SPEC := pl_mom/pl_mom.spec
255 iptables-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
256 iptables-MODULE := iptables
257 iptables-SPEC := iptables/iptables.spec
266 kexec-tools-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
267 kexec-tools-MODULE := kexec-tools
268 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
275 util-python-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
276 util-python-MODULE := util-python
277 util-python-SPEC := util-python/util-python.spec
280 # proper and util-vserver both use scripts in util-python for building
282 util-vserver: util-python
288 vserver-reference-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
289 vserver-reference-MODULE := vserver-reference
290 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
291 # Package must be built as root
292 vserver-reference-RPMBUILD := sudo rpmbuild
293 ALL += vserver-reference
295 # vserver-reference may require current packages
296 vserver-reference: $(filter-out vserver-reference,$(ALL))
298 # ...and the yum manifest
299 vserver-reference: RPMS/yumgroups.xml
305 bootmanager-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
306 bootmanager-MODULE := bootmanager
307 bootmanager-SPEC := bootmanager/bootmanager.spec
308 bootmanager-RPMBUILD := sudo rpmbuild
311 # bootmanager requires current packages
312 bootmanager: $(filter-out bootmanager,$(ALL))
314 # ...and the yum manifest
315 bootmanager: RPMS/yumgroups.xml
321 bootcd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
322 bootcd-MODULE := bootcd_v3
323 bootcd-SPEC := bootcd_v3/bootcd.spec
324 bootcd-RPMBUILD := sudo rpmbuild
327 # bootcd requires current packages
328 bootcd: $(filter-out bootcd,$(ALL))
330 # ...and the yum manifest
331 bootcd: RPMS/yumgroups.xml
333 ifeq ($(findstring $(package),$(ALL)),)
337 # Create package manifest
338 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/SRPMS" SRPMS > SRPMS/packages.xml
341 install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
349 # Upload packages to boot server
350 SERVER := build@boot.planet-lab.org
351 ARCHIVE := /var/www/html/install-rpms/archive
353 # Put nightly alpha builds in a subdirectory
355 ARCHIVE := $(ARCHIVE)/planetlab-alpha
356 REPOS := /var/www/html/install-rpms/planetlab-alpha
361 @echo make install is only meant to be called from ./build.sh
365 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
367 # Populate repository
368 ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS
369 rsync --delete --links --perms --times --group --compress --rsh=ssh \
370 $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*))) $(SERVER):$(ARCHIVE)/$(BASE)/RPMS/
371 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS >/dev/null
372 rsync --delete --links --perms --times --group --compress --rsh=ssh \
373 $(wildcard SRPMS/*) $(SERVER):$(ARCHIVE)/$(BASE)/SRPMS/
374 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
376 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
377 if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
378 ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE)/RPMS/ $(REPOS) ; \
383 # Remove files generated by this package
384 $(foreach package,$(ALL),$(package)-clean): %-clean:
385 $(MAKE) package=$* clean
387 # Remove all generated files
389 rm -rf BUILD RPMS SOURCES SPECS SRPMS .rpmmacros .cvsps tmp
391 .PHONY: all $(ALL) $(foreach package,$(ALL),$(package)-clean) clean
395 # Define variables for Makerules
396 CVSROOT := $(if $($(package)-CVSROOT),$($(package)-CVSROOT),$(CVSROOT))
397 INITIAL := $(if $($(package)-INITIAL),$($(package)-INITIAL),$(INITIAL))
398 TAG := $(if $($(package)-TAG),$($(package)-TAG),$(TAG))
399 MODULE := $($(package)-MODULE)
400 SPEC := $($(package)-SPEC)
401 RPMFLAGS := $($(package)-RPMFLAGS)
402 RPMBUILD := $(if $($(package)-RPMBUILD),$($(package)-RPMBUILD),rpmbuild)
403 CVS_RSH := $(if $($(package)-CVS_RSH),$($(package)-CVS_RSH),ssh)