2 # PlanetLab Central local RPM generation
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2003-2005 The Trustees of Princeton University
7 # $Id: plc.mk,v 1.2.2.10 2005/07/18 22:17:12 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 plc-CVSROOT := :ext:cvs.planet-lab.org:/cvs
44 plc-SPEC := plc/plc.spec
48 # Proper: Privileged Operations Service
51 proper-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
52 proper-MODULE := proper
53 proper-SPEC := proper/proper.spec
59 util-python-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
60 util-python-MODULE := util-python
61 util-python-SPEC := util-python/util-python.spec
64 # proper and util-vserver both use scripts in util-python for building
66 util-vserver: util-python
72 ulogd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
74 ulogd-SPEC := ulogd/ulogd.spec
83 netflow-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
84 netflow-MODULE := netflow
85 netflow-SPEC := netflow/netflow.spec
92 rt3-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
94 rt3-SPEC := rt3/etc/rt.spec
101 spamassassin-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
102 spamassassin-MODULE := spamassassin
103 spamassassin-SPEC := spamassassin/spamassassin.spec
110 twiki-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
111 twiki-MODULE := twiki
112 twiki-SPEC := twiki/TWiki.spec
115 ifeq ($(findstring $(package),$(ALL)),)
119 install -D -m 644 groups/stock_fc2_groups.xml RPMS/yumgroups.xml
123 $(MAKE) -f plc.mk package=$@
125 # Put packages in boot repository
126 ARCHIVE := /var/www/html/archive
128 # Put nightly alpha builds in a subdirectory
130 ARCHIVE := $(ARCHIVE)/plc-alpha
131 REPOS := /var/www/html/plc-alpha
136 @echo make install is only meant to be called from ./build.sh
140 cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf
142 # Populate repository
143 mkdir -p $(ARCHIVE)/$(BASE)
144 rsync --delete --links --perms --times --group \
145 $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*))) $(ARCHIVE)/$(BASE)/
146 yum-arch $(ARCHIVE)/$(BASE) >/dev/null
148 ln -nsf $(ARCHIVE)/$(BASE) $(REPOS)
152 # Remove files generated by this package
153 $(foreach package,$(ALL),$(package)-clean): %-clean:
154 $(MAKE) -f plc.mk package=$* clean
156 # Remove all generated files
158 rm -rf BUILD RPMS SOURCES SPECS SRPMS .rpmmacros .cvsps
160 .PHONY: all $(ALL) $(foreach package,$(ALL),$(package)-clean) clean
164 # Define variables for Makerules
165 CVSROOT := $(if $($(package)-CVSROOT),$($(package)-CVSROOT),$(CVSROOT))
166 INITIAL := $(if $($(package)-INITIAL),$($(package)-INITIAL),$(INITIAL))
167 TAG := $(if $($(package)-TAG),$($(package)-TAG),$(TAG))
168 MODULE := $($(package)-MODULE)
169 SPEC := $($(package)-SPEC)
170 RPMBUILD := $(if $($(package)-RPMBUILD),$($(package)-RPMBUILD),rpmbuild)
171 RPMFLAGS := $($(package)-RPMFLAGS)
172 CVS_RSH := $(if $($(package)-CVS_RSH),$($(package)-CVS_RSH),ssh)