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 libcrypto.so.1.0.0 libruby.so.1.9 libssl.so.1.0.0 libutil.so.1 libyaml-0.so.2 libz.so.1
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
82 Provides: group(vagrant)
83 Provides: user(vagrant)
84 %if "%{_rpmversion}" >= "5"
89 This is the package to be installed in Vagrant guest.
91 WARNING: This package installs insecure keypair to vagant user. Do not
92 install this package in a box that is accessible others but you.
94 These keys are the "insecure" public/private keypair we offer to base
95 box creators for use in their base boxes so that vagrant installations
96 can automatically SSH into the boxes.
98 See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
101 Summary: Documentation for %{name}
103 Requires: %{name} = %{version}-%{release}
104 %if "%{_rpmversion}" >= "5"
109 Ruby documentation for %{gem_name}
120 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
121 test "$V" = "%{version}"
122 rpm2cpio $SOURCE | cpio -i -d
126 # causes chrpath on th-i686 to fail
127 rm embedded/rgloader/rgloader*.freebsd*.so
129 rm embedded/rgloader/rgloader*.x86_64.so
133 # update RPATH, not to contain insecure /tmp/vagrant-temp/embedded (insecure,
134 # because /tmp is world writable dir) for the rest, just substitute with sed
135 # (so shebangs would be correct)
136 grep -r '/tmp/vagrant-temp/embedded' . -l | xargs -r file -i | while read path mime; do
140 sed -i -e 's,/tmp/vagrant-temp/embedded,%{_appdir}/embedded,' "$path"
142 application/x-executable*|application/x-sharedlib*)
143 rpath=$(chrpath -l $path) || continue
144 rpath=${rpath#$path: RPATH=}
145 [ "$rpath" ] || continue
148 '${ORIGIN}/../lib:/tmp/vagrant-temp/embedded/lib' | \
149 '/tmp/vagrant-temp/embedded/lib:${ORIGIN}/../lib')
150 rpath=%{_appdir}/embedded/lib
151 chrpath -r "$rpath" $path
159 rm -rf $RPM_BUILD_ROOT
161 install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
162 cp -a bin embedded $RPM_BUILD_ROOT%{_appdir}
163 ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
166 cd $RPM_BUILD_ROOT%{_appdir}/embedded/gems/gems/vagrant-%{version}
168 install -d $RPM_BUILD_ROOT/etc/bash_completion.d
169 mv contrib/bash/completion.sh $RPM_BUILD_ROOT/etc/bash_completion.d/%{name}.sh
172 install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
173 cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
175 # Since Vagrant only supports key-based authentication for SSH, we must
176 # set up the vagrant user to use key-based authentication. We can get the
177 # public key used by the Vagrant gem directly from its Github repository.
178 mv keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
181 rm -rf $RPM_BUILD_ROOT
184 # FIXME: register user in uid_gid.db.txt
185 %groupadd -g 2000 vagrant
186 %useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
189 if [ "$1" = "0" ]; then
196 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_bindir}/vagrant
199 %defattr(-,root,root,-)
203 %files -n bash-completion-%{name}
204 %defattr(644,root,root,755)
205 /etc/bash_completion.d/*
208 %defattr(644,root,root,755)
209 %dir %attr(750,vagrant,vagrant) %{vg_home}
210 %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
211 %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
212 %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
213 %dir %attr(700,root,root) %{vg_root}
217 %defattr(644,root,root,755)