www/database.php
[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-planetlab-i386 >= 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}/monitor
74 install -d -D -m 755 monitor $RPM_BUILD_ROOT/%{python_sitearch}/monitor
75 # TODO: need a much better way to do this.
76 for file in __init__.py database.py config.py ; do 
77         install -D -m 644 monitor/$file $RPM_BUILD_ROOT/%{python_sitearch}/monitor/$file
78 done
79 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
80
81 install -D -m 755 monitor-default.conf $RPM_BUILD_ROOT/etc/monitor.conf
82 cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
83
84 %clean
85 rm -rf $RPM_BUILD_ROOT
86
87 %files
88 %defattr(-,root,root)
89 %config /usr/share/%{name}/monitorconfig.py
90 %config /etc/monitor.conf
91 /usr/share/%{name}
92 /var/lib/%{name}
93 /var/www/cgi-bin/monitor
94 %{_sysconfdir}/cron.d/%{name}.cron
95 %{python_sitearch}/threadpool.py
96 %{python_sitearch}/threadpool.pyc
97 %{python_sitearch}/threadpool.pyo
98 %{python_sitearch}/monitor
99
100 %post
101 echo "Post processing"
102 # TODO: this will be nice when we have a web-based service running., such as
103 #               an API server or so on.
104 # TODO: create real monitorconfig.py from monitorconfig-default.py
105 # TODO: create monitorconfig.php using phpconfig.py 
106 # TODO: create symlink in /var/lib/monitor-server for chroot environments
107 # TODO: update the content of automate_pl03.sh 
108 # TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
109
110 #chkconfig --add monitor-server
111 #chkconfig monitor-server on
112
113 %changelog
114 * Mon Aug 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-6
115 - This is a major tag of every thing.  probably needs a very different release
116 - number.
117
118 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
119 - initial creation of server-side package