%define taglevel 6
%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+%global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
+
Summary: Monitor backend scripts for server
Name: %{name}
Requires: curl
Requires: coreutils
Requires: openssh-clients
-Requires: PLCWWW >= 4.2
-Requires: BootCD >= 4.2
+Requires: perl-libwww-perl
Requires: MySQL-python
Requires: rt3 == 3.4.1
+Requires: PLCWWW >= 4.2
+Requires: BootCD >= 4.2
+
%description
Scripts for polling PLC, the node, and PCU status. Also a collection of
command-line utilities for querying the status database.
%build
# TODO: note that we should build the cmdamt/ with g++
-echo "There is no build stage. Simply copy files."
+cd cmdamt
+export TMPDIR=$PWD/tmp
+make
+cd ..
%install
echo " * TODO: Setting up Monitor account in local MyPLC"
# TODO:
+mkdir -p $RPM_BUILD_ROOT/%{python_sitearch}/monitor
+install -d -D -m 755 monitor $RPM_BUILD_ROOT/%{python_sitearch}/monitor
+# TODO: need a much better way to do this.
+for file in __init__.py database.py config.py ; do
+ install -D -m 644 monitor/$file $RPM_BUILD_ROOT/%{python_sitearch}/monitor/$file
+done
+install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
+
+install -D -m 755 monitor-default.conf $RPM_BUILD_ROOT/etc/monitor.conf
cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
%clean
/var/lib/%{name}
/var/www/cgi-bin/monitor
%{_sysconfdir}/cron.d/%{name}.cron
+%{python_sitearch}/threadpool.py
+%{python_sitearch}/monitor
%post
echo "Post processing"