0576459682b0362fa8172393fb395084ae783053
[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.1
9 %define taglevel 0
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 rsync -a monitor/ $RPM_BUILD_ROOT/%{python_sitearch}/monitor/
78 #for file in __init__.py database.py config.py ; do 
79 #       install -D -m 644 monitor/$file $RPM_BUILD_ROOT/%{python_sitearch}/monitor/$file
80 #done
81 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
82
83 touch $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
84 chmod 777 $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
85
86 install -D -m 755 monitor-default.conf $RPM_BUILD_ROOT/etc/monitor.conf
87 cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %files
93 %defattr(-,root,root)
94 %config /usr/share/%{name}/monitorconfig.py
95 %config /etc/monitor.conf
96 /usr/share/%{name}
97 /var/lib/%{name}
98 /var/www/cgi-bin/monitor
99 %{_sysconfdir}/cron.d/%{name}.cron
100 %{python_sitearch}/threadpool.py
101 %{python_sitearch}/threadpool.pyc
102 %{python_sitearch}/threadpool.pyo
103 %{python_sitearch}/monitor
104
105 %post
106 echo "Post processing"
107 # TODO: this will be nice when we have a web-based service running., such as
108 #               an API server or so on.
109 # TODO: create real monitorconfig.py from monitorconfig-default.py
110 # TODO: create monitorconfig.php using phpconfig.py 
111 # TODO: create symlink in /var/lib/monitor-server for chroot environments
112 # TODO: update the content of automate_pl03.sh 
113 # TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
114
115 #chkconfig --add monitor-server
116 #chkconfig monitor-server on
117
118 %changelog
119 * Wed Sep 24 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-8
120 - These are all changes in the latest Monitor code.  I will branch this version
121 - next, before making additional large changes.
122
123 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-1.0-7
124 - Checkpointing current version for 4.2-rc21 - many many changes
125
126 * Mon Aug 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-6
127 - This is a major tag of every thing.  probably needs a very different release
128 - number.
129
130 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
131 - initial creation of server-side package
132
133 %define module_current_branch 1.0