2016-04-12 19:31:48 +02:00
#
# spec file for package vagrant
#
2018-01-30 15:44:45 +01:00
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
2016-04-12 19:31:48 +02:00
# Copyright (c) 2012 Laurent Bigonville <bigon@debian.org>, License GPL-2.0+
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define mod_name vagrant
%define mod_full_name %{mod_name}-%{version}
2018-07-06 10:42:03 +02:00
#
# Use
#
%global vim_data_dir %{_datadir} /vim/site/plugin/
2016-04-12 19:31:48 +02:00
Name : vagrant
2018-11-17 21:32:31 +01:00
Version : 2.1.5
2016-04-12 19:31:48 +02:00
Release : 0
2018-07-06 10:42:03 +02:00
Summary : Tool for building and distributing virtualized development environments
2016-04-12 19:31:48 +02:00
License : MIT
Group : Development/Languages/Ruby
2018-07-06 10:42:03 +02:00
Url : https://github.com/hashicorp/vagrant
Source0 : https://github.com/hashicorp/vagrant/archive/v%{version} .tar.gz#/%{mod_name}-%{version}.tar.gz
Source11 : vagrant.1
Source98 : README.SUSE
2016-04-12 19:31:48 +02:00
Source99 : %{name} -rpmlintrc
Provides : rubygem-vagrant = %{version}
Obsoletes : rubygem-vagrant < %{version}
Recommends: vagrant-libvirt
#
2017-03-12 20:03:16 +01:00
Patch2 : 0002-bin-vagrant-silence-warning-about-installer.patch
Patch3 : 0003-Use-a-private-temporary-dir.patch
Patch4 : 0004-linux-cap-halt-don-t-wait-for-shutdown-h-now-to-fini.patch
Patch9 : 0009-plugins-don-t-abuse-require_relative.patch
2017-08-31 21:03:29 +02:00
#
#
# try building with ruby2.4
Patch23 : 0023-vbox-fix-package.patch
Patch24 : 0024-do-not-depend-on-wdm.patch
2017-11-07 09:59:57 +01:00
Patch25 : 0025-do-not-abuse-relative-paths-in-docker-plugin.patch
2016-04-12 19:31:48 +02:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2018-07-06 10:42:03 +02:00
# force only one ruby version
2016-04-12 19:31:48 +02:00
%define rb_build_versions %rb_default_ruby
%define rb_build_abi %rb_default_ruby_abi
2017-11-07 09:59:57 +01:00
#
2016-04-12 19:31:48 +02:00
BuildRequires : %{ruby >= 2.0.0}
2018-07-06 10:42:03 +02:00
#
#
#
2016-04-12 19:31:48 +02:00
BuildRequires : %{rubygem bundler}
2018-07-06 10:42:03 +02:00
# s.add_dependency "childprocess", "~> 0.6.0"
BuildRequires : %{rubygem childprocess:0.6 }
2017-08-31 21:03:29 +02:00
BuildRequires : %{rubygem crack }
2018-07-06 10:42:03 +02:00
# s.add_dependency "erubis", "~> 2.7.0"
BuildRequires : %{rubygem erubis:2.7 }
# s.add_development_dependency "fake_ftp", "~> 0.1"
BuildRequires : %{rubygem fake_ftp:0.1 }
# s.add_dependency "hashicorp-checkpoint", "~> 0.1.5"
BuildRequires : %{rubygem hashicorp-checkpoint:0.1.5 }
# s.add_dependency "i18n", ">= 0.6.0", "<= 0.8.0"
BuildRequires : %{rubygem i18n < 0.8 }
BuildRequires : %{rubygem i18n >= 0.6 }
# s.add_dependency "listen", "~> 3.1.5"
BuildRequires : %{rubygem listen:3.1.5 }
# s.add_dependency "log4r", "~> 1.1.9", "< 1.1.11"
BuildRequires : %{rubygem log4r < 1.1.11 }
BuildRequires : %{rubygem log4r >= 1.1.9 }
# s.add_dependency "net-scp", "~> 1.2.0"
BuildRequires : %{rubygem net-scp:1.2 }
# s.add_dependency "net-sftp", "~> 2.1"
BuildRequires : %{rubygem net-sftp:2.1 }
# s.add_dependency "net-ssh", "~> 4.2.0"
# patched to 5.0.x by 0027-now-use-rubygem-net-ssh-5.0.x.patch
BuildRequires : %{rubygem net-ssh:5.0}
2017-03-12 20:03:16 +01:00
# Prevent have choice for rubygem(ruby:2.2.0:nokogiri)
BuildRequires : %{rubygem nokogiri >= 1.7}
2017-11-07 09:59:57 +01:00
# Prevent have choice for rubygem(ruby:2.1.0:mime-types) >= 1.16
2017-03-12 20:03:16 +01:00
BuildRequires : %{rubygem mime-types >= 2}
2017-11-07 09:59:57 +01:00
# Prevent have choice for rubygem(ruby:2.4.0:addressable) >= 2.3.6
2017-08-31 21:03:29 +02:00
BuildRequires : %{rubygem addressable >= 2.4 }
2017-11-07 09:59:57 +01:00
# Prevent have choice for rubygem(ruby:2.4.0:builder) >= 2.1.2
2017-08-31 21:03:29 +02:00
BuildRequires : %{rubygem builder >= 3.1 }
2016-04-12 19:31:48 +02:00
BuildRequires : ruby-macros >= 5
2018-07-06 10:42:03 +02:00
# s.add_development_dependency "rake", "~> 12.0.0"
BuildRequires : %{rubygem rake:12.0 }
# s.add_dependency "rb-kqueue", "~> 0.2.0"
BuildRequires : %{rubygem rb-kqueue:0.2 }
# s.add_dependency "rest-client", ">= 1.6.0", "< 3.0"
BuildRequires : %{rubygem rest-client < 3.0}
BuildRequires : %{rubygem rest-client >= 1.6}
# s.add_development_dependency "rspec", "~> 3.5.0"
BuildRequires : %{rubygem rspec:3.5 }
# s.add_development_dependency "rspec-its", "~> 1.2.0"
BuildRequires : %{rubygem rspec-its:1.2 }
BuildRequires : %{rubygem rspec:3.5 }
2017-08-31 21:03:29 +02:00
BuildRequires : %{rubygem ruby_dep <= 1.5 }
# Intentionally removed, wdm only works on Windows
# BuildRequires: %{rubygem wdm }
2018-07-06 10:42:03 +02:00
# s.add_development_dependency "webmock", "~> 2.3.1"
BuildRequires : %{rubygem webmock:2.3 }
# s.add_dependency "winrm", "~> 2.1"
BuildRequires : %{rubygem winrm:2.1 }
# s.add_dependency "winrm-elevated", "~> 1.1"
BuildRequires : %{rubygem winrm-elevated:1.1 }
# s.add_dependency "winrm-fs", "~> 1.0"
BuildRequires : %{rubygem winrm-fs:1 }
#
#
2016-04-12 19:31:48 +02:00
#
2017-03-12 20:03:16 +01:00
Requires : %{rubygem childprocess}
# Prevent have choice for rubygem(ruby:2.2.0:erubis)
Requires : %{rubygem erubis >= 2.7}
Requires : %{rubygem i18n}
2016-04-12 19:31:48 +02:00
Requires : %{rubygem listen}
2017-03-12 20:03:16 +01:00
Requires : %{rubygem log4r}
# Prevent have choice for rubygem(ruby:2.2.0:net-scp)
Requires : %{rubygem net-scp >= 1.2}
Requires : %{rubygem net-sftp}
Requires : %{rubygem net-ssh}
# Prevent have choice for rubygem(ruby:2.2.0:nokogiri)
Requires : %{rubygem nokogiri >= 1.7}
#Requires: %{rubygem rb-kqueue0}
2016-04-12 19:31:48 +02:00
Requires : %{rubygem rest-client}
2017-03-12 20:03:16 +01:00
# We don't require rubygem mime-types since it's pulled in transitively
2016-04-12 19:31:48 +02:00
#
Requires : bsdtar
Requires : curl
Requires : openssh
#
%description
Vagrant is a tool for building and distributing virtualized development
environments.
%package vim
Summary : Vagrantfile syntax files for the vim editor
Group : Development/Languages/Ruby
Supplements: packageand(vagrant:vim)
BuildRequires : vim
2018-07-08 21:39:15 +02:00
Requires : vagrant = %{version}
2016-04-12 19:31:48 +02:00
Requires : vim
BuildArch : noarch
%description vim
Optional dependency offering vim syntax files for Vagrantfile
%package emacs
Summary : Vagrantfile syntax files for the emacs editor
Group : Development/Languages/Ruby
Supplements: packageand(vagrant:emacs_program)
BuildRequires : emacs-nox
2018-07-08 21:39:15 +02:00
Requires : vagrant = %{version}
2016-04-12 19:31:48 +02:00
Requires : emacs_program
BuildArch : noarch
%description emacs
Optional dependency offering emacs syntax files for Vagrantfile
%package bash-completion
Summary : Vagrant bash autocompletion
Group : Development/Languages/Ruby
Supplements: packageand(vagrant:bash)
2018-07-06 10:42:03 +02:00
BuildRequires : bash
2018-11-17 20:28:51 +01:00
BuildRequires : bash-completion
2018-07-08 21:39:15 +02:00
Requires : vagrant = %{version}
2016-04-12 19:31:48 +02:00
Requires : bash
2018-11-17 20:28:51 +01:00
Requires : bash-completion
2016-04-12 19:31:48 +02:00
BuildArch : noarch
%description bash-completion
Optional dependency offering bash completion for vagrant
%prep
%setup -q -n %{mod_full_name}
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch9 -p1
2017-08-31 21:03:29 +02:00
#
#
#
%patch23 -p1
%patch24 -p1
2017-11-07 09:59:57 +01:00
%patch25 -p1
2016-04-12 19:31:48 +02:00
2018-07-06 10:42:03 +02:00
cp %{SOURCE98} .
2016-04-12 19:31:48 +02:00
%build
mv %{mod_name} .gemspec %{mod_full_name} .gemspec
%gem_build
mv %{mod_full_name} .gem %{_sourcedir}
%install
2017-03-12 20:03:16 +01:00
# Tumbleweed OR Leap 42.2+
%if %suse_version >= 1320 || 0%{?sle_version} >= 120200
2016-04-12 19:31:48 +02:00
%gem_install -f --no-symlink-binaries
%else
%gem_install -f
%endif
2018-07-06 10:42:03 +02:00
mkdir -p %{buildroot} /%{_mandir} /man1
install -m 644 %{SOURCE11} %{buildroot} %{_mandir} /man1/vagrant.1
2016-04-12 19:31:48 +02:00
install -D -d -m 0755 \
%{buildroot} %{_sysconfdir} /bash_completion.d/ \
%{buildroot} %{_datadir} /emacs/site-lisp/
2018-07-11 20:39:01 +02:00
install -d -m 0777 %{buildroot} %{vim_data_dir} /
install -d -m 0755 %{buildroot} %{_datadir} vagrant-plugins/ \
%{buildroot} %{_datadir} vagrant-plugins/plugins.d
2018-07-06 10:42:03 +02:00
2016-04-12 19:31:48 +02:00
mv %{buildroot} %{gem_base} /gems/%{mod_full_name} /contrib/bash/completion.sh %{buildroot} %{_sysconfdir} /bash_completion.d/%{mod_name} .sh
2018-07-06 10:42:03 +02:00
mv %{buildroot} %{gem_base} /gems/%{mod_full_name} /contrib/vim/vagrantfile.vim %{buildroot} %{vim_data_dir} /%{mod_name} .vim
2016-04-12 19:31:48 +02:00
mv %{buildroot} %{gem_base} /gems/%{mod_full_name} /contrib/emacs/vagrant.el %{buildroot} %{_datadir} /emacs/site-lisp/%{mod_name} .el
2017-03-12 20:03:16 +01:00
# Tumbleweed OR Leap 42.2+
2018-07-06 10:42:03 +02:00
%if %suse_version >= 1320 || 0%{?sle_version} >= 120000
2016-04-12 19:31:48 +02:00
mv -v %{buildroot} %{_bindir} /vagrant.%{rb_default_ruby_suffix} %{buildroot} %{_bindir} /vagrant
%endif
mkdir -p %{buildroot} %{_datadir} /%{name}
mv %{buildroot} %{gem_base} /gems/%{mod_full_name} /keys %{buildroot} %{_datadir} /%{name} /keys
mv %{buildroot} %{gem_base} /gems/%{mod_full_name} /plugins %{buildroot} %{_datadir} /%{name} /plugins
mv %{buildroot} %{gem_base} /gems/%{mod_full_name} /templates %{buildroot} %{_datadir} /%{name} /templates
chmod -x %{buildroot} %{_datadir} /%{name} /templates/locales/en.yml
install -m 644 version.txt %{buildroot} %{_datadir} /%{name}
mkdir -p %{buildroot} %{_datadir} /%{name} -plugins/plugins.d
echo " { } " > %{buildroot} %{_datadir} /%{name} -plugins/plugins.json
2018-07-06 10:42:03 +02:00
rm -f %{buildroot} %{gem_base} /gems/%{mod_full_name} /.travis.yml
rm -f %{buildroot} %{gem_base} /gems/%{mod_full_name} /.gitignore
rm -f %{buildroot} %{gem_base} /gems/%{mod_full_name} /test/vagrant-spec/boxes/.keep
rm -f %{buildroot} %{gem_base} /gems/%{mod_full_name} /bin/vagrant.orig
rm -f %{buildroot} %{_bindir} /vagrant.orig.%{rb_default_ruby_suffix}
rm -f %{buildroot} %{gem_base} /gems/%{mod_full_name} /lib/vagrant/util.rb.orig
# change shebang in /usr/lib64/ruby/gems/*/gems/vagrant-2.1.1/.runner.sh
sed -i '1 s/^.*$/#!\/bin\/bash/' %{buildroot} %{gem_base} /gems/%{mod_full_name} /.runner.sh
# change shebang in /etc/bash_completion.d/vagrant.sh
sed -i '1d' %{buildroot} %{_sysconfdir} /bash_completion.d/%{mod_name} .sh
2018-11-17 20:28:51 +01:00
# move file to %{_datadir}/bash-completion/completions/ to avoid warnings
install -d 755 %{buildroot} %{_datadir} /bash-completion/completions/
mv -v %{buildroot} %{_sysconfdir} /bash_completion.d/%{mod_name} .sh %{buildroot} %{_datadir} /bash-completion/completions/
%post
# link directories to avoid the following error:
# /usr/lib64/ruby/2.5.0/pathname.rb:444:in `open': No such file or directory @ dir_initialize - /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/plugins (Errno::ENOENT)
ln -s %{_datadir} /%{name} /keys %{gem_base} /gems/%{mod_full_name} /keys
ln -s %{_datadir} /%{name} /plugins %{gem_base} /gems/%{mod_full_name} /plugins
ln -s %{_datadir} /%{name} /templates %{gem_base} /gems/%{mod_full_name} /templates
%postun
rm -f %{gem_base} /gems/%{mod_full_name} /keys
rm -f %{gem_base} /gems/%{mod_full_name} /plugins
rm -f %{gem_base} /gems/%{mod_full_name} /templates
2016-04-12 19:31:48 +02:00
%files
%defattr (-,root,root,-)
%doc CHANGELOG.md LICENSE README.SUSE
%{_bindir} /vagrant
%{gem_base} /cache/%{mod_full_name} .gem
%{gem_base} /doc/%{mod_full_name} /
%{gem_base} /gems/%{mod_full_name} /
%{gem_base} /specifications/%{mod_full_name} .gemspec
%{_datadir} /%{name}
%dir %{_datadir} /%{name} -plugins
%dir %{_datadir} /%{name} -plugins/plugins.d
%{_datadir} /%{name} -plugins/plugins.json
%{_mandir} /man1/vagrant.*
%files vim
%defattr (-,root,root,-)
2018-07-06 10:42:03 +02:00
%{vim_data_dir} /%{mod_name} .vim
2016-04-12 19:31:48 +02:00
%files emacs
%defattr (-,root,root,-)
%{_datadir} /emacs/site-lisp/%{mod_name} .el
%files bash-completion
%defattr (-,root,root,-)
2018-11-17 20:28:51 +01:00
%{_datadir} /bash-completion/completions/%{mod_name} .sh
2016-04-12 19:31:48 +02:00
%changelog