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.79 2005/09/04 17:37:36 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
42 kernel-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
43 kernel-MODULE := linux-2.6
44 kernel-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
51 vnet-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
53 vnet-SPEC := vnet/vnet.spec
56 # Build kernel first so we can bootstrap off of its build
63 util-vserver-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
64 util-vserver-MODULE := util-vserver
65 util-vserver-SPEC := util-vserver/util-vserver.spec
72 lkcdutils-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
73 lkcdutils-MODULE := lkcdutils
74 lkcdutils-SPEC := lkcdutils/spec/lkcdutils.spec
77 # Build kernel first so we can bootstrap off of its build
84 yum-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
86 yum-SPEC := yum/yum.spec
93 ksymoops-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
94 ksymoops-INITIAL := ksymoops-2_4_9
95 ksymoops-MODULE := ksymoops
96 ksymoops-SPEC := ksymoops/ksymoops.spec
103 PlanetLabAccounts-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
104 PlanetLabAccounts-MODULE := PlanetLabAccounts
105 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
106 ALL += PlanetLabAccounts
112 NodeUpdate-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
113 NodeUpdate-MODULE := NodeUpdate
114 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
121 PlanetLabConf-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
122 PlanetLabConf-MODULE := PlanetLabConf
123 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
130 PlanetLabKeys-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
131 PlanetLabKeys-MODULE := PlanetLabKeys
132 PlanetLabKeys-SPEC := PlanetLabKeys/PlanetLabKeys.spec
139 ipod-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
141 ipod-SPEC := ipod/ipod.spec
148 sudo-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
150 sudo-SPEC := sudo/planetlab_sudo.spec
157 pycurl-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
158 pycurl-MODULE := pycurl
159 pycurl-SPEC := pycurl/pycurl.spec
166 BootServerRequest-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
167 BootServerRequest-MODULE := BootServerRequest
168 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
169 ALL += BootServerRequest
175 PlanetLabID-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
176 PlanetLabID-MODULE := PlanetLabID
177 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
184 sidewinder-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
185 sidewinder-MODULE := sidewinder
186 sidewinder-SPEC := sidewinder/sidewinder.spec
193 pl_sshd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
194 pl_sshd-MODULE := pl_sshd
195 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
199 # Resource Management Tools
202 resman-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
203 resman-MODULE := resman
204 resman-SPEC := resman/resman.spec
208 # Proper: Privileged Operations Service
211 proper-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
212 proper-MODULE := proper
213 proper-SPEC := proper/proper.spec
220 ulogd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
221 ulogd-MODULE := ulogd
222 ulogd-SPEC := ulogd/ulogd.spec
231 netflow-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
232 netflow-MODULE := netflow
233 netflow-SPEC := netflow/netflow.spec
237 # PlanetLab Mom: Cleans up your mess
240 pl_mom-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
241 pl_mom-MODULE := pl_mom
242 pl_mom-SPEC := pl_mom/pl_mom.spec
249 iptables-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
250 iptables-MODULE := iptables
251 iptables-SPEC := iptables/iptables.spec
260 kexec-tools-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
261 kexec-tools-MODULE := kexec-tools
262 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
269 util-python-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
270 util-python-MODULE := util-python
271 util-python-SPEC := util-python/util-python.spec
274 # proper and util-vserver both use scripts in util-python for building
276 util-vserver: util-python
282 vserver-reference-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
283 vserver-reference-MODULE := vserver-reference
284 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
285 # Package must be built as root
286 vserver-reference-RPMBUILD := sudo rpmbuild
287 ALL += vserver-reference
289 # vserver-reference may require current packages
290 vserver-reference: $(filter-out vserver-reference,$(ALL))
292 # ...and the yum manifest
293 vserver-reference: RPMS/yumgroups.xml
299 bootmanager-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
300 bootmanager-MODULE := bootmanager
301 bootmanager-SPEC := bootmanager/bootmanager.spec
302 bootmanager-RPMBUILD := sudo rpmbuild
305 # bootmanager requires current packages
306 bootmanager: $(filter-out bootmanager,$(ALL))
308 # ...and the yum manifest
309 bootmanager: RPMS/yumgroups.xml
315 bootcd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
316 bootcd-MODULE := bootcd_v3
317 bootcd-SPEC := bootcd_v3/bootcd.spec
318 bootcd-RPMBUILD := sudo rpmbuild
321 # bootcd requires current packages
322 bootcd: $(filter-out bootcd,$(ALL))
324 # ...and the yum manifest
325 bootcd: RPMS/yumgroups.xml
327 ifeq ($(findstring $(package),$(ALL)),)
331 # Create package manifest
332 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/SRPMS" SRPMS > SRPMS/packages.xml
335 install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
343 # Upload packages to boot server
344 SERVER := build@boot.planet-lab.org
345 ARCHIVE := /var/www/html/install-rpms/archive
347 # Put nightly alpha builds in a subdirectory
349 ARCHIVE := $(ARCHIVE)/planetlab-alpha
350 REPOS := /var/www/html/install-rpms/planetlab-alpha
355 @echo make install is only meant to be called from ./build.sh
359 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
361 # Populate repository
362 ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS
363 rsync --delete --links --perms --times --group --compress --rsh=ssh \
364 $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*))) $(SERVER):$(ARCHIVE)/$(BASE)/RPMS/
365 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS >/dev/null
366 rsync --delete --links --perms --times --group --compress --rsh=ssh \
367 $(wildcard SRPMS/*) $(SERVER):$(ARCHIVE)/$(BASE)/SRPMS/
368 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
370 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
371 if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
372 ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE)/RPMS/ $(REPOS) ; \
377 # Remove files generated by this package
378 $(foreach package,$(ALL),$(package)-clean): %-clean:
379 $(MAKE) package=$* clean
381 # Remove all generated files
383 rm -rf BUILD RPMS SOURCES SPECS SRPMS .rpmmacros .cvsps tmp
385 .PHONY: all $(ALL) $(foreach package,$(ALL),$(package)-clean) clean
389 # Define variables for Makerules
390 CVSROOT := $(if $($(package)-CVSROOT),$($(package)-CVSROOT),$(CVSROOT))
391 INITIAL := $(if $($(package)-INITIAL),$($(package)-INITIAL),$(INITIAL))
392 TAG := $(if $($(package)-TAG),$($(package)-TAG),$(TAG))
393 MODULE := $($(package)-MODULE)
394 SPEC := $($(package)-SPEC)
395 RPMFLAGS := $($(package)-RPMFLAGS)
396 RPMBUILD := $(if $($(package)-RPMBUILD),$($(package)-RPMBUILD),rpmbuild)
397 CVS_RSH := $(if $($(package)-CVS_RSH),$($(package)-CVS_RSH),ssh)