]>
Commit | Line | Data |
---|---|---|
d10b63a1 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
4 | ||
5 | Summary: A simple hierarchical database supporting plugin data sources | |
6 | Name: hiera | |
52843954 ER |
7 | # http://docs.puppetlabs.com/hiera/ |
8 | # Hiera 3.0 is included with open source Puppet versions 4.2 and up. | |
9 | # Hiera 1.0 is compatible with Puppet 3.x and is included in Puppet Enterprise 3.x. | |
10 | Version: 1.3.4 | |
d10b63a1 ER |
11 | Release: 1 |
12 | License: Apache v2.0 | |
13 | Group: Applications/Databases | |
52843954 ER |
14 | Source0: http://rubygems.org/downloads/%{name}-%{version}.gem |
15 | # Source0-md5: 9d83ce8a56cf74ae93bc55ce878da9f3 | |
16 | # Copied from http://downloads.puppetlabs.com/hiera/%{name}-%{version}.tar.gz | |
17 | # tarball ext/hiera.yaml, as ext/ dir is not included in gem, but we want gem for .gemspec | |
d10b63a1 ER |
18 | Source1: %{name}.yaml |
19 | URL: http://projects.puppetlabs.com/projects/hiera/ | |
d10b63a1 | 20 | BuildRequires: rpm-rubyprov |
52843954 | 21 | BuildRequires: rpmbuild(macros) >= 1.656 |
d10b63a1 ER |
22 | %if %{with tests} |
23 | BuildRequires: ruby-mocha | |
24 | BuildRequires: ruby-rspec | |
25 | %endif | |
26 | BuildArch: noarch | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | A simple hierarchical database supporting plugin data sources. | |
31 | ||
32 | %prep | |
33 | %setup -q | |
52843954 ER |
34 | install -d ext |
35 | cp -p %{SOURCE1} ext/hiera.yaml | |
d10b63a1 ER |
36 | |
37 | %build | |
52843954 ER |
38 | # write .gemspec |
39 | %__gem_helper spec | |
40 | ||
41 | # why pure? just json will do | |
42 | %{__sed} -i -e 's/json_pure/json/' *.gemspec | |
43 | ||
d10b63a1 ER |
44 | %if %{with tests} |
45 | ruby spec/spec_helper.rb | |
46 | %endif | |
47 | ||
48 | %install | |
49 | rm -rf $RPM_BUILD_ROOT | |
52843954 | 50 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_bindir},%{ruby_vendorlibdir},%{ruby_specdir},%{_var}/lib/hiera} |
d10b63a1 ER |
51 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} |
52 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
52843954 ER |
53 | cp -p ext/hiera.yaml $RPM_BUILD_ROOT%{_sysconfdir} |
54 | cp -p %{name}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} | |
d10b63a1 ER |
55 | |
56 | %clean | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | ||
59 | %files | |
60 | %defattr(644,root,root,755) | |
52843954 | 61 | %doc README.md LICENSE |
d10b63a1 ER |
62 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hiera.yaml |
63 | %attr(755,root,root) %{_bindir}/hiera | |
64 | %{ruby_vendorlibdir}/hiera.rb | |
65 | %{ruby_vendorlibdir}/hiera | |
52843954 | 66 | %{ruby_specdir}/%{name}-%{version}.gemspec |
d10b63a1 | 67 | %dir %{_var}/lib/hiera |