Never miss an old file
[myops.git] / myops.spec
1 #
2 # $Id$
3
4
5 %define url $URL: git://git.planet-lab.org/myops.git$
6
7 %define name myops
8 # keep this version in sync with monitor/monitor_version.py
9 %define version 1.0
10 %define taglevel 1
11
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)" )
14
15 Name: %{name}
16 Version: %{version}
17 Release: %{release}
18 Source0: %{name}-%{version}.tar.bz2
19 License: GPL
20 Group: Applications/System
21 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
22
23 Vendor: PlanetLab
24 Packager: PlanetLab Central <support@planet-lab.org>
25 Distribution: PlanetLab %{plrelease}
26 URL: %(echo %{url} | cut -d ' ' -f 2)
27
28
29 Summary: MyOps operational packages.
30 Group: Applications/System
31
32 %description
33 MyOps is a collection of support services and scripts for operating a MyPLC
34 deployment.
35
36 %package puppet-client
37 Summary: MyOps for client
38 Group: Applications/System
39
40 Requires: puppet
41 Requires: coreutils
42
43 %description puppet-client
44 Client side configuration.
45
46 ######################################## Server
47 %package puppet-server
48 Summary: MyOps the server side
49 Group: Applications/System
50
51 Requires: puppet-server
52 Requires: puppet
53 Requires: coreutils
54
55 %description puppet-server
56 Server side services
57
58
59 ######################################## get/query/view
60 %package getqueryview
61 Summary: MyOps components for collection, view and query.
62 Group: Applications/System
63
64 # view
65 Requires: bzr
66 Requires: nc
67 Requires: coreutils
68 Requires: twisted
69 Requires: pycairo
70 Requires: mod_python
71 Requires: python-ldap
72 Requires: python-memcached
73 Requires: mod_wsgi
74 Requires: Django 
75 Requires: mlocate
76 Requires: sysstat
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
81
82 # query
83 Requires: couchdb
84 Requires: python-couchdb
85 Requires: python-setuptools-devel
86
87 #collect
88 Requires: php
89
90
91 %description getqueryview
92 The combination of collection, query and view servers.
93
94 ######################################## NAGIOS
95
96 %package policy
97 Summary: MyOps integration with Nagios
98 Group: Applications/System
99
100 Requires: coreutils
101 Requires: passwd
102 Requires: gd
103 Requires: gd-devel
104 Requires: mysql
105 Requires: mysql-server
106 Requires: mysql-devel
107 Requires: mysql-libs
108 Requires: mailx
109 Requires: sendmail
110 Requires: php
111 Requires: httpd
112
113 Requires: cronie
114 Requires: nagios
115 Requires: nagios-common
116 Requires: nagios-devel
117 Requires: nagios-plugins-all
118 Requires: ndoutils
119 Requires: ndoutils-mysql
120
121 Requires: rt3
122
123
124 %description policy
125 Scripts and setup necessary to integrate and monitor PLC with Nagios.
126 Best suited to F12 or above.
127
128
129 %prep
130 %setup -q
131
132 %install
133 rm -rf $RPM_BUILD_ROOT
134
135
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/
144
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
148
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/
152
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
159
160 rsync -ar ./puppet/server/modules $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
161
162 ls web/collect
163 ls $RPM_BUILD_ROOT
164
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
174
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/
177
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/
182
183 %clean
184 rm -rf $RPM_BUILD_ROOT
185
186 %files getqueryview
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
200
201 %files policy
202 %defattr(-,root,root)
203 %{_sysconfdir}/plc.d/myops-nagios
204 /usr/share/%{name}/nagios 
205 %{_sysconfdir}/cron.d/myops-nagios.cron
206
207 %files puppet-server
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
214
215 %files puppet-client
216 %defattr(-,root,root)
217 /%{_sysconfdir}/puppet/puppet.conf
218 /usr/share/%{name}/puppet
219
220 %post puppet-server
221 echo "Reminder: open ports for puppet: 8139,8140,8141 in iptables"
222 chkconfig --add puppetmaster
223 chkconfig puppetmaster on
224
225 %post puppet-client
226 chkconfig --add puppet
227 chkconfig puppet on
228
229
230 %changelog
231 %define module_current_branch 1.0