handle monitorconfig.py correctly
[monitor.git] / monitor-server.spec
1 #
2 # $Id$
3
4
5 %define url $URL: svn+ssh://svn.planet-lab.org/svn/Monitor/trunk/Monitor-server.spec $
6
7 %define name monitor-server
8 %define version 1.0
9 %define taglevel 5
10
11 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
12
13 Summary: Monitor backend scripts for server
14 Name: %{name}
15 Version: %{version}
16 Release: %{release}
17 Source0: %{name}-%{version}.tar.bz2
18 License: GPL
19 Group: Applications/System
20 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
21
22 Vendor: PlanetLab
23 Packager: PlanetLab Central <support@planet-lab.org>
24 Distribution: PlanetLab %{plrelease}
25 URL: %(echo %{url} | cut -d ' ' -f 2)
26
27 Requires: curl
28 Requires: coreutils
29 Requires: PLCWWW >= 4.2
30
31 %description
32 Scripts for polling PLC, the node, and PCU status.  Also a collection of
33 command-line utilities for querying the status database. 
34
35 %prep
36 %setup -q
37
38 %build
39 # TODO: note that we should build the cmdamt/ with g++
40 echo "There is no build stage.  Simply copy files."
41
42 %install
43
44 rm -rf $RPM_BUILD_ROOT
45 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
46 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
47 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
48
49 echo " * Installing core scripts"
50 rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
51           ./ $RPM_BUILD_ROOT/usr/share/%{name}/
52
53 echo " * Installing web pages"
54 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
55
56 echo " * TODO: Installing cron job for automated polling"
57 install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}
58 echo " * TODO: Setting up Monitor account in local MyPLC"
59
60 cp /usr/share/%{name}/monitorconfig-default.py /usr/share/%{name}/monitorconfig.py
61
62 %clean
63 rm -rf $RPM_BUILD_ROOT
64
65 %files
66 %defattr(-,root,root)
67 %config /usr/share/%{name}/monitorconfig.py
68 /usr/share/%{name}
69 /var/lib/%{name}
70 /var/www/cgi-bin/monitor
71 %{_sysconfdir}/cron.d/%{name}
72
73 %post
74 echo "Post processing"
75 # TODO: this will be nice when we have a web-based service running., such as
76 #               an API server or so on.
77 #chkconfig --add monitor-server
78 #chkconfig monitor-server on
79
80 %changelog
81 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
82 - initial creation of server-side package