2 # - release notes: https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md
5 %bcond_without vagrant # build vagrant package
7 Summary: Provisioning and deployment of virtual instances
12 Group: Applications/Emulators
13 URL: http://vagrantup.com/
14 Source0: http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/vagrant_i686.rpm?/%{name}-%{version}.i686.rpm
15 # Source0-md5: d62c19378ca3e731b1a76bc6336d7b53
16 Source1: http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/vagrant_x86_64.rpm?/%{name}-%{version}.x86_64.rpm
17 # Source1-md5: b4a7d312e5f0c279dbadd86fe12df4e6
18 Source2: https://raw.github.com/mitchellh/vagrant/master/keys/%{name}.pub
19 # Source2-md5: b440b5086dd12c3fd8abb762476b9f40
22 BuildRequires: pkgconfig
23 BuildRequires: rpm-pythonprov
24 BuildRequires: rpm-utils
26 BuildRequires: sed >= 4.0
28 ExclusiveArch: %{ix86} %{x8664}
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _appdir %{_libdir}/%{name}
33 %define vg_home /home/vagrant
34 %define vg_root /vagrant
36 # no Provides from private modules
37 %define _noautoprovfiles %{_appdir}
38 # do not require libs provided by this package
39 %define _noautoreq libffi.so.6
41 %define no_install_post_check_so 1
44 Vagrant offers scripted provisioning and deployment of virtual
45 instances. While VirtualBox is the main target, future versions may
46 support other hypervizors as well.
48 The vision of the project is to create a tool to transparently manage
49 all the complex parts of modern development within a virtual
50 environment without affecting the everyday workflow of the developer
51 too much. A long term goal is moving all development into virtualized
52 environments by making it easier to do so than not to. Additionally,
53 work is ongoing to have Vagrant run identically on every major
54 consumer OS platform (Linux, Mac OS X, and Windows).
56 %package -n bash-completion-%{name}
57 Summary: bash-completion for %{name}
58 Group: Applications/Shells
60 Requires: bash-completion
61 %if "%{_rpmversion}" >= "5"
65 %description -n bash-completion-%{name}
66 bash-completion for %{name}.
69 Summary: Vagrant guest
70 Group: Development/Building
71 URL: http://docs-v1.vagrantup.com/v1/docs/base_boxes.html
72 Requires(postun): /usr/sbin/userdel
73 Requires(pre): /bin/id
74 Requires(pre): /usr/bin/getgid
75 Requires(pre): /usr/sbin/groupadd
76 Requires(pre): /usr/sbin/useradd
77 Requires: /etc/pld-release
78 Requires: kernel(vboxsf)
79 Requires: openssh-server
81 Provides: group(vagrant)
82 Provides: user(vagrant)
83 %if "%{_rpmversion}" >= "5"
88 This is the package to be installed in Vagrant guest.
90 WARNING: This package installs insecure keypair to vagant user. Do not
91 install this package in a box that is accessible others but you.
93 These keys are the "insecure" public/private keypair we offer to base
94 box creators for use in their base boxes so that vagrant installations
95 can automatically SSH into the boxes.
97 See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
100 Summary: Documentation for %{name}
102 Requires: %{name} = %{version}-%{release}
103 %if "%{_rpmversion}" >= "5"
108 Ruby documentation for %{gem_name}
119 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
120 test "$V" = "%{version}"
121 rpm2cpio $SOURCE | cpio -i -d
125 # causes chrpath on th-i686 to fail
126 rm embedded/rgloader/rgloader*.freebsd*.so
128 rm embedded/rgloader/rgloader*.x86_64.so
132 # update RPATH, not to contain insecure /tmp/vagrant-temp/embedded (insecure,
133 # because /tmp is world writable dir) for the rest, just substitute with sed
134 # (so shebangs would be correct)
135 grep -r '/tmp/vagrant-temp/embedded' . -l | xargs -r file -i | while read path mime; do
139 sed -i -e 's,/tmp/vagrant-temp/embedded,%{_appdir}/embedded,' "$path"
141 application/x-executable*|application/x-sharedlib*)
142 rpath=$(chrpath -l $path) || continue
143 rpath=${rpath#$path: RPATH=}
144 [ "$rpath" ] || continue
147 '${ORIGIN}/../lib:/tmp/vagrant-temp/embedded/lib' | \
148 '/tmp/vagrant-temp/embedded/lib:${ORIGIN}/../lib')
149 rpath=%{_appdir}/embedded/lib
150 chrpath -r "$rpath" $path
158 rm -rf $RPM_BUILD_ROOT
160 install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
161 cp -a bin embedded $RPM_BUILD_ROOT%{_appdir}
162 ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
165 cd $RPM_BUILD_ROOT%{_appdir}/embedded/gems/gems/vagrant-%{version}
167 install -d $RPM_BUILD_ROOT/etc/bash_completion.d
168 mv contrib/bash/completion.sh $RPM_BUILD_ROOT/etc/bash_completion.d/%{name}.sh
171 install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
172 cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
174 # Since Vagrant only supports key-based authentication for SSH, we must
175 # set up the vagrant user to use key-based authentication. We can get the
176 # public key used by the Vagrant gem directly from its Github repository.
177 mv keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
180 rm -rf $RPM_BUILD_ROOT
183 # FIXME: register user in uid_gid.db.txt
184 %groupadd -g 2000 vagrant
185 %useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
188 if [ "$1" = "0" ]; then
195 %defattr(644,root,root,755)
196 %attr(755,root,root) %{_bindir}/vagrant
198 %defattr(-,root,root,-)
202 %files -n bash-completion-%{name}
203 %defattr(644,root,root,755)
204 /etc/bash_completion.d/*
207 %defattr(644,root,root,755)
208 %dir %attr(750,vagrant,vagrant) %{vg_home}
209 %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
210 %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
211 %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
212 %dir %attr(700,root,root) %{vg_root}
216 %defattr(644,root,root,755)