jcaamano / rpms / vagrant

Forked from rpms/vagrant 3 years ago
Clone
94e6c85
%global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :)
da831a8
4bc2b64
%global vagrant_spec_commit c0dafc996165bf1628b672dd533f1858ff66fe4a
4bc2b64
94e6c85
Name: vagrant
da831a8
Version: 1.6.5
126c957
Release: 13%{?dist}
da831a8
Summary: Build and distribute virtualized development environments
da831a8
Group: Development/Languages
da831a8
License: MIT
da831a8
URL: http://vagrantup.com
94e6c85
Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
da831a8
da831a8
# Upstream binstub with adjusted paths, the offical way how to run vagrant
da831a8
Source1: binstub
da831a8
4bc2b64
# The library has no official release yet. But since it is just test
4bc2b64
# dependency, it should be fine to include the source right here.
4bc2b64
Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz
0c8a413
c11853f
# Monkey-patching needed for Vagrant to work until the respective patches
c11853f
# for RubyGems and Bundler are in place
c11853f
Source3: patches.rb
c11853f
126c957
Source4: macros.vagrant
126c957
a0e92dc
# The load directive is supported since RPM 4.12, i.e. F21+. The build process
a0e92dc
# fails on older Fedoras.
a0e92dc
%{?load:%{SOURCE4}}
a0e92dc
94e6c85
Patch0: vagrant-1.6.5-fix-dependencies.patch
cc85749
da831a8
Requires: ruby(release)
da831a8
Requires: ruby(rubygems) >= 1.3.6
7dc35cc
# Explicitly specify MRI, since Vagrant does not work with JRuby ATM.
94e6c85
Requires: ruby
eaf8b60
# rb-inotify should be installed by listen, but this dependency was removed
eaf8b60
# in Fedora's package.
eaf8b60
Requires: rubygem(rb-inotify)
da831a8
Requires: rubygem(bundler) >= 1.5.2
da831a8
Requires: rubygem(hashicorp-checkpoint) >= 0.1.1
da831a8
Requires: rubygem(childprocess) >= 0.5.0
da831a8
Requires: rubygem(erubis) >= 2.7.0
da831a8
Requires: rubygem(i18n) >= 0.6.0
da831a8
Requires: rubygem(listen) >= 2.7.1
da831a8
Requires: rubygem(log4r)
da831a8
Requires: rubygem(net-ssh) >= 2.6.6
da831a8
Requires: rubygem(net-scp) >= 1.1.0
23151d9
Requires: rubygem(nokogiri) >= 1.6
94e6c85
Requires: bsdtar
ff40c83
Requires: curl
da831a8
da831a8
#Requires: polkit-pkla-compat
e9f28ac
Requires(pre): shadow-utils
da831a8
0c8a413
BuildRequires: bsdtar
b06fc4b
BuildRequires: rubygem(listen)
b06fc4b
BuildRequires: rubygem(childprocess)
b06fc4b
BuildRequires: rubygem(hashicorp-checkpoint)
b06fc4b
BuildRequires: rubygem(log4r)
b06fc4b
BuildRequires: rubygem(net-ssh)
b06fc4b
BuildRequires: rubygem(net-scp)
b06fc4b
BuildRequires: rubygem(nokogiri)
b06fc4b
BuildRequires: rubygem(i18n)
b06fc4b
BuildRequires: rubygem(erubis)
0c8a413
BuildRequires: rubygem(rb-inotify)
a977236
BuildRequires: rubygem(rspec) < 3
b06fc4b
BuildRequires: rubygem(bundler)
94e6c85
BuildRequires: pkgconfig(bash-completion)
da831a8
BuildArch: noarch
da831a8
da831a8
%description
da831a8
Vagrant is a tool for building and distributing virtualized development
da831a8
environments.
da831a8
da831a8
%package doc
da831a8
Summary: Documentation for %{name}
da831a8
Group: Documentation
da831a8
Requires: %{name} = %{version}-%{release}
da831a8
BuildArch: noarch
da831a8
da831a8
%description doc
da831a8
Documentation for %{name}.
da831a8
126c957
%package devel
126c957
Summary: Package shipping development files for Vagrant
126c957
126c957
%description devel
126c957
Package shipping macros for convinient plugin registration and
126c957
unregistration.
da831a8
da831a8
%prep
da831a8
%setup -q
cc85749
94e6c85
%patch0 -p1
da831a8
da831a8
%build
da831a8
da831a8
%install
94e6c85
mkdir -p %{buildroot}%{vagrant_dir}
da831a8
cp -pa ./* \
94e6c85
        %{buildroot}%{vagrant_dir}/
da831a8
94e6c85
find %{buildroot}%{vagrant_dir}/bin -type f | xargs chmod a+x
cc85749
420d9e2
rm %{buildroot}%{vagrant_dir}/{CHANGELOG,CONTRIBUTING,README}.md
420d9e2
rm %{buildroot}%{vagrant_dir}/LICENSE
da831a8
94e6c85
# Provide executable similar to upstream:
94e6c85
# https://github.com/mitchellh/vagrant-installers/blob/master/substrate/modules/vagrant_installer/templates/vagrant.erb
94e6c85
install -D -m 755 %{SOURCE1} %{buildroot}%{_bindir}/vagrant
94e6c85
sed -i 's|@vagrant_dir@|%{vagrant_dir}|' %{buildroot}%{_bindir}/vagrant
a0e92dc
sed -i 's|@vagrant_plugin_conf_dir@|%{vagrant_plugin_conf_dir}|' %{buildroot}%{_bindir}/vagrant
da831a8
da831a8
# auto-completion
94e6c85
install -D -m 0644 %{buildroot}%{vagrant_dir}/contrib/bash/completion.sh \
94e6c85
  %{buildroot}%{bashcompletion_dir}/%{name}
da831a8
da831a8
# create the global home dir
a0e92dc
install -d -m 755 %{buildroot}%{vagrant_plugin_conf_dir}
da831a8
c11853f
# Install the monkey-patch file and load it from Vagrant after loading RubyGems
c11853f
cp %{SOURCE3}  %{buildroot}%{vagrant_dir}/lib/vagrant
c11853f
sed -i -e "11irequire 'vagrant/patches'" %{buildroot}%{vagrant_dir}/lib/vagrant.rb
c11853f
126c957
# Install Vagrant macros
126c957
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
126c957
cp %{SOURCE4} %{buildroot}%{_rpmconfigdir}/macros.d/
a0e92dc
sed -i "s/%%{name}/%{name}/" %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{name}
126c957
c11853f
0c8a413
%check
0c8a413
# Unpack the vagran-spec and adjust the directory name.
0c8a413
tar xvzf %{S:2} -C ..
4bc2b64
mv ../vagrant-spec{-%{vagrant_spec_commit},}
0c8a413
0c8a413
# Remove the git reference, which is useless in our case.
0c8a413
sed -i '/git/ s/^/#/' ../vagrant-spec/vagrant-spec.gemspec
0c8a413
0c8a413
# TODO: winrm is not in Fedora yet.
0c8a413
rm -rf test/unit/plugins/communicators/winrm
0c8a413
sed -i '/it "eager loads WinRM" do/,/^      end$/ s/^/#/' test/unit/vagrant/machine_test.rb
0c8a413
sed -i '/it "should return the specified communicator if given" do/,/^    end$/ s/^/#/' test/unit/vagrant/machine_test.rb
0c8a413
0c8a413
bundle --local
0c8a413
0c8a413
# Test suite must be executed in order.
0c8a413
ruby -rbundler/setup -I.:lib -e 'Dir.glob("test/unit/**/*_test.rb").sort.each &method(:require)'
da831a8
da831a8
%pre
da831a8
getent group vagrant >/dev/null || groupadd -r vagrant
da831a8
 
da831a8
%files
420d9e2
%license LICENSE
94e6c85
%{_bindir}/%{name}
420d9e2
%dir %{vagrant_dir}
420d9e2
%exclude %{vagrant_dir}/.*
420d9e2
%exclude %{vagrant_dir}/Vagrantfile
420d9e2
%{vagrant_dir}/bin
420d9e2
# TODO: Make more use of contribs.
420d9e2
%{vagrant_dir}/contrib
420d9e2
%exclude %{vagrant_dir}/contrib/bash
420d9e2
%{vagrant_dir}/vagrant.gemspec
420d9e2
%{vagrant_dir}/keys
420d9e2
%{vagrant_dir}/lib
420d9e2
%{vagrant_dir}/plugins
420d9e2
%exclude %{vagrant_dir}/scripts
420d9e2
%{vagrant_dir}/templates
420d9e2
%{vagrant_dir}/version.txt
420d9e2
%exclude %{vagrant_dir}/website
94e6c85
%{bashcompletion_dir}/%{name}
94e6c85
%dir %{_sharedstatedir}/%{name}
94e6c85
%ghost %{_sharedstatedir}/%{name}/plugins.json
da831a8
da831a8
%files doc
420d9e2
%doc CONTRIBUTING.md CHANGELOG.md README.md
420d9e2
%{vagrant_dir}/Gemfile
420d9e2
%{vagrant_dir}/Rakefile
420d9e2
%{vagrant_dir}/tasks
420d9e2
%{vagrant_dir}/test
420d9e2
%{vagrant_dir}/vagrant-spec.config.example.rb
420d9e2
126c957
%files devel
126c957
%{_rpmconfigdir}/macros.d/macros.%{name}
126c957
da831a8
da831a8
%changelog
126c957
* Tue Nov 25 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-13
126c957
- Create -devel sub-package
126c957
c11853f
* Mon Nov 24 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-12
c11853f
- Include monkey-patching for RubyGems and Bundler for now
c11853f
94e6c85
* Wed Oct 22 2014 Vít Ondruch <vondruch@redhat.com> - 1.6.5-11
94e6c85
- Make vagrant non-rubygem package.
94e6c85
da831a8
* Tue Oct 14 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-10
da831a8
- rebuilt
da831a8
da831a8
* Tue Oct 07 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-9
da831a8
- Register vagrant-libvirt automatically
da831a8
da831a8
* Tue Sep 30 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-8
da831a8
- Set libvirt as a default provider
da831a8
da831a8
* Tue Sep 23 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-7
da831a8
- Require core dependencies for vagrant-libvirt beforehand
da831a8
da831a8
* Mon Sep 22 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-6
da831a8
- Fix SSL cert path for the downloader
da831a8
da831a8
* Tue Sep 16 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-5
da831a8
- rebuilt
da831a8
da831a8
* Tue Sep 16 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-4
da831a8
- rebuilt
da831a8
da831a8
* Sat Sep 13 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-3
da831a8
- Include libvirt requires for now
da831a8
da831a8
* Wed Sep 10 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-2
da831a8
- Add missing deps on Bundler and hashicorp-checkpoint
da831a8
da831a8
* Mon Sep 08 2014 Josef Stribny <jstribny@redhat.com> - 1.6.5-1
da831a8
* Update to 1.6.5
da831a8
da831a8
* Mon Sep 08 2014 Josef Stribny <jstribny@redhat.com> - 1.6.3-2
da831a8
- Clean up
da831a8
- Update to 1.6.3
da831a8
da831a8
* Fri Oct 18 2013  <adrahon@redhat.com> - 1.3.3-1.1
da831a8
- Misc bug fixes, no separate package for docs, /etc/vagrant management
da831a8
da831a8
* Tue Sep 24 2013  <adrahon@redhat.com> - 1.3.3-1
da831a8
- Initial package