2 # PlanetLab standard components list
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2003-2006 The Trustees of Princeton University
7 # $Id: planetlab.mk,v 1.71 2007/09/25 18:38:47 faiyaza Exp $
13 # CVSROOT or package-CVSROOT: CVSROOT to use
14 # TAG or package-TAG: CVS tag to use
15 # package-MODULE: CVS module name to use
16 # package-SPEC: RPM spec file template
20 # package-RPMFLAGS: Miscellaneous RPM flags
21 # package-RPMBUILD: If not rpmbuild
22 # package-CVS_RSH: If not ssh
24 # Add to ALL if you want the package built as part of the default set.
31 CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
32 SVNROOT := http://svn.planet-lab.org/svn
35 # Check if a tag has been checked out
36 ifneq ($(wildcard CVS/Root),)
37 # Check if we are able to access CVS
38 CVSTAG := $(shell cvs status planetlab.mk 2>/dev/null | sed -ne 's/[[:space:]]*Sticky Tag:[[:space:]]*\([^[:space:]]*\).*/\1/p')
40 CVSROOT := $(shell cat CVS/Root)
41 ifeq ($(CVSTAG),(none))
53 # Figure out whether we are building on i386 or x86_64 host
54 HOSTARCH := $(shell uname -i)
56 kernel-$(HOSTARCH)-MODULE := linux-2.6
57 kernel-$(HOSTARCH)-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
58 ifeq ($(HOSTARCH),i386)
59 kernel-$(HOSTARCH)-RPMFLAGS:= --target i686
61 kernel-$(HOSTARCH)-RPMFLAGS:= --target $(HOSTARCH)
64 ALL += kernel-$(HOSTARCH)
66 kernel-clean: kernel-$(HOSTARCH)-clean
67 kernel: kernel-$(HOSTARCH)
70 ### Why are we building these?? -F
74 ###madwifi-ng-MODULE := madwifi-ng
75 ###madwifi-ng-SPEC := madwifi-ng/madwifi.spec
78 ### Build kernel first so we can bootstrap off of its build
85 ###ivtv-MODULE := ivtv
86 ###ivtv-SPEC := ivtv/ivtv.spec
93 util-vserver-MODULE := util-vserver
94 util-vserver-SPEC := util-vserver/util-vserver.spec
95 util-vserver-RPMFLAGS:= --without dietlibc
102 NodeUpdate-MODULE := NodeUpdate
103 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
107 # PlanetLabConf: DEPRECATED.
109 # conf_files does the same thing in NM
112 #PlanetLabConf-MODULE := PlanetLabConf
113 #PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
114 #ALL += PlanetLabConf
120 PingOfDeath-MODULE := PingOfDeath
121 PingOfDeath-SPEC := PingOfDeath/ipod.spec
127 # Added functionality provided by this package to www/PlanetLabConf/sudoers.
131 #sudo-SPEC := sudo/planetlab_sudo.spec
137 # [tony] use FC6+ release
140 #curl_vernum := $(shell printf %d 0x$(shell curl-config --vernum))
141 #pycurl_vernum := $(shell printf %d 0x070d01) # 7.13.1
142 #pycurl_incompatnum := $(shell printf %d 0x071000) # 7.16.0
143 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_vernum) && echo 1),1)
144 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_incompatnum) && echo 0),1)
145 #pycurl-MODULE := pycurl
146 #pycurl-SPEC := pycurl/pycurl.spec
152 # BootServerRequest: DEPRECATE
154 # Not used by anything.
157 #BootServerRequest-MODULE := BootServerRequest
158 #BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
159 #ALL += BootServerRequest
166 NodeManager-MODULE := NodeManager
167 NodeManager-SPEC := NodeManager/NodeManager.spec
174 pl_sshd-MODULE := pl_sshd
175 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
181 # Deprecate when vsys takes over [sapan].
182 # keep in build for proper.
185 libhttpd++-MODULE := libhttpd++
186 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
190 # Proper: Privileged Operations Service
193 proper-MODULE := proper
194 proper-SPEC := proper/proper.spec
195 proper-RPMBUILD := sudo bash ./rpmbuild.sh
201 # CoDemux: Port 80 demux
204 codemux-MODULE := codemux
205 codemux-SPEC := codemux/codemux.spec
212 mysql-MODULE := mysql
213 mysql-SPEC := mysql/mysql.spec
220 ulogd-MODULE := ulogd
221 ulogd-SPEC := ulogd/ulogd.spec
224 ulogd: kernel proper #mysql
230 netflow-MODULE := netflow
231 netflow-SPEC := netflow/netflow.spec
237 # PlanetLab Mom: Cleans up your mess
241 MoM-SPEC := MoM/pl_mom.spec
248 iptables-MODULE := iptables
249 iptables-SPEC := iptables/iptables.spec
258 iproute-MODULE := iproute2
259 iproute-SPEC := iproute2/iproute.spec
263 # kexec-tools: DEPRECATE
265 # [marc] use FC6+ release
268 #kexec-tools-MODULE := kexec-tools
269 #kexec-tools-SPEC := kexec-tools/kexec-tools.spec
275 # [marc] deprecate server.py
277 # I dont know what the above means... Daniel says we need to seperate util-vserver from
278 # pl specific utilities (vuseradd, etc) which may or may not include vserver.py. Until then,
279 # I'm keeping this in the build. -F
282 util-python-MODULE := util-python
283 util-python-SPEC := util-python/util-python.spec
286 # proper and util-vserver both use scripts in util-python for building
288 util-vserver: util-python
289 #PlanetLabAuth: util-python
295 PLCAPI-MODULE := new_plc_api
296 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
303 PLCWWW-MODULE := new_plc_www
304 PLCWWW-SPEC := new_plc_www/PLCWWW.spec
311 VserverReference-MODULE := VserverReference build
312 VserverReference-SPEC := VserverReference/vserver-reference.spec
313 # Package must be built as root
314 VserverReference-RPMBUILD := sudo bash ./rpmbuild.sh
315 ALL += VserverReference
317 # vserver-reference may require current packages
318 vserver-reference: $(filter-out vserver-reference,$(ALL))
324 BootManager-MODULE := BootManager build
325 BootManager-SPEC := BootManager/BootManager.spec
326 BootManager-RPMBUILD := sudo bash ./rpmbuild.sh
329 # BootManager requires current packages
330 BootManager: $(filter-out BootManager,$(ALL))
332 # ...and the yum manifest
333 BootManager: RPMS/yumgroups.xml
339 BootCD-MODULE := BootCD build bootmanager
340 BootCD-SPEC := BootCD/BootCD.spec
341 BootCD-RPMBUILD := sudo bash ./rpmbuild.sh
344 # BootCD requires current packages
345 BootCD: $(filter-out BootCD,$(ALL))
351 MyPLC-MODULE := build MyPLC new_plc_www plc/scripts
352 MyPLC-SPEC := MyPLC/myplc.spec
353 # Package must be built as root
354 MyPLC-RPMBUILD := sudo bash ./rpmbuild.sh
357 # MyPLC may require current packages
358 MyPLC: $(filter-out MyPLC,$(ALL))
360 # ...and the yum manifest
361 MyPLC: RPMS/yumgroups.xml
364 # MyPLC development environment
367 myplc-devel-MODULE := build myplc
368 myplc-devel-SPEC := MyPLC/myplc-devel.spec
369 # Package must be built as root
370 myplc-devel-RPMBUILD := sudo bash ./rpmbuild.sh
377 myplc-native-MODULE := build MyPLC plc/scripts
378 myplc-native-SPEC := MyPLC/myplc-native.spec
379 # Package must be built as root
380 myplc-native-RPMBUILD := sudo bash ./rpmbuild.sh
383 # MyPLC may require current packages
384 myplc-native: $(filter-out MyPLC,$(ALL))
386 # ...and the yum manifest
387 myplc-native: RPMS/yumgroups.xml
393 # [daniel] wait for latest Fedora release
394 # (03:29:46 PM) daniel_hozac: interfacing with the kernel directly when dealing with netlink was fugly, so... i had to find something nicer.
395 # (03:29:53 PM) daniel_hozac: the one in Fedora is lacking certain APIs i need.
398 libnl-MODULE := libnl
399 libnl-SPEC := libnl/libnl.spec
408 # Upload packages to boot server
409 SERVERA := build@boot1.planet-lab.org
410 SERVERB := build@boot2.planet-lab.org
411 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
413 # Put nightly alpha builds in a subdirectory
415 ARCHIVE := $(ARCHIVE)/planetlab-alpha
416 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
420 install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
424 @echo make install is only meant to be called from ./build.sh
426 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
427 # Sign all RPMS. setsid detaches rpm from the terminal,
428 # allowing the (hopefully blank) GPG password to be entered
429 # from stdin instead of /dev/tty. Obviously, the build server
432 --define "_signature gpg" \
433 --define "_gpg_path /etc/planetlab" \
434 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
435 --resign RPMS/*/*.rpm
439 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
440 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
442 # Create package manifest
443 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
444 # Update yum metadata
445 yum-arch RPMS >/dev/null
446 createrepo -g yumgroups.xml RPMS >/dev/null
447 # Populate repository
449 --exclude '*-debuginfo-*' \
450 --recursive --links --perms --times --group --compress --rsh=ssh \
451 RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
453 --exclude '*-debuginfo-*' \
454 --recursive --links --perms --times --group --compress --rsh=ssh \
455 RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
457 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
458 if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
459 ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
461 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
462 if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
463 ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \