5 %define url $URL: git://git.planet-lab.org/myops.git$
8 # keep this version in sync with monitor/monitor_version.py
12 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
13 %global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
18 Source0: %{name}-%{version}.tar.bz2
20 Group: Applications/System
21 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
24 Packager: PlanetLab Central <support@planet-lab.org>
25 Distribution: PlanetLab %{plrelease}
26 URL: %(echo %{url} | cut -d ' ' -f 2)
29 Summary: MyOps operational packages.
30 Group: Applications/System
33 MyOps is a collection of support services and scripts for operating a MyPLC
36 %package puppet-client
37 Summary: MyOps for client
38 Group: Applications/System
43 %description puppet-client
44 Client side configuration.
46 ######################################## Server
47 %package puppet-server
48 Summary: MyOps the server side
49 Group: Applications/System
51 Requires: puppet-server
55 %description puppet-server
59 ######################################## get/query/view
61 Summary: MyOps components for collection, view and query.
62 Group: Applications/System
72 Requires: python-memcached
77 # NOTE: some default fonts incase no others are present.
78 Requires: bitstream-vera-fonts-common
79 Requires: bitstream-vera-sans-fonts
80 Requires: bitstream-vera-sans-mono-fonts
84 Requires: python-couchdb
85 Requires: python-setuptools-devel
91 %description getqueryview
92 The combination of collection, query and view servers.
94 ######################################## NAGIOS
97 Summary: MyOps integration with Nagios
98 Group: Applications/System
105 Requires: mysql-server
106 Requires: mysql-devel
115 Requires: nagios-common
116 Requires: nagios-devel
117 Requires: nagios-plugins-all
119 Requires: ndoutils-mysql
125 Scripts and setup necessary to integrate and monitor PLC with Nagios.
126 Best suited to F12 or above.
133 rm -rf $RPM_BUILD_ROOT
136 #################### SERVER
137 install -d $RPM_BUILD_ROOT/usr/share/%{name}
138 install -d $RPM_BUILD_ROOT/usr/bin
139 install -d $RPM_BUILD_ROOT/etc/puppet/manifests
140 install -d $RPM_BUILD_ROOT/etc/puppet/bin
141 install -d $RPM_BUILD_ROOT/var/lib/puppet
142 install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/
143 install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/
145 install -d $RPM_BUILD_ROOT/etc/planetlab/db-config.d/
146 install -d $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
147 install -d $RPM_BUILD_ROOT/var/www/html/view
149 rsync -a ./puppet $RPM_BUILD_ROOT/usr/share/myops/
150 rsync -a ./web $RPM_BUILD_ROOT/usr/share/myops/
151 rsync -a ./nagios $RPM_BUILD_ROOT/usr/share/myops/
153 # Generate an autosign list from plc node hostnames
154 install -D -m 755 puppet/cron.d/autosign.plcsh $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/
155 install -D -m 755 puppet/server/bin/node_classifier $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/bin/
156 install -D -m 644 puppet/server/manifests/site.pp $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/manifests/
157 install -D -m 644 puppet/server/puppetmaster.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
158 install -D -m 644 puppet/client/puppet.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet
160 rsync -ar ./puppet/server/modules $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
165 install -D -m 644 README $RPM_BUILD_ROOT/usr/share/%{name}/
166 install -D -m 644 web/db-config.d/030-conf_files_myops $RPM_BUILD_ROOT/etc/planetlab/db-config.d
167 install -D -m 755 web/collect/sar2graphite.py $RPM_BUILD_ROOT/usr/bin/
168 install -D -m 755 web/collect/client/update.sh $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/myops_update_sh
169 install -D -m 755 web/collect/sar2graphite.py $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
170 install -D -m 644 web/collect/cron.d/sysstat.cron $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
171 install -D -m 644 web/collect/cron.d/sysstat.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/
172 install -D -m 755 web/collect/server/upload.php $RPM_BUILD_ROOT/var/www/html/
173 install -D -m 755 web/collect/server/cron.hourly/load_all_couchdb.sh $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly
175 install -D -m 644 web/view/urllist.txt $RPM_BUILD_ROOT/var/www/html/view/
176 install -D -m 644 web/view/index.php $RPM_BUILD_ROOT/var/www/html/view/
178 install -D -m 755 nagios/myops-nagios.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/myops-nagios
179 install -D -m 644 nagios/myops-nagios.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/myops-nagios.cron
180 install -D -m 644 nagios/plc.py $RPM_BUILD_ROOT/usr/share/%{name}/nagios/
181 install -D -m 644 nagios/generic.py $RPM_BUILD_ROOT/usr/share/%{name}/nagios/
184 rm -rf $RPM_BUILD_ROOT
187 %defattr(-,root,root)
188 /usr/share/%{name}/README
189 /usr/share/%{name}/web
190 /%{_sysconfdir}/cron.d/sysstat.cron
191 /var/www/html/PlanetLabConf/myops_update_sh
192 /var/www/html/PlanetLabConf/sysstat.cron
193 /var/www/html/PlanetLabConf/sar2graphite.py*
194 /usr/bin/sar2graphite.py
195 /etc/planetlab/db-config.d
196 /var/www/html/upload.php
197 %{_sysconfdir}/cron.hourly
198 /var/www/html/view/urllist.txt
199 /var/www/html/view/index.php
202 %defattr(-,root,root)
203 %{_sysconfdir}/plc.d/myops-nagios
204 /usr/share/%{name}/nagios
205 %{_sysconfdir}/cron.d/myops-nagios.cron
208 %defattr(-,root,root)
209 /%{_sysconfdir}/cron.hourly/autosign.plcsh
210 /%{_sysconfdir}/puppet/bin/node_classifier
211 /%{_sysconfdir}/puppet/manifests/site.pp
212 /%{_sysconfdir}/puppet/puppetmaster.conf
213 /%{_sysconfdir}/puppet/modules
216 %defattr(-,root,root)
217 /%{_sysconfdir}/puppet/puppet.conf
218 /usr/share/%{name}/puppet
221 echo "Reminder: open ports for puppet: 8139,8140,8141 in iptables"
222 chkconfig --add puppetmaster
223 chkconfig puppetmaster on
226 chkconfig --add puppet
231 %define module_current_branch 1.0