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: MySQL-python
34 Requires: rt3 == 3.4.1
37 Requires: PLCWWW >= 4.2
38 Requires: bootcd-planetlab-i386 >= 4.2
41 Scripts for polling PLC, the node, and PCU status. Also a collection of
42 command-line utilities for querying the status database.
48 # TODO: note that we should build the cmdamt/ with g++
50 export TMPDIR=$PWD/tmp
56 rm -rf $RPM_BUILD_ROOT
57 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
58 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
59 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/archive-pdb
60 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
62 echo " * Installing core scripts"
63 rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
64 ./ $RPM_BUILD_ROOT/usr/share/%{name}/
66 echo " * Installing web pages"
67 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
69 echo " * Installing cron job for automated polling"
70 install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}.cron
71 echo " * TODO: Setting up Monitor account in local MyPLC"
74 mkdir -p $RPM_BUILD_ROOT/%{python_sitearch}/monitor
75 install -d -D -m 755 monitor $RPM_BUILD_ROOT/%{python_sitearch}/monitor
76 # TODO: need a much better way to do this.
77 for file in __init__.py database.py config.py ; do
78 install -D -m 644 monitor/$file $RPM_BUILD_ROOT/%{python_sitearch}/monitor/$file
80 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
82 touch $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
83 chmod 777 $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
85 install -D -m 755 monitor-default.conf $RPM_BUILD_ROOT/etc/monitor.conf
86 cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
89 rm -rf $RPM_BUILD_ROOT
93 %config /usr/share/%{name}/monitorconfig.py
94 %config /etc/monitor.conf
97 /var/www/cgi-bin/monitor
98 %{_sysconfdir}/cron.d/%{name}.cron
99 %{python_sitearch}/threadpool.py
100 %{python_sitearch}/threadpool.pyc
101 %{python_sitearch}/threadpool.pyo
102 %{python_sitearch}/monitor
105 echo "Post processing"
106 # TODO: this will be nice when we have a web-based service running., such as
107 # an API server or so on.
108 # TODO: create real monitorconfig.py from monitorconfig-default.py
109 # TODO: create monitorconfig.php using phpconfig.py
110 # TODO: create symlink in /var/lib/monitor-server for chroot environments
111 # TODO: update the content of automate_pl03.sh
112 # TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
114 #chkconfig --add monitor-server
115 #chkconfig monitor-server on
118 * Wed Sep 24 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-8
119 - These are all changes in the latest Monitor code. I will branch this version
120 - next, before making additional large changes.
122 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-1.0-7
123 - Checkpointing current version for 4.2-rc21 - many many changes
125 * Mon Aug 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-6
126 - This is a major tag of every thing. probably needs a very different release
129 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
130 - initial creation of server-side package
132 %define module_current_branch 1.0