latest addition of /var/lib/ for current and archived data files
[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/var/lib/%{name}
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 --exclude .svn --exclude CVS \
50           ./ $RPM_BUILD_ROOT/usr/share/%{name}/
51
52 echo " * Installing web pages"
53 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
54
55 echo " * TODO: Installing cron job for automated polling"
56 install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}
57 echo " * TODO: Setting up Monitor account in local MyPLC"
58
59 %clean
60 rm -rf $RPM_BUILD_ROOT
61
62 %files
63 %defattr(-,root,root)
64 %config /var/share/%{name}/monitorconfig.py
65 /usr/share/%{name}
66 /var/lib/%{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