commit 17b46994440df3951f83782886c535e236c760f8
Author: Elan Ruusamäe <[email protected]>
Date:   Fri Apr 26 15:45:42 2013 +0300

    hackish... instructions how to use plugin

 vagrant-kvm.spec | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)
---
diff --git a/vagrant-kvm.spec b/vagrant-kvm.spec
index a233f4e..6028b07 100644
--- a/vagrant-kvm.spec
+++ b/vagrant-kvm.spec
@@ -1,7 +1,7 @@
 Summary:       Vagrant Plugin to add KVM provider to Vagrant
 Name:          vagrant-kvm
 Version:       0.1.1
-Release:       0.1
+Release:       0.10
 License:       MIT
 Group:         Applications/Emulators
 Source0:       
https://github.com/adrahon/vagrant-kvm/tarball/master?/%{name}-44e7eb1.tgz
@@ -9,6 +9,7 @@ Source0:        
https://github.com/adrahon/vagrant-kvm/tarball/master?/%{name}-44e7eb1.
 URL:           https://github.com/adrahon/vagrant-kvm
 BuildRequires: rpm-rubyprov
 BuildRequires: rpmbuild(macros) >= 1.656
+BuildRequires: ruby-rubygems
 Requires:      ruby-libvirt >= 0.4.0
 Requires:      ruby-nokogiri >= 1.5.6
 Requires:      ruby-rubygems >= 1.3.6
@@ -17,6 +18,11 @@ BuildArch:   noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                vagrantdir      %{_datadir}/vagrant
+%define                gem_dir         %{_datadir}/ruby/gems/%{ruby_version}
+%define                spec_dir        %{gem_dir}/specifications
+
+# disable, we're not packaging gems (yet?)
+%define                __ruby_requires %{nil}
 
 %description
 A Vagrant 1.1+ plugin that adds a KVM provider to Vagrant, allowing
@@ -24,18 +30,36 @@ Vagrant to control and provision KVM/QEMU VM.
 
 %prep
 %setup -qc
-mv adrahon-vagrant-kvm-*/* .
+mv adrahon-vagrant-kvm-*/{.??*,*} .
+
+%build
+# make gem to get cleaned up .gemspec
+gem build vagrant-kvm.gemspec
+gem install --local --install-dir=tmp vagrant-kvm-%{version}.gem --force 
--no-rdoc --no-ri
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{ruby_vendorlibdir}
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{spec_dir}}
 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
+cp -p tmp/specifications/vagrant-kvm-%{version}.gemspec 
$RPM_BUILD_ROOT%{spec_dir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+%banner -o -e %{name} <<-'EOF'
+
+To use this Vagrant plugin, you need to link .gemspec to vagrant 
specifications dir:
+$ ln -s %{spec_dir}/vagrant-kvm-%{version}.gemspec 
~/.vagrant.d/gems/specifications
+
+and it should became available:
+$ vagrant plugin list
+
+EOF
+
 %files
 %defattr(644,root,root,755)
 %doc README.md CHANGELOG.md LICENSE
 %{ruby_vendorlibdir}/vagrant-kvm.rb
 %{ruby_vendorlibdir}/vagrant-kvm
+%{spec_dir}/*.gemspec
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/vagrant-kvm.git/commitdiff/17b46994440df3951f83782886c535e236c760f8

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to