updates to monitor-server.spec and notes in 'todo' based on first attempt to
[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: openssh-clients
30 Requires: PLCWWW >= 4.2
31 Requires: BootCD >= 4.2
32 Requires: MySQL-python
33
34 %description
35 Scripts for polling PLC, the node, and PCU status.  Also a collection of
36 command-line utilities for querying the status database. 
37
38 %prep
39 %setup -q
40
41 %build
42 # TODO: note that we should build the cmdamt/ with g++
43 echo "There is no build stage.  Simply copy files."
44
45 %install
46
47 rm -rf $RPM_BUILD_ROOT
48 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
49 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
50 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/archive-pdb
51 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
52
53 echo " * Installing core scripts"
54 rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
55           ./ $RPM_BUILD_ROOT/usr/share/%{name}/
56
57 echo " * Installing web pages"
58 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
59
60 echo " * Installing cron job for automated polling"
61 install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}.cron
62 echo " * TODO: Setting up Monitor account in local MyPLC"
63 # TODO: 
64
65 cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
66
67 %clean
68 rm -rf $RPM_BUILD_ROOT
69
70 %files
71 %defattr(-,root,root)
72 %config /usr/share/%{name}/monitorconfig.py
73 /usr/share/%{name}
74 /var/lib/%{name}
75 /var/www/cgi-bin/monitor
76 %{_sysconfdir}/cron.d/%{name}
77
78 %post
79 echo "Post processing"
80 # TODO: this will be nice when we have a web-based service running., such as
81 #               an API server or so on.
82 # TODO: create real monitorconfig.py from monitorconfig-default.py
83 # TODO: create monitorconfig.php using phpconfig.py 
84 # TODO: create symlink in /var/lib/monitor-server for chroot environments
85 # TODO: update the content of automate_pl03.sh 
86 # TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
87
88 #chkconfig --add monitor-server
89 #chkconfig monitor-server on
90
91 %changelog
92 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
93 - initial creation of server-side package