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/87613ec9392d4660ffcb1d5755307136c06af08c/vagrant_i686.rpm?/%{name}-%{version}.i686.rpm
15 # Source0-md5: 970e0f11eea80ae57fd64cd25993382b
16 Source1: http://files.vagrantup.com/packages/87613ec9392d4660ffcb1d5755307136c06af08c/vagrant_x86_64.rpm?/%{name}-%{version}.x86_64.rpm
17 # Source1-md5: 95f30df5cb93db6282f7edc42eedfe59
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 %define no_install_post_check_so 1
39 Vagrant offers scripted provisioning and deployment of virtual
40 instances. While VirtualBox is the main target, future versions may
41 support other hypervizors as well.
43 The vision of the project is to create a tool to transparently manage
44 all the complex parts of modern development within a virtual
45 environment without affecting the everyday workflow of the developer
46 too much. A long term goal is moving all development into virtualized
47 environments by making it easier to do so than not to. Additionally,
48 work is ongoing to have Vagrant run identically on every major
49 consumer OS platform (Linux, Mac OS X, and Windows).
51 %package -n bash-completion-%{name}
52 Summary: bash-completion for %{name}
53 Group: Applications/Shells
55 Requires: bash-completion
56 %if "%{_rpmversion}" >= "5"
60 %description -n bash-completion-%{name}
61 bash-completion for %{name}.
64 Summary: Vagrant guest
65 Group: Development/Building
66 URL: http://docs-v1.vagrantup.com/v1/docs/base_boxes.html
67 Requires(postun): /usr/sbin/userdel
68 Requires(pre): /bin/id
69 Requires(pre): /usr/bin/getgid
70 Requires(pre): /usr/sbin/groupadd
71 Requires(pre): /usr/sbin/useradd
72 Requires: /etc/pld-release
73 Requires: kernel(vboxsf)
74 Requires: openssh-server
76 Provides: group(vagrant)
77 Provides: user(vagrant)
78 %if "%{_rpmversion}" >= "5"
83 This is the package to be installed in Vagrant guest.
85 WARNING: This package installs insecure keypair to vagant user. Do not
86 install this package in a box that is accessible others but you.
88 These keys are the "insecure" public/private keypair we offer to base
89 box creators for use in their base boxes so that vagrant installations
90 can automatically SSH into the boxes.
92 See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
95 Summary: Documentation for %{name}
97 Requires: %{name} = %{version}-%{release}
98 %if "%{_rpmversion}" >= "5"
103 Ruby documentation for %{gem_name}
114 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
115 test "$V" = "%{version}"
116 rpm2cpio $SOURCE | cpio -i -d
120 # causes chrpath on th-i686 to fail
121 rm embedded/rgloader/rgloader*.freebsd*.so
123 rm embedded/rgloader/rgloader*.x86_64.so
127 # update RPATH, not to contain insecure /tmp/vagrant-temp/embedded (insecure,
128 # because /tmp is world writable dir) for the rest, just substitute with sed
129 # (so shebangs would be correct)
130 grep -r '/tmp/vagrant-temp/embedded' . -l | xargs -r file -i | while read path mime; do
134 sed -i -e 's,/tmp/vagrant-temp/embedded,%{_appdir}/embedded,' "$path"
136 application/x-executable*|application/x-sharedlib*)
137 rpath=$(chrpath -l $path) || continue
138 rpath=${rpath#$path: RPATH=}
139 [ "$rpath" ] || continue
142 '${ORIGIN}/../lib:/tmp/vagrant-temp/embedded/lib' | \
143 '/tmp/vagrant-temp/embedded/lib:${ORIGIN}/../lib')
144 rpath=%{_appdir}/embedded/lib
145 chrpath -r "$rpath" $path
153 rm -rf $RPM_BUILD_ROOT
155 install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
156 cp -a bin embedded $RPM_BUILD_ROOT%{_appdir}
157 ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
160 cd $RPM_BUILD_ROOT%{_appdir}/embedded/gems/gems/vagrant-%{version}
162 install -d $RPM_BUILD_ROOT/etc/bash_completion.d
163 mv contrib/bash/completion.sh $RPM_BUILD_ROOT/etc/bash_completion.d/%{name}.sh
166 install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
167 cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
169 # Since Vagrant only supports key-based authentication for SSH, we must
170 # set up the vagrant user to use key-based authentication. We can get the
171 # public key used by the Vagrant gem directly from its Github repository.
172 mv keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
175 rm -rf $RPM_BUILD_ROOT
178 # FIXME: register user in uid_gid.db.txt
179 %groupadd -g 2000 vagrant
180 %useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
183 if [ "$1" = "0" ]; then
190 %defattr(644,root,root,755)
191 %attr(755,root,root) %{_bindir}/vagrant
193 %defattr(-,root,root,-)
197 %files -n bash-completion-%{name}
198 %defattr(644,root,root,755)
199 /etc/bash_completion.d/*
202 %defattr(644,root,root,755)
203 %dir %attr(750,vagrant,vagrant) %{vg_home}
204 %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
205 %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
206 %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
207 %dir %attr(700,root,root) %{vg_root}
211 %defattr(644,root,root,755)