import repository from arizona
[raven.git] / owl / client / Makefile
1
2 #REPO=localhost
3 REPO=quake.cs.arizona.edu
4 OWL_VERSION=`chmod +x owl; ./owl --version | awk '{print $$2}'`
5
6 OWL_SCRIPTS = basic uptime owl processes
7
8 OWL_CONFIG_FILES= $(OWL_SCRIPTS:%=conf.d/%.conf)
9 OWL_SCRIPT_FILES= $(OWL_SCRIPTS:%=scripts.d/%)
10
11 PL_SCRIPTS = planetlab sfa slice memory mapviewer
12 PL_CONFIG_FILES= $(PL_SCRIPTS:%=conf.d/%.conf)
13 PL_SCRIPT_FILES= $(PL_SCRIPTS:%=scripts.d/%)
14
15 PLANETLAB_CONFIGS=conf.d/planetlab.conf conf.d/sfa.conf conf.d/slice.conf conf.d/memory.conf
16 PLANETLAB_SCRIPTS= scripts.d/
17
18 RPM_DIR=RPMS
19
20 OWL_URL = http://owl.cs.arizona.edu
21
22 TMPDIR := $(shell mktemp -d)
23
24 rpms: rpm
25
26 rpm: RPMS/owl.rpm RPMS/owl-scripts.rpm RPMS/owl-config.rpm RPMS/owl-lib.rpm RPMS/owl-scripts-planetlab.rpm RPMS/owl-config-beta.rpm RPMS/owl-config-alpha.rpm
27
28 owl.man: owl owl.x
29         chmod +x ./owl
30         help2man -o $@ --include owl.x --no-info --section 8 ./owl
31
32 owl.man.html: owl.man
33         man2html $< > $@
34
35 owl.html: owl.py
36         pydoc -w ./$<
37
38 test::
39         ./owl -d -S -f ./test.conf -b test -c ./conf.d -s ./scripts.d/ -i 10
40
41 RPMS/owl.rpm: TMPDIR := $(shell mktemp -d)
42 RPMS/owl.rpm: owl.man owl autorun.sh owl.init owl.cron owl.man.html
43         mkdir -p $(TMPDIR)/usr/bin $(TMPDIR)/etc/init.d $(TMPDIR)/tmp
44         cp owl $(TMPDIR)/usr/bin
45         chmod +x $(TMPDIR)/usr/bin/owl
46         cp autorun.sh $(TMPDIR)/tmp
47         chmod +x $(TMPDIR)/tmp/autorun.sh
48         cp owl.init $(TMPDIR)/etc/init.d/owl    
49         mkdir -p $(TMPDIR)/usr/share/man/man8/
50         cp owl.man $(TMPDIR)/usr/share/man/man8
51         mkdir -p $(TMPDIR)/etc/cron.daily
52         cp owl.cron $(TMPDIR)/etc/cron.daily
53         chmod +x $(TMPDIR)/etc/cron.daily
54         echo "owl-config >= 0.52" > $(TMPDIR)/.requires
55         echo "owl-scripts" >> $(TMPDIR)/.requires
56         echo "owl-lib >= 0.69" >> $(TMPDIR)/.requires
57         ravenbuilder --rpmversion $(OWL_VERSION) owl $(TMPDIR) $(RPM_DIR) 
58         rm -rf $(TMPDIR)
59
60 RPMS/owl-scripts.rpm: TMPDIR := $(shell mktemp -d)
61 RPMS/owl-scripts.rpm: autorun.sh $(OWL_CONFIG_FILES) $(OWL_SCRIPT_FILES)
62         mkdir -p $(TMPDIR)/etc/owl/conf.d $(TMPDIR)/etc/owl/scripts.d $(TMPDIR)/tmp
63         cp autorun.sh $(TMPDIR)/tmp
64         chmod +x $(TMPDIR)/tmp/autorun.sh
65         cp $(OWL_CONFIG_FILES) $(TMPDIR)/etc/owl/conf.d
66         cp $(OWL_SCRIPT_FILES) $(TMPDIR)/etc/owl/scripts.d
67         cp build/scripts.hash $(TMPDIR)/.hash
68         cp build/scripts.version $(TMPDIR)/.version
69         ravenbuilder owl-scripts $(TMPDIR) $(RPM_DIR)
70         cp $(TMPDIR)/.hash build/scripts.hash
71         cp $(TMPDIR)/.version build/scripts.version
72         rm -rf $(TMPDIR)
73
74 RPMS/owl-scripts-planetlab.rpm: TMPDIR := $(shell mktemp -d)
75 RPMS/owl-scripts-planetlab.rpm: autorun.sh $(PL_CONFIG_FILES) $(PL_SCRIPT_FILES)
76         mkdir -p $(TMPDIR)/etc/owl/conf.d $(TMPDIR)/etc/owl/scripts.d $(TMPDIR)/tmp
77         cp autorun.sh $(TMPDIR)/tmp
78         chmod +x $(TMPDIR)/tmp/autorun.sh
79         cp $(PL_CONFIG_FILES) $(TMPDIR)/etc/owl/conf.d
80         cp $(PL_SCRIPT_FILES) $(TMPDIR)/etc/owl/scripts.d
81         - cp build/pl-scripts.hash $(TMPDIR)/.hash
82         - cp build/pl-scripts.version $(TMPDIR)/.version
83         ravenbuilder owl-scripts-planetlab $(TMPDIR) $(RPM_DIR)
84         cp $(TMPDIR)/.hash build/pl-scripts.hash
85         cp $(TMPDIR)/.version build/pl-scripts.version
86         rm -rf $(TMPDIR)
87
88 owl-production.conf: owl.conf
89         sed s,@URL@,$(OWL_URL)/owl/,g < $^ > $@
90
91 owl-beta.conf: owl.conf
92         sed s,@URL@,$(OWL_URL)/owl_beta/,g < $^ > $@
93
94 owl-alpha.conf: owl.conf
95         sed s,@URL@,$(OWL_URL)/owl_alpha/,g < $^ > $@
96
97 RPMS/owl-config.rpm: TMPDIR := $(shell mktemp -d)
98 RPMS/owl-config.rpm: owl-production.conf autorun.sh
99         mkdir -p $(TMPDIR)/etc/owl $(TMPDIR)/tmp
100         cp owl-production.conf $(TMPDIR)/etc/owl/owl.conf 
101         cp autorun.sh $(TMPDIR)/tmp
102         chmod +x $(TMPDIR)/tmp/autorun.sh
103         cp build/config.version $(TMPDIR)/.version
104         cp build/config.hash $(TMPDIR)/.hash
105         ravenbuilder owl-config $(TMPDIR) $(RPM_DIR)
106         cp $(TMPDIR)/.version build/config.version
107         cp $(TMPDIR)/.hash build/config.hash
108         rm -rf $(TMPDIR)
109
110 RPMS/owl-config-beta.rpm: TMPDIR := $(shell mktemp -d)
111 RPMS/owl-config-beta.rpm: owl-beta.conf autorun.sh
112         mkdir -p $(TMPDIR)/etc/owl $(TMPDIR)/tmp
113         cp owl-beta.conf $(TMPDIR)/etc/owl/owl.conf 
114         cp autorun.sh $(TMPDIR)/tmp
115         chmod +x $(TMPDIR)/tmp/autorun.sh
116         cp build/config-beta.version $(TMPDIR)/.version
117         cp build/config-beta.hash $(TMPDIR)/.hash
118         ravenbuilder owl-config-beta $(TMPDIR) $(RPM_DIR)
119         cp $(TMPDIR)/.version build/config-beta.version
120         cp $(TMPDIR)/.hash build/config-beta.hash
121         rm -rf $(TMPDIR)
122
123 RPMS/owl-config-alpha.rpm: TMPDIR := $(shell mktemp -d)
124 RPMS/owl-config-alpha.rpm: owl-alpha.conf autorun.sh
125         mkdir -p $(TMPDIR)/etc/owl $(TMPDIR)/tmp
126         cp owl-alpha.conf $(TMPDIR)/etc/owl/owl.conf 
127         cp autorun.sh $(TMPDIR)/tmp
128         chmod +x $(TMPDIR)/tmp/autorun.sh
129         cp build/config-alpha.version $(TMPDIR)/.version
130         cp build/config-alpha.hash $(TMPDIR)/.hash
131         ravenbuilder owl-config-alpha $(TMPDIR) $(RPM_DIR)
132         cp $(TMPDIR)/.version build/config-alpha.version
133         cp $(TMPDIR)/.hash build/config-alpha.hash
134         rm -rf $(TMPDIR)
135
136 RPMS/owl-lib.rpm: TMPDIR := $(shell mktemp -d)
137 RPMS/owl-lib.rpm: owl.py setup-owl.py autorun-lib.sh Makefile owl.html
138         mkdir -p $(TMPDIR)/tmp
139         cp owl.py $(TMPDIR)/tmp
140         cp setup-owl.py $(TMPDIR)/tmp
141         cp autorun-lib.sh $(TMPDIR)/tmp/autorun.sh
142         - cp build/lib.version $(TMPDIR)/.version
143         - cp build/lib.hash $(TMPDIR)/.hash
144         ravenbuilder owl-lib $(TMPDIR) $(RPM_DIR)
145         cp $(TMPDIR)/.version build/lib.version
146         cp $(TMPDIR)/.hash build/lib.hash
147         rm -rf $(TMPDIR)
148
149 clean::
150         rm -f *.gz
151
152 distclean: clean
153         rm -f RPMS/*