summaryrefslogtreecommitdiffstats
path: root/vagrant-cachier.spec
blob: 36d36b6a9b68eab8e357e954fe7992889142b59b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
%global vagrant_plugin_name vagrant-cachier

Name: %{vagrant_plugin_name}
Version: 1.2.0
Release: 1%{?dist}
Summary: Package cache for vagrant
Group: Development/Languages
License: MIT
URL: https://github.com/fgrehm/vagrant-cachier
Source0: https://rubygems.org/gems/%{vagrant_plugin_name}-%{version}.gem

#Requires(pre): shadow-utils
Requires(posttrans): vagrant
Requires(preun): vagrant
Requires: ruby(release)
Requires: ruby(rubygems)
### Requires: rubygem(fog) => 1.23
### Requires: rubygem(fog) < 2
### Requires: rubygem(nokogiri) => 1.6.0
### Requires: rubygem(nokogiri) < 1.7
### Requires: rubygem(multi_json)
Requires: vagrant

BuildRequires: vagrant
BuildRequires: rubygem(rspec) < 3
### BuildRequires: rubygem(fog)
BuildArch: noarch

%description
A vagrant plugin that helps you reduce the amount of coffee you drink while
waiting for boxes to be provisioned by sharing a common package cache among
similiar VM instances.

%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
gem unpack %{SOURCE0}

%setup -q -D -T -n  %{vagrant_plugin_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{vagrant_plugin_name}.gemspec


%build
gem build %{vagrant_plugin_name}.gemspec

%install
%{vagrant_plugin_install}

mkdir -p %{buildroot}%{vagrant_plugin_dir}
cp -a .%{vagrant_plugin_dir}/* \
        %{buildroot}%{vagrant_plugin_dir}/

# polkit rule for vagrant group.
#mkdir -p %{buildroot}%{_datadir}/polkit-1/rules.d
#install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/polkit-1/rules.d/

# TODO: enable check.
# (currently rubygem-hitimes is missing)
#
#%check
#pushd .%{vagrant_plugin_instdir}
#sed -i '/git/ s/^/#/' Gemfile
#
#bundle exec rspec2 spec
#popd

%pre
getent group vagrant >/dev/null || groupadd -r vagrant

%posttrans
%vagrant_plugin_register %{vagrant_plugin_name}

%preun
%vagrant_plugin_unregister %{vagrant_plugin_name}

%files
%dir %{vagrant_plugin_instdir}
%license %{vagrant_plugin_instdir}/LICENSE.txt
%doc %{vagrant_plugin_instdir}/README.md
%{vagrant_plugin_libdir}
%{vagrant_plugin_instdir}/locales
%exclude %{vagrant_plugin_cache}
%exclude %{vagrant_plugin_instdir}/.gitignore
%{vagrant_plugin_spec}
%{vagrant_plugin_instdir}/Gemfile.lock


%files doc
%doc %{vagrant_plugin_docdir}
%doc %{vagrant_plugin_instdir}/CHANGELOG.md
%{vagrant_plugin_instdir}/Rakefile
%{vagrant_plugin_instdir}/Gemfile
%{vagrant_plugin_instdir}/vagrant-cachier.gemspec
%{vagrant_plugin_instdir}/spec
%{vagrant_plugin_instdir}/development
%{vagrant_plugin_instdir}/docs


%changelog
* Fri Jan 30 2015 Michael Adam <madam@redhat.com> - 1.2.0-1
- Initial package for Fedora