www/printbadnodes.py
[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 6
10
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)" )
13
14
15 Summary: Monitor backend scripts for server
16 Name: %{name}
17 Version: %{version}
18 Release: %{release}
19 Source0: %{name}-%{version}.tar.bz2
20 License: GPL
21 Group: Applications/System
22 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
23
24 Vendor: PlanetLab
25 Packager: PlanetLab Central <support@planet-lab.org>
26 Distribution: PlanetLab %{plrelease}
27 URL: %(echo %{url} | cut -d ' ' -f 2)
28
29 Requires: curl
30 Requires: coreutils
31 Requires: openssh-clients
32 Requires: perl-libwww-perl
33 Requires: MySQL-python
34 Requires: rt3 == 3.4.1
35
36 Requires: PLCWWW >= 4.2
37 Requires: BootCD >= 4.2
38
39 %description
40 Scripts for polling PLC, the node, and PCU status.  Also a collection of
41 command-line utilities for querying the status database. 
42
43 %prep
44 %setup -q
45
46 %build
47 # TODO: note that we should build the cmdamt/ with g++
48 cd cmdamt
49 export TMPDIR=$PWD/tmp
50 make
51 cd ..
52
53 %install
54
55 rm -rf $RPM_BUILD_ROOT
56 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
57 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
58 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/archive-pdb
59 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
60
61 echo " * Installing core scripts"
62 rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
63           ./ $RPM_BUILD_ROOT/usr/share/%{name}/
64
65 echo " * Installing web pages"
66 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
67
68 echo " * Installing cron job for automated polling"
69 install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}.cron
70 echo " * TODO: Setting up Monitor account in local MyPLC"
71 # TODO: 
72
73 mkdir -p $RPM_BUILD_ROOT/%{python_sitearch}/%{name}
74 install -D -m 755 monitor $RPM_BUILD_ROOT/%{python_sitearch}/%{name}
75 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
76
77 install -D -m 755 monitor-default.conf $RPM_BUILD_ROOT/etc/monitor.conf
78 cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
79
80 %clean
81 rm -rf $RPM_BUILD_ROOT
82
83 %files
84 %defattr(-,root,root)
85 %config /usr/share/%{name}/monitorconfig.py
86 /usr/share/%{name}
87 /var/lib/%{name}
88 /var/www/cgi-bin/monitor
89 %{_sysconfdir}/cron.d/%{name}.cron
90 %{python_sitearch}/threadpool.py
91 %{python_sitearch}/%{name}
92
93 %post
94 echo "Post processing"
95 # TODO: this will be nice when we have a web-based service running., such as
96 #               an API server or so on.
97 # TODO: create real monitorconfig.py from monitorconfig-default.py
98 # TODO: create monitorconfig.php using phpconfig.py 
99 # TODO: create symlink in /var/lib/monitor-server for chroot environments
100 # TODO: update the content of automate_pl03.sh 
101 # TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
102
103 #chkconfig --add monitor-server
104 #chkconfig monitor-server on
105
106 %changelog
107 * Mon Aug 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-6
108 - This is a major tag of every thing.  probably needs a very different release
109 - number.
110
111 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
112 - initial creation of server-side package