5 %define url $URL: svn+ssh://svn.planet-lab.org/svn/Monitor/trunk/monitor-server.spec $
7 %define name monitor-server
11 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
12 %global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
15 Summary: Monitor backend scripts for server
19 Source0: %{name}-%{version}.tar.bz2
21 Group: Applications/System
22 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
25 Packager: PlanetLab Central <support@planet-lab.org>
26 Distribution: PlanetLab %{plrelease}
27 URL: %(echo %{url} | cut -d ' ' -f 2)
31 Requires: openssh-clients
32 Requires: perl-libwww-perl
33 Requires: perl-IO-Socket-SSL
34 Requires: MySQL-python
35 Requires: rt3 == 3.4.1
38 Requires: PLCWWW >= 4.2
39 Requires: bootcd-planetlab-i386 >= 4.2
42 Scripts for polling PLC, the node, and PCU status. Also a collection of
43 command-line utilities for querying the status database.
49 # TODO: note that we should build the cmdamt/ with g++
51 export TMPDIR=$PWD/tmp
57 rm -rf $RPM_BUILD_ROOT
58 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
59 mkdir -p $RPM_BUILD_ROOT/data/var/lib/%{name}
60 mkdir -p $RPM_BUILD_ROOT/data/var/lib/%{name}/archive-pdb
61 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
62 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/archive-pdb
63 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
65 echo " * Installing core scripts"
66 rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
67 ./ $RPM_BUILD_ROOT/usr/share/%{name}/
69 echo " * Installing web pages"
70 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
72 echo " * Installing cron job for automated polling"
73 install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}.cron
74 echo " * TODO: Setting up Monitor account in local MyPLC"
77 mkdir -p $RPM_BUILD_ROOT/%{python_sitearch}/monitor
78 install -d -D -m 755 monitor $RPM_BUILD_ROOT/%{python_sitearch}/monitor
79 # TODO: need a much better way to do this.
80 for file in __init__.py database.py config.py ; do
81 install -D -m 644 monitor/$file $RPM_BUILD_ROOT/%{python_sitearch}/monitor/$file
83 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
85 touch $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
86 chmod 777 $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
88 install -D -m 755 monitor-default.conf $RPM_BUILD_ROOT/etc/monitor.conf
89 cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
92 rm -rf $RPM_BUILD_ROOT
96 %config /usr/share/%{name}/monitorconfig.py
97 %config /etc/monitor.conf
100 /var/www/cgi-bin/monitor
101 %{_sysconfdir}/cron.d/%{name}.cron
102 %{python_sitearch}/threadpool.py
103 %{python_sitearch}/threadpool.pyc
104 %{python_sitearch}/threadpool.pyo
105 %{python_sitearch}/monitor
108 echo "Post processing"
109 # TODO: this will be nice when we have a web-based service running., such as
110 # an API server or so on.
111 # TODO: create real monitorconfig.py from monitorconfig-default.py
112 # TODO: create monitorconfig.php using phpconfig.py
113 # TODO: create symlink in /var/lib/monitor-server for chroot environments
114 # TODO: update the content of automate_pl03.sh
115 # TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
117 #chkconfig --add monitor-server
118 #chkconfig monitor-server on
121 * Tue Oct 14 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-10
122 - an update to the latest tag. looks like I actually needed to update the tags
123 - file more than this.
125 * Thu Sep 25 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-9
126 - includes all removals of 'monitorconfig'
128 * Wed Sep 24 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-8
129 - These are all changes in the latest Monitor code. I will branch this version
130 - next, before making additional large changes.
132 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-1.0-7
133 - Checkpointing current version for 4.2-rc21 - many many changes
135 * Mon Aug 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-6
136 - This is a major tag of every thing. probably needs a very different release
139 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
140 - initial creation of server-side package