changes for 3.0
[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 16
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: perl-IO-Socket-SSL 
34 Requires: MySQL-python
35 Requires: rt3 == 3.4.1
36 Requires: nmap
37
38 Requires: PLCWWW >= 4.2
39 Requires: bootcd-planetlab-i386 >= 4.2
40
41 %description
42 Scripts for polling PLC, the node, and PCU status.  Also a collection of
43 command-line utilities for querying the status database. 
44
45 %prep
46 %setup -q
47
48 %build
49 # TODO: note that we should build the cmdamt/ with g++
50 cd cmdamt
51 export TMPDIR=$PWD/tmp
52 make
53 cd ..
54
55 %install
56
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/
64
65 echo " * Installing core scripts"
66 rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
67           ./ $RPM_BUILD_ROOT/usr/share/%{name}/
68
69 echo " * Installing web pages"
70 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
71
72 echo " * Installing cron job for automated polling"
73 install -D -m 644 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}.cron
74 echo " * TODO: Setting up Monitor account in local MyPLC"
75 # TODO: 
76
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
82 done
83 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
84
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
87
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
90
91 %clean
92 rm -rf $RPM_BUILD_ROOT
93
94 %files
95 %defattr(-,root,root)
96 %config /usr/share/%{name}/monitorconfig.py
97 %config /etc/monitor.conf
98 /usr/share/%{name}
99 /var/lib/%{name}
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
106
107 %post
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).
116
117 #chkconfig --add monitor-server
118 #chkconfig monitor-server on
119
120 %changelog
121 * Mon Apr 13 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-16
122 - add email exceptions.
123 - add better timeouts for commands even once ssh has opened a connection
124
125 * Thu Feb 26 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-15
126 - fixed bug that prevented penalties from escalating and PIs from getting
127 - emails.
128
129 * Fri Feb 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-14
130 - updated printbadnodes.py to include diff_time()
131 - changed eamils to use literal addresses not tech-* and pi-* aliases
132 - updates to automation script to prevent false errors.
133
134 * Tue Nov 04 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-13
135 - Fixed for email change in unified_model.py tweaks in others.
136
137 * Wed Oct 29 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-12
138 - Improvements in web pages, and default installation options, and RT queue
139 - setup.
140 - Send direct emails rather than using tech- & pi- aliases
141
142 * Tue Oct 21 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-11
143 - send direct email, not to tech-* and pi-* aliases.
144
145 * Tue Oct 14 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-10
146 - an update to the latest tag.  looks like I actually needed to update the tags
147 - file more than this.
148
149 * Thu Sep 25 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-9
150 - includes all removals of 'monitorconfig'
151
152 * Wed Sep 24 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-8
153 - These are all changes in the latest Monitor code.  I will branch this version
154 - next, before making additional large changes.
155
156 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-1.0-7
157 - Checkpointing current version for 4.2-rc21 - many many changes
158
159 * Mon Aug 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-6
160 - This is a major tag of every thing.  probably needs a very different release
161 - number.
162
163 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
164 - initial creation of server-side package