- proper uses scripts in util-python for building
[build.git] / plc.mk
1 #
2 # PlanetLab Central local RPM generation
3 #
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2003-2005 The Trustees of Princeton University
6 #
7 # $Id: plc.mk,v 1.4 2005/07/14 18:13:43 mlhuang Exp $
8 #
9
10 # Default target
11 all:
12
13 #
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 # RPMFLAGS: Miscellaneous RPM flags
20 # CVS_RSH: If not ssh
21 # ALL: default targets
22 #
23 # If INITIAL is different than TAG, PatchSets will be generated
24 # automatically with cvsps(1) to bring Source0 up to TAG. If TAG is
25 # HEAD, a %{date} variable will be defined in the generated spec
26 # file. If a Patch: tag in the spec file matches a generated PatchSet
27 # number, the name of the patch will be as specified. Otherwise, the
28 # name of the patch will be the PatchSet number. %patch tags in the
29 # spec file are generated automatically.
30 #
31
32 # Default values
33 INITIAL := HEAD
34 TAG := HEAD
35 CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
36
37 #
38 # plc
39 #
40
41 plc-CVSROOT := :ext:cvs.planet-lab.org:/cvs
42 plc-MODULE := plc
43 plc-SPEC := plc/plc.spec
44 ALL += plc
45
46 #
47 # Proper: Privileged Operations Service
48 #
49
50 proper-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
51 proper-MODULE := proper
52 proper-SPEC := proper/proper.spec
53 ALL += proper
54
55 #
56 # util-python
57 #
58 util-python-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
59 util-python-MODULE := util-python
60 util-python-SPEC := util-python/util-python.spec
61 ALL += util-python
62
63 # proper and util-vserver both use scripts in util-python for building
64 proper: util-python
65 util-vserver: util-python
66
67 #
68 # ulogd
69 #
70
71 ulogd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
72 ulogd-MODULE := ulogd
73 ulogd-SPEC := ulogd/ulogd.spec
74 ALL += ulogd
75
76 ulogd: proper
77
78 #
79 # netflow
80 #
81
82 netflow-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
83 netflow-MODULE := netflow
84 netflow-SPEC := netflow/netflow.spec
85 ALL += netflow
86
87 #
88 # Request Tracker 3
89 #
90
91 rt3-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
92 rt3-MODULE := rt3
93 rt3-SPEC := rt3/etc/rt.spec
94 ALL += rt3
95
96 #
97 # Mail::SpamAssassin
98 #
99
100 spamassassin-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
101 spamassassin-MODULE := spamassassin
102 spamassassin-SPEC := spamassassin/spamassassin.spec
103 ALL += spamassassin
104
105 #
106 # TWiki
107 #
108
109 twiki-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
110 twiki-MODULE := twiki
111 twiki-SPEC := twiki/TWiki.spec
112 ALL += twiki
113
114 ifeq ($(findstring $(package),$(ALL)),)
115
116 # Build all packages
117 all: $(ALL)
118         install -D -m 644 groups/stock_fc2_groups.xml RPMS/yumgroups.xml
119
120 # Recurse
121 $(ALL):
122         $(MAKE) -f plc.mk package=$@
123
124 # Put packages in boot repository
125 ARCHIVE := /var/www/html/archive
126
127 # Put nightly alpha builds in a subdirectory
128 ifeq ($(TAG),HEAD)
129 ARCHIVE := $(ARCHIVE)/plc-alpha
130 REPOS := /var/www/html/plc-alpha
131 endif
132
133 install:
134 ifeq ($(BASE),)
135         @echo make install is only meant to be called from ./build.sh
136 else
137 ifneq ($(BUILDS),)
138         # Remove old runs
139         cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf
140 endif
141         # Populate repository
142         mkdir -p $(ARCHIVE)/$(BASE)
143         rsync --delete --links --perms --times --group \
144             $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*))) $(ARCHIVE)/$(BASE)/
145         yum-arch $(ARCHIVE)/$(BASE) >/dev/null
146 ifeq ($(TAG),HEAD)
147         ln -nsf $(ARCHIVE)/$(BASE) $(REPOS)
148 endif
149 endif
150
151 # Remove files generated by this package
152 $(foreach package,$(ALL),$(package)-clean): %-clean:
153         $(MAKE) -f plc.mk package=$* clean
154
155 # Remove all generated files
156 clean:
157         rm -rf BUILD RPMS SOURCES SPECS SRPMS .rpmmacros .cvsps
158
159 .PHONY: all $(ALL) $(foreach package,$(ALL),$(package)-clean) clean
160
161 else
162
163 # Define variables for Makerules
164 CVSROOT := $(if $($(package)-CVSROOT),$($(package)-CVSROOT),$(CVSROOT))
165 INITIAL := $(if $($(package)-INITIAL),$($(package)-INITIAL),$(INITIAL))
166 TAG := $(if $($(package)-TAG),$($(package)-TAG),$(TAG))
167 MODULE := $($(package)-MODULE)
168 SPEC := $($(package)-SPEC)
169 RPMFLAGS := $($(package)-RPMFLAGS)
170 CVS_RSH := $(if $($(package)-CVS_RSH),$($(package)-CVS_RSH),ssh)
171
172 include Makerules
173
174 endif