summaryrefslogtreecommitdiffstats
path: root/vagrant-libvirt.spec
blob: ae9884b5db3350e8aae638f0853830070530f14b (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
%global vagrant_plugin_name vagrant-libvirt

Name: %{vagrant_plugin_name}
Version: 0.0.24
Release: 3%{?dist}
Summary: Libvirt provider for vagrant
Group: Development/Languages
License: MIT
URL: https://github.com/pradels/vagrant-libvirt
Source0: https://rubygems.org/gems/%{vagrant_plugin_name}-%{version}.gem
Source1: 10-vagrant-libvirt.rules
# Use fog with ruby-libvirt 0.5.x
Patch0: vagrant-libvirt-fix-dependencies.patch
Patch1: vagrant-libvirt-Rakefile.patch
Requires(pre): shadow-utils
Requires(posttrans): vagrant
Requires(preun): vagrant
Requires: ruby(release)
Requires: ruby(rubygems)
Requires: rubygem(fog) => 1.22
Requires: rubygem(fog) < 2
Requires: rubygem(ruby-libvirt)
#Requires: rubygem(ruby-libvirt) => 0.5.0
#Requires: rubygem(ruby-libvirt) < 0.6
Requires: rubygem(nokogiri) => 1.6.0
Requires: rubygem(nokogiri) < 1.7
Requires: rubygem(multi_json)
Requires: libvirt
Requires: libvirt-daemon-kvm
Requires: polkit
Requires: vagrant
BuildRequires: vagrant
BuildRequires: rubygem(rspec) < 3
BuildRequires: rubygem(fog)
BuildRequires: rubygem(ruby-libvirt)
BuildArch: noarch

%description
Libvirt provider for vagrant.

%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

%patch0 -p1
%patch1 -p1

%build
gem build %{vagrant_plugin_name}.gemspec
%vagrant_plugin_install

%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/

%check
pushd .%{vagrant_plugin_instdir}
sed -i '/:git/ s|:git.*$|:path => "%{vagrant_dir}"|' Gemfile
sed -i '/rspec/ s|\[\".*\"]|["~> 2.0"]|' vagrant-libvirt.gemspec

bundle exec rspec 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
%doc %{vagrant_plugin_instdir}/README.md
%{vagrant_plugin_libdir}
%{vagrant_plugin_instdir}/locales
%{vagrant_plugin_instdir}/tools
%exclude %{vagrant_plugin_cache}
%exclude %{vagrant_plugin_instdir}/.gitignore
%{vagrant_plugin_spec}
# polkit
%{_datadir}/polkit-1/rules.d/10-vagrant-libvirt.rules

%files doc
%doc %{vagrant_plugin_docdir}
%doc %{vagrant_plugin_instdir}/example_box
%doc %{vagrant_plugin_instdir}/CHANGELOG.md
%{vagrant_plugin_instdir}/Rakefile
%{vagrant_plugin_instdir}/Gemfile
%{vagrant_plugin_instdir}/vagrant-libvirt.gemspec
%{vagrant_plugin_instdir}/spec


%changelog
* Fri Jan 23 2015 Michael Adam <madam@redhat.com> - 0.0.24-3
- Adapt dependencies for fedora 21.

* Fri Jan 23 2015 Michael Adam <madam@redhat.com> - 0.0.24-2
- Fix minor review issues.
- Move README.md to main package as doc.
- Rename 10-vagrant.rules to 10-vagrant-libvirt.rules.
- Move LICENSE to main package as license file.
- Remove shebang from non-executable Rakefile.

* Thu Jan 22 2015 Michael Adam <madam@redhat.com> - 0.0.24-1
- Update to version 0.0.24.

* Thu Jan 22 2015 Michael Adam <madam@redhat.com> - 0.0.23-4
- Fix rake dependency.
- Rename patch file.
- Improve description.

* Wed Nov 26 2014 Vít Ondruch <vondruch@redhat.com> - 0.0.23-3
- Enable test suite.
- Update polkit rules.

* Mon Nov 24 2014 Josef Stribny <jstribny@redhat.com> - 0.0.23-2
- Register and unregister the plugin using macros

* Tue Oct 14 2014 Josef Stribny <jstribny@redhat.com> - 0.0.23-1
- Update to 0.0.23
- Use ruby-libvirt 0.5.x
- Move the rest of the doc files to -doc

* Tue Sep 16 2014 Josef Stribny <jstribny@redhat.com> - 0.0.20-2
- Register and unregister automatically

* Wed Sep 10 2014 Josef Stribny <jstribny@redhat.com> - 0.0.20-1
- Update to 0.0.20

* Fri Jun 27 2014 Adam Miller <maxamillion@fedoraproject.org> - 0.0.16-1
- Initial package for Fedora