2 # - release notes: https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md
3 Summary: Provisioning and deployment of virtual instances
8 Group: Applications/Emulators
9 Source0: https://github.com/mitchellh/vagrant/archive/v%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5: 556b5e5594a327d46b63c4d8024db187
12 Patch1: rubygems.patch
13 Patch2: no-warning.patch
14 Patch3: Vagrantfile.patch
17 Patch6: checkpoint.patch
18 Patch7: insert-key.patch
20 Patch9: pld-chef-installed.patch
21 URL: http://www.vagrantup.com/
23 BuildRequires: rpm-rubyprov
24 BuildRequires: ruby > 1:2.0
26 BuildRequires: ruby-contest >= 0.1.2
27 BuildRequires: ruby-minitest >= 2.5.1
28 BuildRequires: ruby-mocha
29 BuildRequires: ruby-rake
30 BuildRequires: ruby-rspec >= 2.14.0
35 Requires: ruby-bundler >= 1.5.2
36 Requires: ruby-childprocess >= 0.5.0
37 Requires: ruby-erubis >= 2.7.0
38 Requires: ruby-i18n >= 0.6.0
40 Requires: ruby-listen >= 2.7.11
41 Requires: ruby-log4r < 1.1.11
42 Requires: ruby-log4r >= 1.1.9
43 Requires: ruby-net-scp >= 1.1.0
44 Requires: ruby-net-ssh < 2.8.0
45 Requires: ruby-net-ssh >= 2.6.6
46 Requires: ruby-rubygems
47 Suggests: VirtualBox-gui
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 %define _appdir %{_datadir}/%{name}
54 %define bash_compdir %{_datadir}/bash-completion/completions
56 %define vg_home /home/vagrant
57 %define vg_root /vagrant
60 Vagrant offers scripted provisioning and deployment of virtual
61 instances. While VirtualBox is the main target, future versions may
62 support other hypervizors as well.
64 The vision of the project is to create a tool to transparently manage
65 all the complex parts of modern development within a virtual
66 environment without affecting the everyday workflow of the developer
67 too much. A long term goal is moving all development into virtualized
68 environments by making it easier to do so than not to. Additionally,
69 work is ongoing to have Vagrant run identically on every major
70 consumer OS platform (Linux, Mac OS X, and Windows).
72 %package -n bash-completion-%{name}
73 Summary: bash-completion for %{name}
74 Group: Applications/Shells
76 Requires: bash-completion >= 2.0
78 %description -n bash-completion-%{name}
79 bash-completion for %{name}.
82 Summary: Vagrant guest
83 Group: Development/Building
84 URL: http://docs-v1.vagrantup.com/v1/docs/base_boxes.html
85 Requires(postun): /usr/sbin/userdel
86 Requires(pre): /bin/id
87 Requires(pre): /usr/bin/getgid
88 Requires(pre): /usr/sbin/groupadd
89 Requires(pre): /usr/sbin/useradd
90 Requires: /etc/pld-release
91 Requires: kernel(vboxsf)
92 Requires: openssh-server
93 Requires: sudo >= 1.7.4p3-2
95 Provides: group(vagrant)
96 Provides: user(vagrant)
99 This is the package to be installed in Vagrant guest.
101 WARNING: This package installs insecure keypair to vagant user. Do not
102 install this package in a box that is accessible others but you.
104 These keys are the "insecure" public/private keypair we offer to base
105 box creators for use in their base boxes so that vagrant installations
106 can automatically SSH into the boxes.
108 See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
111 Summary: Documentation for %{name}
113 Requires: %{name} = %{version}-%{release}
116 Ruby documentation for %{gem_name}
130 VERSION=$(cat version.txt)
131 sed -i -e "s/__VERSION__/$VERSION/" lib/vagrant/version.rb
133 # cleanup backups after patching
134 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
137 # make gemspec self-contained
138 ruby -r rubygems -e 'spec = eval(File.read("%{name}.gemspec"))
139 File.open("%{name}-%{version}.gemspec", "w") do |file|
140 file.puts spec.to_ruby_for_cache
144 rm -rf $RPM_BUILD_ROOT
145 install -d $RPM_BUILD_ROOT{%{ruby_gemdir}/gems/%{name}-%{version},%{ruby_specdir},%{_bindir}}
146 cp -a lib bin keys plugins templates $RPM_BUILD_ROOT%{ruby_gemdir}/gems/%{name}-%{version}
147 cp -p %{name}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
148 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
150 install -d $RPM_BUILD_ROOT%{bash_compdir}
151 cp -p contrib/bash/completion.sh $RPM_BUILD_ROOT%{bash_compdir}/%{name}
154 install -d $RPM_BUILD_ROOT/etc/sudoers.d
155 echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > $RPM_BUILD_ROOT/etc/sudoers.d/%{name}
157 install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
158 cp -p /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
160 # Since Vagrant only supports key-based authentication for SSH, we must
161 # set up the vagrant user to use key-based authentication. We can get the
162 # public key used by the Vagrant gem directly from its Github repository.
163 cp -p keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
166 rm -rf $RPM_BUILD_ROOT
169 %groupadd -g 291 vagrant
170 %useradd -u 291 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
173 if [ "$1" = "0" ]; then
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{_bindir}/vagrant
181 #%{ruby_vendorlibdir}/vagrant.rb
182 #%{ruby_vendorlibdir}/vagrant
185 %dir %{ruby_gemdir}/gems/%{name}-%{version}
186 %dir %{ruby_gemdir}/gems/%{name}-%{version}/bin
187 %attr(755,root,root) %{ruby_gemdir}/gems/%{name}-%{version}/bin/*
188 %{ruby_gemdir}/gems/%{name}-%{version}/keys
189 %{ruby_gemdir}/gems/%{name}-%{version}/lib
190 %{ruby_gemdir}/gems/%{name}-%{version}/plugins
191 %{ruby_gemdir}/gems/%{name}-%{version}/templates
193 %{ruby_specdir}/%{name}-%{version}.gemspec
195 %files -n bash-completion-%{name}
196 %defattr(644,root,root,755)
197 %{bash_compdir}/%{name}
200 %defattr(644,root,root,755)
201 %attr(440,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sudoers.d/%{name}
202 %dir %attr(750,vagrant,vagrant) %{vg_home}
203 %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
204 %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
205 %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
206 %dir %attr(700,root,root) %{vg_root}
210 %defattr(644,root,root,755)