- add twiki to internal build
[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.1 2005/05/04 21:47:56 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 # ulogd
57 #
58
59 ulogd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
60 ulogd-MODULE := ulogd
61 ulogd-SPEC := ulogd/ulogd.spec
62 ALL += ulogd
63
64 ulogd: proper
65
66 #
67 # netflow
68 #
69
70 netflow-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
71 netflow-MODULE := netflow
72 netflow-SPEC := netflow/netflow.spec
73 ALL += netflow
74
75 #
76 # Request Tracker 3
77 #
78
79 rt3-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
80 rt3-MODULE := rt3
81 rt3-SPEC := rt3/etc/rt.spec
82 ALL += rt3
83
84 #
85 # Mail::SpamAssassin
86 #
87
88 spamassassin-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
89 spamassassin-MODULE := spamassassin
90 spamassassin-SPEC := spamassassin/spamassassin.spec
91 ALL += spamassassin
92
93 #
94 # TWiki
95 #
96
97 twiki-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
98 twiki-MODULE := twiki
99 twiki-SPEC := twiki/TWiki.spec
100 ALL += twiki
101
102 ifeq ($(findstring $(package),$(ALL)),)
103
104 # Build all packages
105 all: $(ALL)
106         cvs -d $(CVSROOT) checkout -p alpina/groups/stock_fc2_groups.xml > RPMS/yumgroups.xml
107
108 # Recurse
109 $(ALL):
110         $(MAKE) -f plc.mk package=$@
111
112 # Put packages in boot repository
113 ARCHIVE := /var/www/html/archive
114
115 # Put nightly alpha builds in a subdirectory
116 ifeq ($(TAG),HEAD)
117 ARCHIVE := $(ARCHIVE)/plc-alpha
118 REPOS := /var/www/html/plc-alpha
119 endif
120
121 install:
122 ifeq ($(BASE),)
123         @echo make install is only meant to be called from ./build.sh
124 else
125 ifneq ($(BUILDS),)
126         # Remove old runs
127         cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf
128 endif
129         # Populate repository
130         mkdir -p $(ARCHIVE)/$(BASE)
131         rsync --links --perms --times --group \
132             $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*))) $(ARCHIVE)/$(BASE)/
133         yum-arch $(ARCHIVE)/$(BASE) >/dev/null
134 ifeq ($(TAG),HEAD)
135         ln -nsf $(ARCHIVE)/$(BASE) $(REPOS)
136 endif
137 endif
138
139 # Remove files generated by this package
140 $(foreach package,$(ALL),$(package)-clean): %-clean:
141         $(MAKE) -f plc.mk package=$* clean
142
143 # Remove all generated files
144 clean:
145         rm -rf BUILD RPMS SOURCES SPECS SRPMS .rpmmacros .cvsps
146
147 .PHONY: all $(ALL) $(foreach package,$(ALL),$(package)-clean) clean
148
149 else
150
151 # Define variables for Makerules
152 CVSROOT := $(if $($(package)-CVSROOT),$($(package)-CVSROOT),$(CVSROOT))
153 INITIAL := $(if $($(package)-INITIAL),$($(package)-INITIAL),$(INITIAL))
154 TAG := $(if $($(package)-TAG),$($(package)-TAG),$(TAG))
155 MODULE := $($(package)-MODULE)
156 SPEC := $($(package)-SPEC)
157 RPMFLAGS := $($(package)-RPMFLAGS)
158 CVS_RSH := $(if $($(package)-CVS_RSH),$($(package)-CVS_RSH),ssh)
159
160 include Makerules
161
162 endif