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.
98 rm -rf $RPM_BUILD_ROOT
101 #################### SERVER
102 install -d $RPM_BUILD_ROOT/usr/share/%{name}
103 install -d $RPM_BUILD_ROOT/usr/bin
104 install -d $RPM_BUILD_ROOT/etc/puppet/manifests
105 install -d $RPM_BUILD_ROOT/etc/puppet/bin
106 install -d $RPM_BUILD_ROOT/var/lib/puppet
107 install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/
108 install -d $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/
110 install -d $RPM_BUILD_ROOT/etc/planetlab/db-config.d/
111 install -d $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
112 install -d $RPM_BUILD_ROOT/var/www/html/view
114 rsync -a ./puppet $RPM_BUILD_ROOT/usr/share/myops/
115 rsync -a ./web $RPM_BUILD_ROOT/usr/share/myops/
117 # Generate an autosign list from plc node hostnames
118 install -D -m 755 puppet/cron.d/autosign.plcsh $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/
119 install -D -m 755 puppet/server/bin/node_classifier $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/bin/
120 install -D -m 644 puppet/server/manifests/site.pp $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/manifests/
121 install -D -m 644 puppet/server/puppetmaster.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
122 install -D -m 644 puppet/client/puppet.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet
124 rsync -ar ./puppet/server/modules $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
129 install -D -m 644 web/db-config.d/030-conf_files_myops $RPM_BUILD_ROOT/etc/planetlab/db-config.d
130 install -D -m 755 web/collect/sar2graphite.py $RPM_BUILD_ROOT/usr/bin/
131 install -D -m 755 web/collect/sar2graphite.py $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
132 install -D -m 644 web/collect/cron.d/sysstat.cron $RPM_BUILD_ROOT/var/www/html/PlanetLabConf/
133 install -D -m 644 web/collect/cron.d/sysstat.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/
134 install -D -m 755 web/collect/server/upload.php $RPM_BUILD_ROOT/var/www/html/
135 install -D -m 755 web/collect/server/cron.hourly/load_all_couchdb.sh $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly
137 install -D -m 644 web/view/urllist.txt $RPM_BUILD_ROOT/var/www/html/view/
138 install -D -m 644 web/view/index.php $RPM_BUILD_ROOT/var/www/html/view/
141 rm -rf $RPM_BUILD_ROOT
144 %defattr(-,root,root)
145 /usr/share/%{name}/web
146 /%{_sysconfdir}/cron.d/sysstat.cron
147 /var/www/html/PlanetLabConf/sysstat.cron
148 /var/www/html/PlanetLabConf/sar2graphite.py*
149 /usr/bin/sar2graphite.py
150 /etc/planetlab/db-config.d
151 /var/www/html/upload.php
152 %{_sysconfdir}/cron.hourly
153 /var/www/html/view/urllist.txt
154 /var/www/html/view/index.php
157 %defattr(-,root,root)
158 /%{_sysconfdir}/cron.hourly/autosign.plcsh
159 /%{_sysconfdir}/puppet/bin/node_classifier
160 /%{_sysconfdir}/puppet/manifests/site.pp
161 /%{_sysconfdir}/puppet/puppetmaster.conf
162 /%{_sysconfdir}/puppet/modules
165 %defattr(-,root,root)
166 /%{_sysconfdir}/puppet/puppet.conf
167 /usr/share/%{name}/puppet
170 echo "Reminder: open ports for puppet: 8139,8140,8141 in iptables"
171 chkconfig --add puppetmaster
172 chkconfig puppetmaster on
175 chkconfig --add puppet
180 %define module_current_branch 1.0