Add scripts to create myops-getqueryview:
[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 0
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 %prep
95 %setup -q
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99
100
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/
109
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
113
114 rsync -a ./puppet  $RPM_BUILD_ROOT/usr/share/myops/
115 rsync -a ./web $RPM_BUILD_ROOT/usr/share/myops/
116
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
123
124 rsync -ar ./puppet/server/modules $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
125
126 ls web/collect
127 ls $RPM_BUILD_ROOT
128
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
136
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/
139
140 %clean
141 rm -rf $RPM_BUILD_ROOT
142
143 %files getqueryview
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
155
156 %files puppet-server
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
163
164 %files puppet-client
165 %defattr(-,root,root)
166 /%{_sysconfdir}/puppet/puppet.conf
167 /usr/share/%{name}/puppet
168
169 %post puppet-server
170 echo "Reminder: open ports for puppet: 8139,8140,8141 in iptables"
171 chkconfig --add puppetmaster
172 chkconfig puppetmaster on
173
174 %post puppet-client
175 chkconfig --add puppet
176 chkconfig puppet on
177
178
179 %changelog
180 %define module_current_branch 1.0