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: 55a91a9d9cba7b8b9d126c75b114e510
11 Patch0: source_root.patch
12 Patch1: rubygems.patch
13 Patch2: no-warning.patch
14 Patch3: %{name}file-shell-provision.patch
16 URL: http://www.vagrantup.com/
18 BuildRequires: rpm-rubyprov
19 BuildRequires: ruby > 1:2.0
21 BuildRequires: ruby-contest >= 0.1.2
22 BuildRequires: ruby-minitest >= 2.5.1
23 BuildRequires: ruby-mocha
24 BuildRequires: ruby-rake
25 BuildRequires: ruby-rspec >= 2.14.0
30 Requires: ruby-bundler >= 1.5.2
31 Requires: ruby-childprocess >= 0.5.0
32 Requires: ruby-erubis >= 2.7.0
33 Requires: ruby-i18n >= 0.6.0
35 Requires: ruby-listen >= 2.7.1
36 Requires: ruby-log4r < 1.1.11
37 Requires: ruby-log4r >= 1.1.9
38 Requires: ruby-net-scp >= 1.1.0
39 Requires: ruby-net-ssh < 2.8.0
40 Requires: ruby-net-ssh >= 2.6.6
41 Requires: ruby-rubygems
42 Suggests: VirtualBox-gui
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 %define _appdir %{_datadir}/%{name}
48 %define bash_compdir %{_datadir}/bash-completion/completions
50 %define vg_home /home/vagrant
51 %define vg_root /vagrant
54 Vagrant offers scripted provisioning and deployment of virtual
55 instances. While VirtualBox is the main target, future versions may
56 support other hypervizors as well.
58 The vision of the project is to create a tool to transparently manage
59 all the complex parts of modern development within a virtual
60 environment without affecting the everyday workflow of the developer
61 too much. A long term goal is moving all development into virtualized
62 environments by making it easier to do so than not to. Additionally,
63 work is ongoing to have Vagrant run identically on every major
64 consumer OS platform (Linux, Mac OS X, and Windows).
66 %package -n bash-completion-%{name}
67 Summary: bash-completion for %{name}
68 Group: Applications/Shells
70 Requires: bash-completion >= 2.0
72 %description -n bash-completion-%{name}
73 bash-completion for %{name}.
76 Summary: Vagrant guest
77 Group: Development/Building
78 URL: http://docs-v1.vagrantup.com/v1/docs/base_boxes.html
79 Requires(postun): /usr/sbin/userdel
80 Requires(pre): /bin/id
81 Requires(pre): /usr/bin/getgid
82 Requires(pre): /usr/sbin/groupadd
83 Requires(pre): /usr/sbin/useradd
84 Requires: /etc/pld-release
85 Requires: kernel(vboxsf)
86 Requires: openssh-server
87 Requires: sudo >= 1.7.4p3-2
89 Provides: group(vagrant)
90 Provides: user(vagrant)
93 This is the package to be installed in Vagrant guest.
95 WARNING: This package installs insecure keypair to vagant user. Do not
96 install this package in a box that is accessible others but you.
98 These keys are the "insecure" public/private keypair we offer to base
99 box creators for use in their base boxes so that vagrant installations
100 can automatically SSH into the boxes.
102 See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
105 Summary: Documentation for %{name}
107 Requires: %{name} = %{version}-%{release}
110 Ruby documentation for %{gem_name}
120 VERSION=$(cat version.txt)
121 sed -i -e "s/__VERSION__/$VERSION/" lib/vagrant/version.rb
123 # cleanup backups after patching
124 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
127 # make gemspec self-contained
128 ruby -r rubygems -e 'spec = eval(File.read("%{name}.gemspec"))
129 File.open("%{name}-%{version}.gemspec", "w") do |file|
130 file.puts spec.to_ruby_for_cache
134 rm -rf $RPM_BUILD_ROOT
135 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_appdir}}
136 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
137 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
138 cp -a keys plugins templates $RPM_BUILD_ROOT%{_appdir}
139 cp -p %{name}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
141 install -d $RPM_BUILD_ROOT%{bash_compdir}
142 cp -p contrib/bash/completion.sh $RPM_BUILD_ROOT%{bash_compdir}/%{name}
145 install -d $RPM_BUILD_ROOT/etc/sudoers.d
146 echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > $RPM_BUILD_ROOT/etc/sudoers.d/%{name}
148 install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
149 cp -p /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
151 # Since Vagrant only supports key-based authentication for SSH, we must
152 # set up the vagrant user to use key-based authentication. We can get the
153 # public key used by the Vagrant gem directly from its Github repository.
154 cp -p keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
157 rm -rf $RPM_BUILD_ROOT
160 %groupadd -g 291 vagrant
161 %useradd -u 291 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
164 if [ "$1" = "0" ]; then
170 %defattr(644,root,root,755)
171 %attr(755,root,root) %{_bindir}/vagrant
172 %{ruby_vendorlibdir}/vagrant.rb
173 %{ruby_vendorlibdir}/vagrant
174 %{ruby_specdir}/%{name}-%{version}.gemspec
177 %files -n bash-completion-%{name}
178 %defattr(644,root,root,755)
179 %{bash_compdir}/%{name}
182 %defattr(644,root,root,755)
183 %attr(440,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sudoers.d/%{name}
184 %dir %attr(750,vagrant,vagrant) %{vg_home}
185 %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
186 %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
187 %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
188 %dir %attr(700,root,root) %{vg_root}
192 %defattr(644,root,root,755)