Tagging module Monitor - Monitor-1.0-7
[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 7
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 Requires: nmap
36
37 Requires: PLCWWW >= 4.2
38 Requires: bootcd-planetlab-i386 >= 4.2
39
40 %description
41 Scripts for polling PLC, the node, and PCU status.  Also a collection of
42 command-line utilities for querying the status database. 
43
44 %prep
45 %setup -q
46
47 %build
48 # TODO: note that we should build the cmdamt/ with g++
49 cd cmdamt
50 export TMPDIR=$PWD/tmp
51 make
52 cd ..
53
54 %install
55
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/
61
62 echo " * Installing core scripts"
63 rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
64           ./ $RPM_BUILD_ROOT/usr/share/%{name}/
65
66 echo " * Installing web pages"
67 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
68
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"
72 # TODO: 
73
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
79 done
80 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
81
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
84
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
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %files
92 %defattr(-,root,root)
93 %config /usr/share/%{name}/monitorconfig.py
94 %config /etc/monitor.conf
95 /usr/share/%{name}
96 /var/lib/%{name}
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
103
104 %post
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).
113
114 #chkconfig --add monitor-server
115 #chkconfig monitor-server on
116
117 %changelog
118 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-1.0-7
119 - Checkpointing current version for 4.2-rc21 - many many changes
120
121 * Mon Aug 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-6
122 - This is a major tag of every thing.  probably needs a very different release
123 - number.
124
125 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
126 - initial creation of server-side package