add spec files for the server-side rpm package of monitor
[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 echo "There is no build stage.  Simply copy files."
40
41 %install
42
43 rm -rf $RPM_BUILD_ROOT
44 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
45 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}/archive-pdb
46 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
47
48 echo " * Installing core scripts"
49 rsync -a --exclude www --exclude archive-pdb \
50       --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 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63 %files
64 %defattr(-,root,root)
65 # define a %config entry for /var/share/%{name}/xyz?
66 /usr/share/%{name}
67 /var/www/cgi-bin/monitor
68 %{_sysconfdir}/cron.d/%{name}
69
70 %post
71 echo "Post processing"
72 # TODO: this will be nice when we have a web-based service running., such as
73 #               an API server or so on.
74 #chkconfig --add monitor-server
75 #chkconfig monitor-server on
76
77 %changelog
78 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
79 - initial creation of server-side package