+#
+# Conditional build:
+%bcond_without vagrant # build vagrant package
+
Summary: Provisioning and deployment of virtual instances
Name: vagrant
Version: 1.1.2
-Release: 0.4
+Release: 0.6
License: MIT
Group: Applications/Emulators
URL: http://vagrantup.com/
# Source0-md5: 83093a71588f97a9eb69fa7fe07418b9
Source1: http://files.vagrantup.com/packages/67bd4d30f7dbefa7c0abc643599f0244986c38c8/vagrant_x86_64.rpm?/%{name}-%{version}.x86_64.rpm
# Source1-md5: 3efa3ac73988c565e6b3236da6867557
+BuildRequires: bash
BuildRequires: pkgconfig
BuildRequires: rpm-pythonprov
BuildRequires: rpm-utils
%define _appdir %{_libdir}/%{name}
+%define vg_home /home/vagrant
+
%define _enable_debug_packages 0
%define no_install_post_strip 1
%define no_install_post_check_so 1
work is ongoing to have Vagrant run identically on every major
consumer OS platform (Linux, Mac OS X, and Windows).
+%package guest
+Summary: Vagrant guest
+Group: Development/Building
+Requires(postun): /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires: openssh-server
+Provides: group(vagrant)
+Provides: user(vagrant)
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
+
+%description guest
+This is the package to be installed in Vagrant guest.
+
+WARNING: This package installs insecure keypair to vagant user. Do not
+install this package in a box that is accessible others but you.
+
+These keys are the "insecure" public/private keypair we offer to base
+box creators for use in their base boxes so that vagrant installations
+can automatically SSH into the boxes.
+
+See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
+
%package doc
Summary: Documentation for %{name}
Group: Documentation
V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
test "$V" = "%{version}"
-
rpm2cpio $SOURCE | cpio -i -d
mv opt/vagrant/* .
%install
rm -rf $RPM_BUILD_ROOT
+%if %{with vagrant}
install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
-
cp -a bin embedded $RPM_BUILD_ROOT%{_appdir}
ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
+%endif
+
+# guest
+install -d $RPM_BUILD_ROOT%{vg_home}/.ssh
+cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
%clean
rm -rf $RPM_BUILD_ROOT
+%pre guest
+# FIXME: register user in uid_gid.db.txt
+%groupadd -g 2000 vagrant
+%useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
+
+%postun guest
+if [ "$1" = "0" ]; then
+ %userremove vagrant
+ %groupremove vagrant
+fi
+
+%if %{with vagrant}
%files
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/vagrant
%defattr(-,root,root,-)
%{_appdir}
+%endif
+
+%files guest
+%defattr(644,root,root,755)
+%dir %attr(750,vagrant,vagrant) %{vg_home}
+%dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
+%dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
%if 0
%files doc