Never miss an old file
[myops.git] / myops.spec
index 9647ed4..5d99cfa 100644 (file)
@@ -7,7 +7,7 @@
 %define name myops
 # keep this version in sync with monitor/monitor_version.py
 %define version 1.0
-%define taglevel 0
+%define taglevel 1
 
 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
 %global python_sitearch        %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
@@ -33,18 +33,18 @@ Group: Applications/System
 MyOps is a collection of support services and scripts for operating a MyPLC
 deployment.
 
-%package client
+%package puppet-client
 Summary: MyOps for client
 Group: Applications/System
 
 Requires: puppet
 Requires: coreutils
 
-%description client
+%description puppet-client
 Client side configuration.
 
 ######################################## Server
-%package server
+%package puppet-server
 Summary: MyOps the server side
 Group: Applications/System
 
@@ -52,9 +52,80 @@ Requires: puppet-server
 Requires: puppet
 Requires: coreutils
 
-%description server
+%description puppet-server
 Server side services
 
+
+######################################## get/query/view
+%package getqueryview
+Summary: MyOps components for collection, view and query.
+Group: Applications/System
+
+# view
+Requires: bzr
+Requires: nc
+Requires: coreutils
+Requires: twisted
+Requires: pycairo
+Requires: mod_python
+Requires: python-ldap
+Requires: python-memcached
+Requires: mod_wsgi
+Requires: Django 
+Requires: mlocate
+Requires: sysstat
+# NOTE: some default fonts incase no others are present.
+Requires: bitstream-vera-fonts-common
+Requires: bitstream-vera-sans-fonts 
+Requires: bitstream-vera-sans-mono-fonts
+
+# query
+Requires: couchdb
+Requires: python-couchdb
+Requires: python-setuptools-devel
+
+#collect
+Requires: php
+
+
+%description getqueryview
+The combination of collection, query and view servers.
+
+######################################## NAGIOS
+
+%package policy
+Summary: MyOps integration with Nagios
+Group: Applications/System
+
+Requires: coreutils
+Requires: passwd
+Requires: gd
+Requires: gd-devel
+Requires: mysql
+Requires: mysql-server
+Requires: mysql-devel
+Requires: mysql-libs
+Requires: mailx
+Requires: sendmail
+Requires: php
+Requires: httpd
+
+Requires: cronie
+Requires: nagios
+Requires: nagios-common
+Requires: nagios-devel
+Requires: nagios-plugins-all
+Requires: ndoutils
+Requires: ndoutils-mysql
+
+Requires: rt3
+
+
+%description policy
+Scripts and setup necessary to integrate and monitor PLC with Nagios.
+Best suited to F12 or above.
+
+
 %prep
 %setup -q
 
@@ -63,28 +134,76 @@ rm -rf $RPM_BUILD_ROOT
 
 
 #################### SERVER
-echo "Reminder: open ports 8139,8140,8141 in iptables"
 install -d $RPM_BUILD_ROOT/usr/share/%{name}
+install -d $RPM_BUILD_ROOT/usr/bin
 install -d $RPM_BUILD_ROOT/etc/puppet/manifests
 install -d $RPM_BUILD_ROOT/etc/puppet/bin
-install -d $RPM_BUILD_ROOT/etc/cron.hourly
 install -d $RPM_BUILD_ROOT/var/lib/puppet
+install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/
+install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/
 
-rsync -a ./puppet  $RPM_BUILD_ROOT/usr/share/myops/
+install -d $RPM_BUILD_ROOT/etc/planetlab/db-config.d/
+install -d $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
+install -d $RPM_BUILD_ROOT/var/www/html/view
+
+rsync -a ./puppet $RPM_BUILD_ROOT/usr/share/myops/
+rsync -a ./web    $RPM_BUILD_ROOT/usr/share/myops/
+rsync -a ./nagios $RPM_BUILD_ROOT/usr/share/myops/
 
 # Generate an autosign list from plc node hostnames
 install -D -m 755 puppet/cron.d/autosign.plcsh $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/
 install -D -m 755 puppet/server/bin/node_classifier $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/bin/
 install -D -m 644 puppet/server/manifests/site.pp $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/manifests/
 install -D -m 644 puppet/server/puppetmaster.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
-install -D -m 644 puppet/client/hardcoded.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet
+install -D -m 644 puppet/client/puppet.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet
 
 rsync -ar ./puppet/server/modules $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
 
+ls web/collect
+ls $RPM_BUILD_ROOT
+
+install -D -m 644 README $RPM_BUILD_ROOT/usr/share/%{name}/
+install -D -m 644 web/db-config.d/030-conf_files_myops $RPM_BUILD_ROOT/etc/planetlab/db-config.d
+install -D -m 755 web/collect/sar2graphite.py $RPM_BUILD_ROOT/usr/bin/
+install -D -m 755 web/collect/client/update.sh $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/myops_update_sh
+install -D -m 755 web/collect/sar2graphite.py $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
+install -D -m 644 web/collect/cron.d/sysstat.cron $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
+install -D -m 644 web/collect/cron.d/sysstat.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/
+install -D -m 755 web/collect/server/upload.php $RPM_BUILD_ROOT/var/www/html/
+install -D -m 755 web/collect/server/cron.hourly/load_all_couchdb.sh $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly
+
+install -D -m 644 web/view/urllist.txt $RPM_BUILD_ROOT/var/www/html/view/
+install -D -m 644 web/view/index.php $RPM_BUILD_ROOT/var/www/html/view/
+
+install -D -m 755 nagios/myops-nagios.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/myops-nagios
+install -D -m 644 nagios/myops-nagios.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/myops-nagios.cron
+install -D -m 644 nagios/plc.py $RPM_BUILD_ROOT/usr/share/%{name}/nagios/
+install -D -m 644 nagios/generic.py $RPM_BUILD_ROOT/usr/share/%{name}/nagios/
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%files getqueryview
+%defattr(-,root,root)
+/usr/share/%{name}/README
+/usr/share/%{name}/web
+/%{_sysconfdir}/cron.d/sysstat.cron
+/var/www/html/PlanetLabConf/myops_update_sh
+/var/www/html/PlanetLabConf/sysstat.cron
+/var/www/html/PlanetLabConf/sar2graphite.py*
+/usr/bin/sar2graphite.py
+/etc/planetlab/db-config.d
+/var/www/html/upload.php
+%{_sysconfdir}/cron.hourly
+/var/www/html/view/urllist.txt
+/var/www/html/view/index.php
+
+%files policy
+%defattr(-,root,root)
+%{_sysconfdir}/plc.d/myops-nagios
+/usr/share/%{name}/nagios 
+%{_sysconfdir}/cron.d/myops-nagios.cron
+
 %files puppet-server
 %defattr(-,root,root)
 /%{_sysconfdir}/cron.hourly/autosign.plcsh
@@ -95,19 +214,18 @@ rm -rf $RPM_BUILD_ROOT
 
 %files puppet-client
 %defattr(-,root,root)
-/%{_sysconfdir}/puppet/hardcoded.conf
-/usr/share/%{name}
+/%{_sysconfdir}/puppet/puppet.conf
+/usr/share/%{name}/puppet
 
-%post server
+%post puppet-server
+echo "Reminder: open ports for puppet: 8139,8140,8141 in iptables"
 chkconfig --add puppetmaster
 chkconfig puppetmaster on
 
-%post client
+%post puppet-client
 chkconfig --add puppet
 chkconfig puppet on
 
-cat /etc/puppet/hardcoded.conf >> /etc/puppet/puppet.conf
-
 
 %changelog
 %define module_current_branch 1.0