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