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.6 2005/09/14 19:21:22 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 plc-CVSROOT := :ext:cvs.planet-lab.org:/cvs
50 plc-SPEC := plc/plc.spec
54 # Proper: Privileged Operations Service
57 proper-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
58 proper-MODULE := proper
59 proper-SPEC := proper/proper.spec
65 util-python-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
66 util-python-MODULE := util-python
67 util-python-SPEC := util-python/util-python.spec
70 # proper and util-vserver both use scripts in util-python for building
72 util-vserver: util-python
78 ulogd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
80 ulogd-SPEC := ulogd/ulogd.spec
89 netflow-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
90 netflow-MODULE := netflow
91 netflow-SPEC := netflow/netflow.spec
98 rt3-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
100 rt3-SPEC := rt3/etc/rt.spec
107 spamassassin-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
108 spamassassin-MODULE := spamassassin
109 spamassassin-SPEC := spamassassin/spamassassin.spec
116 twiki-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
117 twiki-MODULE := twiki
118 twiki-SPEC := twiki/TWiki.spec
121 ifeq ($(findstring $(package),$(ALL)),)
125 install -D -m 644 groups/stock_fc2_groups.xml RPMS/yumgroups.xml
129 $(MAKE) -f plc.mk package=$@
131 # Put packages in boot repository
132 ARCHIVE := /var/www/html/archive
134 # Put nightly alpha builds in a subdirectory
136 ARCHIVE := $(ARCHIVE)/plc-alpha
137 REPOS := /var/www/html/plc-alpha
142 @echo make install is only meant to be called from ./build.sh
146 cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf
148 # Populate repository
149 mkdir -p $(ARCHIVE)/$(BASE)
150 rsync --delete --links --perms --times --group \
151 $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*))) $(ARCHIVE)/$(BASE)/
152 yum-arch $(ARCHIVE)/$(BASE) >/dev/null
154 ln -nsf $(ARCHIVE)/$(BASE) $(REPOS)
158 # Remove files generated by this package
159 $(foreach package,$(ALL),$(package)-clean): %-clean:
160 $(MAKE) -f plc.mk package=$* clean
162 # Remove all generated files
164 rm -rf BUILD RPMS SOURCES SPECS SRPMS .rpmmacros .cvsps
166 .PHONY: all $(ALL) $(foreach package,$(ALL),$(package)-clean) clean
170 # Define variables for Makerules
171 CVSROOT := $(if $($(package)-CVSROOT),$($(package)-CVSROOT),$(CVSROOT))
172 INITIAL := $(if $($(package)-INITIAL),$($(package)-INITIAL),$(INITIAL))
173 TAG := $(if $($(package)-TAG),$($(package)-TAG),$(TAG))
174 MODULE := $($(package)-MODULE)
175 SPEC := $($(package)-SPEC)
176 RPMBUILD := $(if $($(package)-RPMBUILD),$($(package)-RPMBUILD),rpmbuild)
177 RPMFLAGS := $($(package)-RPMFLAGS)
178 CVS_RSH := $(if $($(package)-CVS_RSH),$($(package)-CVS_RSH),ssh)