Blob Blame History Raw
%global vagrant_plugin_name vagrant-libvirt

Name: %{vagrant_plugin_name}
Version: 0.0.30
Release: 4%{?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

# Pass MAC addresses up to vagrant to ensure interfaces are configured correctly
# https://github.com/pradels/vagrant-libvirt/pull/408
Patch0: vagrant-libvirt-match-interface-by-mac.patch

Requires(pre): shadow-utils
Requires(posttrans): vagrant
Requires(preun): vagrant
Requires: ruby(release)
Requires: ruby(rubygems)
Requires: rubygem(fog-libvirt)
Requires: rubygem(nokogiri) => 1.6.0
Requires: rubygem(nokogiri) < 1.7
Requires: rubygem(multi_json)
# vagrant-libvirt supports only kvm and qemu for now.
# https://github.com/pradels/vagrant-libvirt#provider-options
Requires: libvirt-daemon-kvm
Requires: polkit
Requires: vagrant
BuildRequires: vagrant
BuildRequires: rubygem(rspec) < 3
BuildRequires: rubygem(fog-libvirt)
BuildArch: noarch
Provides: vagrant(%{vagrant_plugin_name}) = %{version}

%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

%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/
mkdir -p %{buildroot}%{vagrant_plugin_docdir}/polkit
install -m 0644 %{SOURCE1} %{buildroot}%{vagrant_plugin_docdir}/polkit

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

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
%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
# TODO: Disabled for now, since this might have security implications.
#%exclude %{_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
* Mon Sep 14 2015 Josef Stribny <jstribny@redhat.com> - 0.0.30-4
- Drop unnecessary explicit libvirt require

* Fri Jul 10 2015 Dan Williams <dcbw@redhat.com> - 0.0.30-3
- Fix: pass MAC addresses to vagrant to configure interfaces correctly

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.30-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jun 08 2015 Michael Adam <madam@redhat.com> - 0.0.30-1
- Update to 0.0.30 (#1220194)

* Tue Apr 21 2015 Josef Stribny <jstribny@redhat.com> - 0.0.26-2
- Fix: Wait for libvirt to shutdown the domain

* Mon Apr 20 2015 Josef Stribny <jstribny@redhat.com> - 0.0.26-1
- Update to 0.0.26

* Tue Mar 10 2015 Josef Stribny <jstribny@redhat.com> - 0.0.25-1
- Update to 0.0.25

* Wed Jan 28 2015 Michael Adam <madam@redhat.com> - 0.0.24-3
- Ship the polkit rules file as example in the docs package.

* Wed Jan 28 2015 Vít Ondruch <vondruch@redhat.com> - 0.0.24-2
- Do not ship polkit rules for now, since this might have security implications.

* Fri Jan 23 2015 Michael Adam <madam@redhat.com> - 0.0.24-2
- 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.

* Thu Nov 27 2014 Vít Ondruch <vondruch@redhat.com> - 0.0.23-4
- Add vagrant(vagrant-libvirt) virtual provide.

* 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