Update version according to OSCI-856
[packages/precise/mcollective.git] / plugins / mcollective / pluginpackager / templates / redhat / rpm_spec.erb
1 Name: <%= @package_name %>
2 Summary: <%= @plugin.metadata[:description] %>
3 Version: <%= @plugin.metadata[:version] %>
4 Release: <%= @plugin.revision %>
5 License: <%= @plugin.metadata[:license]%>
6 URL: <%= @plugin.metadata[:url]%>
7 Vendor: <%= @plugin.vendor%>
8 Packager: <%= @plugin.metadata[:author]%>
9 BuildArch: noarch
10 Group: System Tools
11 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
12 Source0: <%= @package_name_and_version%>.tgz
13
14 %description
15 <%= @plugin.metadata[:description] %>
16
17 %prep
18 %setup
19
20 %build
21 <% package_files = plugin_files.map{ |f| File.join(@libdir, File.expand_path(f).gsub(/#{File.expand_path(@plugin.path)}|\.\//, '')) } -%>
22 <% dirs = package_files.map{ |f| File.dirname(f) }.uniq -%>
23
24 %install
25 rm -rf %{buildroot}
26 <% dirs.each do |dir| -%>
27 %{__install} -d -m0755 %{buildroot}<%= dir%>
28 <% end -%>
29 <% package_files.each do |file| -%>
30 %{__install} -m0644 -v <%= (file[0].chr == '/') ? file[1..file.size-1]: file%> %{buildroot}<%=file %>
31 <% end -%>
32
33 <% @plugin.packagedata.each do |type, data| %>
34 %package <%= type %>
35 Summary: <%= @plugin.metadata[:description] %>
36 <% if data[:plugindependency] %>
37 Requires: <%= data[:plugindependency][:name] -%> = <%= data[:plugindependency][:version]%>-<%= data[:plugindependency][:revision]%>
38 <% end -%>
39 <% PluginPackager.filter_dependencies('redhat', data[:dependencies]).each do |dep|-%>
40 Requires: <%= dep[:name] -%> <%= ">= #{dep[:version]}" if dep[:version]%><%="-#{dep[:revision]}" if dep[:revision]%>
41 <% end -%>
42 %description <%= type %>
43 <%= data[:description] %>
44
45 %files <%= type %>
46 %defattr(-, root, root, -)
47 <% package_files(data[:files]).each do |file| -%>
48 <%= file %>
49 <% end -%>
50 <% end -%>
51
52 <% if @plugin.preinstall -%>
53 %pre
54 <%= @plugin.preinstall %>
55 <% end -%>
56 <% if @plugin.postinstall -%>
57 %post
58 <%= @plugin.postinstall%>
59 <% end -%>
60
61 %changelog
62 * <%= Time.now.strftime("%a %b %d %Y") -%> <%= @plugin.metadata[:author]%> - <%= @plugin.metadata[:version]%>-<%= @plugin.revision %>
63 - Built Package <%= @plugin.metadata[:name] -%>