# # $Id$ # %define url $URL: git://git.planet-lab.org/myops.git$ %define name myops # keep this version in sync with monitor/monitor_version.py %define version 1.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)" ) Name: %{name} Version: %{version} Release: %{release} Source0: %{name}-%{version}.tar.bz2 License: GPL Group: Applications/System BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Vendor: PlanetLab Packager: PlanetLab Central Distribution: PlanetLab %{plrelease} URL: %(echo %{url} | cut -d ' ' -f 2) Summary: MyOps operational packages. Group: Applications/System %description MyOps is a collection of support services and scripts for operating a MyPLC deployment. %package puppet-client Summary: MyOps for client Group: Applications/System Requires: puppet Requires: coreutils %description puppet-client Client side configuration. ######################################## Server %package puppet-server Summary: MyOps the server side Group: Applications/System Requires: puppet-server Requires: puppet Requires: coreutils %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 %install rm -rf $RPM_BUILD_ROOT #################### SERVER 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/var/lib/puppet install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/ install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/ 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/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 /%{_sysconfdir}/puppet/bin/node_classifier /%{_sysconfdir}/puppet/manifests/site.pp /%{_sysconfdir}/puppet/puppetmaster.conf /%{_sysconfdir}/puppet/modules %files puppet-client %defattr(-,root,root) /%{_sysconfdir}/puppet/puppet.conf /usr/share/%{name}/puppet %post puppet-server echo "Reminder: open ports for puppet: 8139,8140,8141 in iptables" chkconfig --add puppetmaster chkconfig puppetmaster on %post puppet-client chkconfig --add puppet chkconfig puppet on %changelog %define module_current_branch 1.0