update spec file; I will test it within a myplc
[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 5
10
11 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
12
13 Summary: Monitor backend scripts for server
14 Name: %{name}
15 Version: %{version}
16 Release: %{release}
17 Source0: %{name}-%{version}.tar.bz2
18 License: GPL
19 Group: Applications/System
20 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
21
22 Vendor: PlanetLab
23 Packager: PlanetLab Central <support@planet-lab.org>
24 Distribution: PlanetLab %{plrelease}
25 URL: %(echo %{url} | cut -d ' ' -f 2)
26
27 Requires: curl
28 Requires: coreutils
29 Requires: openssh-clients
30 Requires: PLCWWW >= 4.2
31 Requires: BootCD >= 4.2
32
33 %description
34 Scripts for polling PLC, the node, and PCU status.  Also a collection of
35 command-line utilities for querying the status database. 
36
37 %prep
38 %setup -q
39
40 %build
41 # TODO: note that we should build the cmdamt/ with g++
42 echo "There is no build stage.  Simply copy files."
43
44 %install
45
46 rm -rf $RPM_BUILD_ROOT
47 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
48 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
49 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
50
51 echo " * Installing core scripts"
52 rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
53           ./ $RPM_BUILD_ROOT/usr/share/%{name}/
54
55 echo " * Installing web pages"
56 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
57
58 echo " * TODO: Installing cron job for automated polling"
59 install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}
60 echo " * TODO: Setting up Monitor account in local MyPLC"
61
62 cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
63
64 %clean
65 rm -rf $RPM_BUILD_ROOT
66
67 %files
68 %defattr(-,root,root)
69 %config /usr/share/%{name}/monitorconfig.py
70 /usr/share/%{name}
71 /var/lib/%{name}
72 /var/www/cgi-bin/monitor
73 %{_sysconfdir}/cron.d/%{name}
74
75 %post
76 echo "Post processing"
77 # TODO: this will be nice when we have a web-based service running., such as
78 #               an API server or so on.
79 # TODO: create real monitorconfig.py from monitorconfig-default.py
80 # TODO: create monitorconfig.php using phpconfig.py 
81 # TODO: create symlink in /var/lib/monitor-server for chroot environments
82 # TODO: update the content of automate_pl03.sh 
83
84 #chkconfig --add monitor-server
85 #chkconfig monitor-server on
86
87 %changelog
88 * Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
89 - initial creation of server-side package