2016-04-12 19:31:48 +02:00
|
|
|
#
|
|
|
|
# spec file for package vagrant
|
|
|
|
#
|
2021-03-01 19:49:42 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2019-03-23 20:34:56 +01:00
|
|
|
# Copyright (c) 2019 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.
|
|
|
|
|
2018-11-26 13:08:37 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-04-12 19:31:48 +02:00
|
|
|
#
|
|
|
|
|
2020-09-14 09:18:42 +02:00
|
|
|
# disable tests if you want to just run a quick build
|
|
|
|
%{bcond_without tests}
|
2016-04-12 19:31:48 +02:00
|
|
|
|
2019-04-11 20:03:08 +02:00
|
|
|
%global mod_name vagrant
|
|
|
|
%global mod_full_name %{mod_name}-%{version}
|
2018-07-06 10:42:03 +02:00
|
|
|
%global vim_data_dir %{_datadir}/vim/site/plugin/
|
2016-04-12 19:31:48 +02:00
|
|
|
|
2019-04-11 20:03:08 +02:00
|
|
|
|
2016-04-12 19:31:48 +02:00
|
|
|
Name: vagrant
|
2021-04-01 14:26:31 +02:00
|
|
|
Version: 2.2.15
|
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
|
2019-10-30 20:53:18 +01:00
|
|
|
URL: https://github.com/hashicorp/vagrant
|
2019-04-11 20:03:08 +02:00
|
|
|
Source0: %{URL}/archive/v%{version}/%{name}-%{version}.tar.gz
|
2018-07-06 10:42:03 +02:00
|
|
|
Source11: vagrant.1
|
2019-04-11 20:03:08 +02:00
|
|
|
Source93: vagrant_transfiletriggerin.rb
|
|
|
|
Source94: vagrant_transfiletriggerun.rb
|
|
|
|
Source95: vagrant_post.rb
|
|
|
|
Source96: binstub
|
|
|
|
Source97: macros.vagrant
|
2018-07-06 10:42:03 +02:00
|
|
|
Source98: README.SUSE
|
2016-04-12 19:31:48 +02:00
|
|
|
Provides: rubygem-vagrant = %{version}
|
|
|
|
Obsoletes: rubygem-vagrant < %{version}
|
|
|
|
Recommends: vagrant-libvirt
|
|
|
|
#
|
2019-09-15 11:45:25 +02:00
|
|
|
# Patches are maintained in the opensuse_package branch in the
|
|
|
|
# https://github.com/dcermak/vagrant.git repository.
|
|
|
|
# On every new release of vagrant, rebase them on top of the latest tag.
|
2017-08-31 21:03:29 +02:00
|
|
|
#
|
2019-09-15 11:45:25 +02:00
|
|
|
Patch1: 0001-bin-vagrant-silence-warning-about-installer.patch
|
|
|
|
Patch2: 0002-Use-a-private-temporary-dir.patch
|
2020-05-13 10:57:29 +02:00
|
|
|
Patch3: 0003-plugins-don-t-abuse-require_relative.patch.patch
|
|
|
|
Patch4: 0004-fix-vbox-package-boo-1044087-added-by-robert.muntean.patch
|
|
|
|
Patch5: 0005-do-not-depend-on-wdm.patch
|
|
|
|
Patch6: 0006-do-not-abuse-relative-paths-in-docker-plugin-to-make.patch
|
|
|
|
Patch7: 0007-Don-t-abuse-relative-paths-in-plugins.patch
|
|
|
|
Patch8: 0008-Skip-failing-tests.patch
|
|
|
|
Patch9: 0009-Disable-Subprocess-unit-test.patch
|
2016-04-12 19:31:48 +02:00
|
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2019-04-11 20:03:08 +02:00
|
|
|
|
2018-07-06 10:42:03 +02:00
|
|
|
# force only one ruby version
|
2019-04-11 20:03:08 +02:00
|
|
|
# CAUTION: if you change this, then you *must* also change the sed calls which
|
|
|
|
# fix these values in macros.vagrant
|
|
|
|
%global rb_build_versions %rb_default_ruby
|
|
|
|
%global rb_build_abi %rb_default_ruby_abi
|
2020-05-13 10:57:29 +02:00
|
|
|
%global rb_ruby_suffix %rb_default_ruby_suffix
|
|
|
|
|
|
|
|
# we use the rpm macros in this spec
|
|
|
|
# need to load them *after* defining the rb_* macros
|
|
|
|
%{?load:%{SOURCE97}}
|
2019-04-11 20:03:08 +02:00
|
|
|
|
|
|
|
%global vagrant_plugin_name vagrant
|
|
|
|
|
|
|
|
|
|
|
|
#===============================================================================
|
|
|
|
# Build dependencies
|
|
|
|
#===============================================================================
|
|
|
|
|
2020-09-08 08:55:10 +02:00
|
|
|
# s.required_ruby_version = "~> 2.5", "< 2.8"
|
|
|
|
BuildRequires: %{ruby:2 < 2.8}
|
|
|
|
BuildRequires: %{ruby:2 >= 2.5}
|
2018-07-06 10:42:03 +02:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
2016-04-12 19:31:48 +02:00
|
|
|
BuildRequires: %{rubygem bundler}
|
2021-03-01 19:49:42 +01:00
|
|
|
# s.add_dependency "bcrypt_pbkdf", "~> 1.1"
|
|
|
|
BuildRequires: %{rubygem bcrypt_pbkdf:1 >= 1.1 }
|
2020-09-08 08:55:10 +02:00
|
|
|
# s.add_dependency "childprocess", "~> 4.0.0"
|
|
|
|
BuildRequires: %{rubygem childprocess:4.0 }
|
2019-02-03 18:58:38 +01:00
|
|
|
# s.add_dependency "ed25519", "~> 1.2.4"
|
2019-03-10 17:28:57 +01:00
|
|
|
BuildRequires: %{rubygem ed25519:1.2 >= 1.2.4 }
|
2020-12-04 10:16:29 +01:00
|
|
|
# s.add_dependency "erubi"
|
|
|
|
BuildRequires: %{rubygem erubi }
|
2020-02-05 17:37:59 +01:00
|
|
|
# s.add_dependency "i18n", "~> 1.8"
|
|
|
|
BuildRequires: %{rubygem i18n:1 >= 1.8 }
|
2021-01-29 17:28:46 +01:00
|
|
|
# s.add_dependency "listen", "~> 3.4"
|
|
|
|
BuildRequires: %{rubygem listen:3 >= 3.4 }
|
2019-02-03 18:58:38 +01:00
|
|
|
# s.add_dependency "hashicorp-checkpoint", "~> 0.1.5"
|
2019-03-10 17:28:57 +01:00
|
|
|
BuildRequires: %{rubygem hashicorp-checkpoint:0.1 >= 0.1.5 }
|
2018-07-06 10:42:03 +02:00
|
|
|
# s.add_dependency "log4r", "~> 1.1.9", "< 1.1.11"
|
2019-03-10 17:28:57 +01:00
|
|
|
BuildRequires: %{rubygem log4r:1.1 >= 1.1.9 }
|
|
|
|
BuildConflicts: %{rubygem log4r:1.1 >= 1.1.11 }
|
2020-12-04 10:16:29 +01:00
|
|
|
# s.add_dependency "mime-types", "~> 3.3"
|
|
|
|
BuildRequires: %{rubygem mime-types:3 >= 3.3 }
|
2021-04-01 14:26:31 +02:00
|
|
|
# s.add_dependency "net-ssh", ">= 6.1.0", "< 7"
|
|
|
|
BuildRequires: %{rubygem net-ssh:6 >= 6.1.0 }
|
2020-05-14 21:32:50 +02:00
|
|
|
# s.add_dependency "net-sftp", "~> 3.0"
|
|
|
|
BuildRequires: %{rubygem net-sftp:3 }
|
2019-02-03 18:58:38 +01:00
|
|
|
# s.add_dependency "net-scp", "~> 1.2.0"
|
|
|
|
BuildRequires: %{rubygem net-scp:1.2 }
|
2018-07-06 10:42:03 +02:00
|
|
|
# s.add_dependency "rb-kqueue", "~> 0.2.0"
|
|
|
|
BuildRequires: %{rubygem rb-kqueue:0.2 }
|
2020-02-05 17:37:59 +01:00
|
|
|
# s.add_dependency "rubyzip", "~> 2.0"
|
|
|
|
BuildRequires: %{rubygem rubyzip:2}
|
2017-08-31 21:03:29 +02:00
|
|
|
# Intentionally removed, wdm only works on Windows
|
2019-04-11 20:03:08 +02:00
|
|
|
# BuildRequires: %%{rubygem wdm }
|
2020-05-13 10:57:29 +02:00
|
|
|
# s.add_dependency "winrm", ">= 2.3.4", "< 3.0"
|
|
|
|
BuildRequires: %{rubygem winrm:2 >= 2.3.4 }
|
|
|
|
# s.add_dependency "winrm-fs", ">= 1.3.4", "< 2.0"
|
|
|
|
BuildRequires: %{rubygem winrm-fs:1 >= 1.3.4 }
|
|
|
|
# s.add_dependency "winrm-elevated", ">= 1.2.1", "< 2.0"
|
|
|
|
BuildRequires: %{rubygem winrm-elevated:1 >= 1.2.1 }
|
2021-04-01 14:26:31 +02:00
|
|
|
# s.add_dependency "vagrant_cloud", "~> 3.0.4"
|
|
|
|
BuildRequires: %{rubygem vagrant_cloud:3.0 >= 3.0.4 }
|
2019-02-03 18:58:38 +01:00
|
|
|
|
|
|
|
# devel dependencies:
|
2020-12-11 17:31:19 +01:00
|
|
|
# s.add_development_dependency "rake", "~> 13.0"
|
|
|
|
BuildRequires: %{rubygem rake:13 }
|
2019-02-03 18:58:38 +01:00
|
|
|
# s.add_development_dependency "rspec", "~> 3.5.0"
|
|
|
|
BuildRequires: %{rubygem rspec:3.5 }
|
2019-09-15 11:45:25 +02:00
|
|
|
# s.add_development_dependency "rspec-its", "~> 1.3.0"
|
|
|
|
BuildRequires: %{rubygem rspec-its:1.3 }
|
2019-02-03 18:58:38 +01:00
|
|
|
# s.add_development_dependency "webmock", "~> 2.3.1"
|
2019-03-10 17:28:57 +01:00
|
|
|
BuildRequires: %{rubygem webmock:2.3 >= 2.3.1 }
|
2019-02-03 18:58:38 +01:00
|
|
|
# s.add_development_dependency "fake_ftp", "~> 0.1.1"
|
2019-03-10 17:28:57 +01:00
|
|
|
BuildRequires: %{rubygem fake_ftp:0.1 >= 0.1.1 }
|
2019-02-03 18:58:38 +01:00
|
|
|
|
2020-09-08 08:55:10 +02:00
|
|
|
# Prevent have choice for rubygem(ruby:2.7.0:listen:3) >= 3.1
|
2021-01-29 17:28:46 +01:00
|
|
|
BuildRequires: %{rubygem listen:3.4}
|
2019-04-11 20:03:08 +02:00
|
|
|
# Prevent have choice for rubygem(ruby:2.6.0:mime-types) >= 2
|
|
|
|
BuildRequires: %{rubygem mime-types:3 }
|
|
|
|
# Prevent have choice for rubygem(ruby:2.6.0:builder) >= 2.1.2
|
2019-04-29 20:52:22 +02:00
|
|
|
BuildRequires: %{rubygem builder:3.2 }
|
2019-04-26 16:52:13 +02:00
|
|
|
# Prevent have choice for rubygem(ruby:2.6.0:ffi:1) >= 1
|
|
|
|
BuildRequires: %{rubygem ffi >= 1.9 }
|
2019-04-11 20:03:08 +02:00
|
|
|
# Prevent have choice for rubygem(ruby:2.5.0:thor:0) >= 0.18
|
|
|
|
BuildRequires: %{rubygem thor:0.19}
|
2019-09-15 11:45:25 +02:00
|
|
|
# Prevent have choice for rubygem(ruby:2.5.0:addressable) >= 2.3.6
|
2020-09-14 09:18:42 +02:00
|
|
|
BuildRequires: %{rubygem addressable >= 2.7}
|
2019-09-15 11:45:25 +02:00
|
|
|
# Prevent have choice for rubygem(ruby:2.5.0:public_suffix) >= 2.0.2
|
|
|
|
BuildRequires: %{rubygem public_suffix:4}
|
2019-02-03 18:58:38 +01:00
|
|
|
|
2020-05-13 10:57:29 +02:00
|
|
|
# gem2rpm *must* be included as a direct dependency when building with a
|
|
|
|
# non-default ruby version
|
|
|
|
BuildRequires: %{rubygem gem2rpm}
|
2019-02-03 18:58:38 +01:00
|
|
|
BuildRequires: ruby-macros >= 5
|
|
|
|
|
2019-04-11 20:03:08 +02:00
|
|
|
# for the test
|
2020-09-14 09:18:42 +02:00
|
|
|
%if %{with tests}
|
2019-04-11 20:03:08 +02:00
|
|
|
BuildRequires: openssh
|
|
|
|
BuildRequires: curl
|
|
|
|
BuildRequires: bsdtar
|
|
|
|
BuildRequires: %{rubygem vagrant-spec}
|
2020-09-14 09:18:42 +02:00
|
|
|
%endif
|
2019-04-11 20:03:08 +02:00
|
|
|
|
2020-09-08 08:55:10 +02:00
|
|
|
BuildRequires: fdupes
|
2019-04-11 20:03:08 +02:00
|
|
|
|
|
|
|
#===============================================================================
|
|
|
|
# Runtime dependencies
|
|
|
|
#===============================================================================
|
|
|
|
|
2021-03-01 19:49:42 +01:00
|
|
|
# s.add_dependency "bcrypt_pbkdf", "~> 1.1"
|
|
|
|
Requires: %{rubygem bcrypt_pbkdf:1 >= 1.1 }
|
2020-09-08 08:55:10 +02:00
|
|
|
# s.add_dependency "childprocess", "~> 4.0.0"
|
|
|
|
Requires: %{rubygem childprocess:4.0}
|
2019-02-03 18:58:38 +01:00
|
|
|
# s.add_dependency "ed25519", "~> 1.2.4"
|
2019-03-10 17:28:57 +01:00
|
|
|
Requires: %{rubygem ed25519:1.2 >= 1.2.4}
|
2020-12-04 10:16:29 +01:00
|
|
|
# s.add_dependency "erubi"
|
|
|
|
Requires: %{rubygem erubi}
|
2020-02-05 17:37:59 +01:00
|
|
|
# s.add_dependency "i18n", "~> 1.8"
|
|
|
|
Requires: %{rubygem i18n:1 >= 1.8}
|
2021-01-29 17:28:46 +01:00
|
|
|
# s.add_dependency "listen", "~> 3.4"
|
|
|
|
Requires: %{rubygem listen:3 >= 3.4}
|
2019-04-11 20:03:08 +02:00
|
|
|
# s.add_dependency "hashicorp-checkpoint", "~> 0.1.5"
|
|
|
|
Requires: %{rubygem hashicorp-checkpoint:0.1 >= 0.1.5}
|
|
|
|
# s.add_dependency "log4r", "~> 1.1.9", "< 1.1.11"
|
|
|
|
Requires: %{rubygem log4r:1.1 >= 1.1.9 }
|
|
|
|
Requires: %{rubygem log4r:1.1 < 1.1.11 }
|
2020-12-04 10:16:29 +01:00
|
|
|
# s.add_dependency "mime-types", "~> 3.3"
|
|
|
|
Requires: %{rubygem mime-types:3 >= 3.3}
|
2021-04-01 14:26:31 +02:00
|
|
|
# s.add_dependency "net-ssh", ">= 6.1.0", "< 7"
|
|
|
|
Requires: %{rubygem net-ssh:6 >= 6.1.0 }
|
2020-05-14 21:32:50 +02:00
|
|
|
# s.add_dependency "net-sftp", "~> 3.0"
|
|
|
|
Requires: %{rubygem net-sftp:3 }
|
2019-04-11 20:03:08 +02:00
|
|
|
# s.add_dependency "net-scp", "~> 1.2.0"
|
|
|
|
Requires: %{rubygem net-scp:1.2 >= 1.2.0}
|
|
|
|
# s.add_dependency "rb-kqueue", "~> 0.2.0"
|
|
|
|
Requires: %{rubygem rb-kqueue:0.2}
|
2020-02-05 17:37:59 +01:00
|
|
|
# s.add_dependency "rubyzip", "~> 2.0"
|
|
|
|
Requires: %{rubygem rubyzip:2}
|
2019-04-11 20:03:08 +02:00
|
|
|
# s.add_dependency "wdm", "~> 0.1.0"
|
|
|
|
# skip wdm, Windows only
|
2020-05-13 10:57:29 +02:00
|
|
|
# s.add_dependency "winrm", ">= 2.3.4", "< 3.0"
|
|
|
|
Requires: %{rubygem winrm:2 >= 2.3.4}
|
|
|
|
# s.add_dependency "winrm-fs", ">= 1.3.4", "< 2.0"
|
|
|
|
Requires: %{rubygem winrm-fs:1 >= 1.3.4}
|
|
|
|
# s.add_dependency "winrm-elevated", ">= 1.2.1", "< 2.0"
|
|
|
|
Requires: %{rubygem winrm-elevated:1 >= 1.2.1}
|
2021-04-01 14:26:31 +02:00
|
|
|
# s.add_dependency "vagrant_cloud", "~> 3.0.4"
|
|
|
|
Requires: %{rubygem vagrant_cloud:3.0 >= 3.0.4}
|
2019-04-11 20:03:08 +02:00
|
|
|
|
|
|
|
|
2016-04-12 19:31:48 +02:00
|
|
|
Requires: bsdtar
|
|
|
|
Requires: curl
|
|
|
|
Requires: openssh
|
2019-04-11 20:03:08 +02:00
|
|
|
|
2016-04-12 19:31:48 +02:00
|
|
|
%description
|
|
|
|
Vagrant is a tool for building and distributing virtualized development
|
|
|
|
environments.
|
|
|
|
|
2019-04-11 20:03:08 +02:00
|
|
|
%package doc
|
|
|
|
Summary: Documentation for Vagrant
|
|
|
|
Group: Documentation/HTML
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
This package contains the documentation for vagrant.
|
|
|
|
|
|
|
|
%package vim
|
2016-04-12 19:31:48 +02:00
|
|
|
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
|
|
|
|
|
2019-04-11 20:03:08 +02:00
|
|
|
%description vim
|
2016-04-12 19:31:48 +02:00
|
|
|
Optional dependency offering vim syntax files for Vagrantfile
|
|
|
|
|
2019-04-11 20:03:08 +02:00
|
|
|
%package emacs
|
2016-04-12 19:31:48 +02:00
|
|
|
Summary: Vagrantfile syntax files for the emacs editor
|
|
|
|
Group: Development/Languages/Ruby
|
|
|
|
Supplements: packageand(vagrant:emacs_program)
|
|
|
|
BuildRequires: emacs-nox
|
|
|
|
Requires: emacs_program
|
2018-11-26 13:08:37 +01:00
|
|
|
Requires: vagrant = %{version}
|
2016-04-12 19:31:48 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
|
2019-04-11 20:03:08 +02:00
|
|
|
%description emacs
|
2016-04-12 19:31:48 +02:00
|
|
|
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
|
2016-04-12 19:31:48 +02:00
|
|
|
Requires: bash
|
2018-11-17 20:28:51 +01:00
|
|
|
Requires: bash-completion
|
2018-11-26 13:08:37 +01:00
|
|
|
Requires: vagrant = %{version}
|
2016-04-12 19:31:48 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description bash-completion
|
|
|
|
Optional dependency offering bash completion for vagrant
|
|
|
|
|
|
|
|
%prep
|
2020-01-31 10:06:23 +01:00
|
|
|
%autosetup -p1 -n %{mod_full_name}
|
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
|
2019-04-11 20:03:08 +02:00
|
|
|
|
2020-05-13 10:57:29 +02:00
|
|
|
# cannot use %%vagrant_plugin_install here, as we provide a different --bindir
|
2019-04-11 20:03:08 +02:00
|
|
|
CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS"
|
2020-05-13 10:57:29 +02:00
|
|
|
%gem_binary install -V -f --local --no-user-install \
|
2019-04-11 20:03:08 +02:00
|
|
|
--ignore-dependencies --no-document --backtrace \
|
|
|
|
--document=rdoc,ri \
|
|
|
|
--install-dir %{buildroot}%{vagrant_plugin_dir} \
|
|
|
|
--bindir %{buildroot}%{vagrant_plugin_dir}/bin %{_sourcedir}/%{mod_full_name}.gem
|
|
|
|
|
|
|
|
# the actual vagrant binary generated from the binstub
|
|
|
|
install -D -m 755 %{SOURCE96} %{buildroot}%{_bindir}/vagrant
|
2020-05-13 10:57:29 +02:00
|
|
|
gem_path=$(ruby.%{rb_ruby_suffix} -e "print Gem.path.reject{|path| path.include? 'home'}.join(':')")
|
2020-05-19 06:59:51 +02:00
|
|
|
sed -i -e "s|@vagrant_embedded_dir@|%{vagrant_embedded_dir}|" \
|
|
|
|
-e "s|@ruby_vagrant_gem_path@|$gem_path:%{vagrant_plugin_dir}|" \
|
|
|
|
-e "s|@vagrant_rb_ruby_suffix@|%{vagrant_rb_ruby_suffix}|" \
|
|
|
|
%{buildroot}%{_bindir}/%{name}
|
2019-04-11 20:03:08 +02:00
|
|
|
|
|
|
|
# install the rpm macros & expand the name, name-version and vagrant_rb_* macros
|
|
|
|
%global macros_vagrant %{_rpmconfigdir}/macros.d/macros.%{name}
|
|
|
|
install -D -m 0644 %{SOURCE97} %{buildroot}%{macros_vagrant}
|
2020-05-19 06:59:51 +02:00
|
|
|
sed -i -e "s|%%{name}|%{name}|" \
|
|
|
|
-e "s|%{name}-%%{version}|%{name}-%{version}|" \
|
|
|
|
-e "s|%%{rb_build_versions}|%{rb_build_versions}|" \
|
|
|
|
-e "s|%%{rb_build_abi}|%{rb_build_abi}|" \
|
|
|
|
-e "s|%%{rb_ruby_suffix}|%{rb_ruby_suffix}|" \
|
|
|
|
%{buildroot}%{macros_vagrant}
|
2019-04-11 20:03:08 +02:00
|
|
|
|
|
|
|
# install post, transfiletrigerin & transfiletriggerun scriptlets
|
|
|
|
%global post_rb %{vagrant_embedded_dir}/bin/vagrant_post.rb
|
|
|
|
%global transfiletriggerin_rb %{vagrant_embedded_dir}/bin/vagrant_transfiletriggerin.rb
|
|
|
|
%global transfiletriggerun_rb %{vagrant_embedded_dir}/bin/vagrant_transfiletriggerun.rb
|
|
|
|
install -D -m 0755 %{SOURCE93} %{buildroot}%{transfiletriggerin_rb}
|
|
|
|
install -D -m 0755 %{SOURCE94} %{buildroot}%{transfiletriggerun_rb}
|
|
|
|
install -D -m 0755 %{SOURCE95} %{buildroot}%{post_rb}
|
|
|
|
|
|
|
|
# expand macros in scriptlets
|
|
|
|
for file in %{post_rb} %{transfiletriggerin_rb} %{transfiletriggerun_rb}; do
|
|
|
|
sed -i "s|%%{vagrant_dir}|%{vagrant_dir}|" %{buildroot}$file
|
|
|
|
sed -i "s|%%{vagrant_plugin_conf}|%{vagrant_plugin_conf}|" %{buildroot}$file
|
|
|
|
sed -i "s|%%{name}|%{name}|" %{buildroot}$file
|
|
|
|
sed -i "s|%%{version}|%{version}|" %{buildroot}$file
|
2020-05-13 10:57:29 +02:00
|
|
|
sed -i "s|%%{rb_ruby_suffix}|%{rb_ruby_suffix}|" %{buildroot}$file
|
2019-04-11 20:03:08 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# man page
|
|
|
|
install -D -m 644 %{SOURCE11} %{buildroot}%{_mandir}/man1/vagrant.1
|
|
|
|
|
|
|
|
# Bash completion: install it without the .sh ending, otherwise completion is broken
|
|
|
|
# and remove the shebang line in it
|
|
|
|
install -D -m 0644 %{buildroot}%{vagrant_dir}/contrib/bash/completion.sh \
|
|
|
|
%{buildroot}%{_datadir}/bash-completion/completions/%{mod_name}
|
|
|
|
sed -i '1d' %{buildroot}%{_datadir}/bash-completion/completions/%{mod_name}
|
|
|
|
|
|
|
|
# Vim & Emacs syntax highlighting
|
|
|
|
install -D -m 0644 %{buildroot}%{vagrant_dir}/contrib/vim/vagrantfile.vim \
|
|
|
|
%{buildroot}%{vim_data_dir}/%{mod_name}.vim
|
|
|
|
install -D -m 0644 %{buildroot}%{vagrant_dir}/contrib/emacs/vagrant.el \
|
|
|
|
%{buildroot}%{_datadir}/emacs/site-lisp/%{mod_name}.el
|
|
|
|
|
|
|
|
chmod -x %{buildroot}%{vagrant_dir}/templates/locales/en.yml
|
|
|
|
|
|
|
|
# directories for vagrant plugins
|
|
|
|
mkdir -p %{buildroot}%{dirname:%{vagrant_plugin_cache}}
|
|
|
|
mkdir -p %{buildroot}%{dirname:%{vagrant_plugin_spec}}
|
|
|
|
mkdir -p %{buildroot}%{dirname:%{vagrant_plugin_docdir}}
|
|
|
|
|
|
|
|
|
|
|
|
# fix shebang in %%{vagrant_dir}/bin/%%{name}
|
2020-05-13 10:57:29 +02:00
|
|
|
sed -i 's|^\#\!/usr/bin/env.*|\#\!/usr/bin/ruby\.%{rb_ruby_suffix}|' \
|
2019-04-11 20:03:08 +02:00
|
|
|
%{buildroot}%{vagrant_dir}/bin/%{name}
|
|
|
|
|
|
|
|
# remove versioned name from %%{vagrant_plugin_dir}/bin/%%{name}
|
|
|
|
# (aka /usr/share/vagrant/gems/bin/vagrant)
|
2020-05-13 10:57:29 +02:00
|
|
|
mv %{buildroot}%{vagrant_plugin_dir}/bin/%{name}.%{rb_ruby_suffix} \
|
2019-04-11 20:03:08 +02:00
|
|
|
%{buildroot}%{vagrant_plugin_dir}/bin/%{name}
|
|
|
|
|
|
|
|
|
|
|
|
# Garbage collection
|
|
|
|
rm -f %{buildroot}%{vagrant_dir}/test/vagrant-spec/boxes/.keep
|
|
|
|
rm -f %{buildroot}%{vagrant_dir}/bin/vagrant.orig
|
2020-05-13 10:57:29 +02:00
|
|
|
rm -f %{buildroot}%{_bindir}/vagrant.orig.%{rb_ruby_suffix}
|
|
|
|
rm -f %{buildroot}%{vagrant_plugin_dir}/bin/vagrant.orig.%{rb_ruby_suffix}
|
2019-04-11 20:03:08 +02:00
|
|
|
rm -f %{buildroot}%{vagrant_dir}/lib/vagrant/util.rb.orig
|
|
|
|
|
|
|
|
# remove build script from vagrant
|
|
|
|
rm -f %{buildroot}%{vagrant_dir}/.runner.sh
|
2018-07-06 10:42:03 +02:00
|
|
|
|
2020-09-08 08:55:10 +02:00
|
|
|
%fdupes %{buildroot}%{dirname:%vagrant_plugin_dir}
|
2019-01-15 09:10:08 +01:00
|
|
|
|
2019-04-11 20:03:08 +02:00
|
|
|
%check
|
2020-09-14 09:18:42 +02:00
|
|
|
|
|
|
|
%if %{with tests}
|
2019-04-11 20:03:08 +02:00
|
|
|
# remove the git reference to vagrant-spec
|
|
|
|
# -> don't have to cleanup, the Gemfile is excluded anyway
|
|
|
|
sed -i "s|gem 'vagrant-spec', git.*$|gem 'vagrant-spec'|" Gemfile
|
2018-07-06 10:42:03 +02:00
|
|
|
|
2020-05-13 10:57:29 +02:00
|
|
|
export GEM_PATH=%{buildroot}%{vagrant_plugin_dir}:$(ruby.%{rb_ruby_suffix} -e "print Gem.path.reject{|path| path.include? 'home'}.join(':')")
|
2019-04-11 20:03:08 +02:00
|
|
|
bundle exec rake test:unit
|
2020-09-14 09:18:42 +02:00
|
|
|
%endif
|
|
|
|
# with tests
|
2019-04-11 20:03:08 +02:00
|
|
|
|
|
|
|
%pre
|
|
|
|
getent group vagrant >/dev/null || groupadd -r vagrant
|
2018-11-17 20:28:51 +01:00
|
|
|
|
|
|
|
%post
|
2019-04-11 20:03:08 +02:00
|
|
|
%{post_rb}
|
|
|
|
|
2020-09-14 09:18:42 +02:00
|
|
|
%transfiletriggerin -- %{dirname:%{vagrant_plugin_spec}}/
|
2019-04-11 20:03:08 +02:00
|
|
|
%{transfiletriggerin_rb}
|
2018-11-17 20:28:51 +01:00
|
|
|
|
2020-09-14 09:18:42 +02:00
|
|
|
%transfiletriggerun -- %{dirname:%{vagrant_plugin_spec}}/
|
2019-04-11 20:03:08 +02:00
|
|
|
%{transfiletriggerun_rb}
|
2016-04-12 19:31:48 +02:00
|
|
|
|
|
|
|
%files
|
2019-04-11 20:03:08 +02:00
|
|
|
%doc %{vagrant_dir}/CHANGELOG.md
|
|
|
|
%doc %{vagrant_dir}/README.md
|
|
|
|
%doc %{vagrant_dir}/README.SUSE
|
|
|
|
%license %{vagrant_dir}/LICENSE
|
|
|
|
|
|
|
|
%{_bindir}/%{name}
|
|
|
|
%{_mandir}/man1/%{name}.*
|
|
|
|
|
|
|
|
%{macros_vagrant}
|
|
|
|
|
|
|
|
# scriptlets
|
|
|
|
%dir %{dirname: %{post_rb}}
|
|
|
|
%{post_rb}
|
|
|
|
%{transfiletriggerin_rb}
|
|
|
|
%{transfiletriggerun_rb}
|
|
|
|
|
|
|
|
%dir %{vagrant_embedded_dir}
|
|
|
|
%ghost %{vagrant_plugin_conf}
|
|
|
|
|
|
|
|
# plugin directories
|
|
|
|
%dir %{vagrant_plugin_dir}
|
|
|
|
%dir %{vagrant_plugin_dir}/gems
|
|
|
|
%dir %{vagrant_plugin_dir}/bin
|
|
|
|
%dir %{dirname:%{vagrant_plugin_cache}}
|
|
|
|
%dir %{dirname:%{vagrant_plugin_spec}}
|
|
|
|
%dir %{dirname:%{vagrant_plugin_docdir}}
|
|
|
|
|
|
|
|
# vagrant's own files & directories
|
|
|
|
%{vagrant_plugin_cache}
|
|
|
|
%{vagrant_plugin_spec}
|
|
|
|
%{vagrant_plugin_dir}/bin/%{name}
|
|
|
|
|
|
|
|
%dir %{vagrant_dir}
|
|
|
|
%dir %{vagrant_dir}/bin
|
|
|
|
%dir %{vagrant_dir}/keys
|
|
|
|
%dir %{vagrant_dir}/lib
|
|
|
|
%dir %{vagrant_dir}/plugins
|
|
|
|
%dir %{vagrant_dir}/templates
|
|
|
|
%{vagrant_dir}/version.txt
|
|
|
|
%{vagrant_dir}/%{mod_full_name}.gemspec
|
|
|
|
%{vagrant_dir}/bin/%{name}
|
|
|
|
%{vagrant_dir}/keys/*
|
|
|
|
%{vagrant_dir}/lib/*
|
|
|
|
%{vagrant_dir}/plugins/*
|
|
|
|
%{vagrant_dir}/templates/*
|
|
|
|
|
|
|
|
# these are scripts for Hashicorp
|
|
|
|
%exclude %{vagrant_dir}/scripts/*
|
|
|
|
# either packaged in -vim -emacs subpackages or not relevant
|
|
|
|
%exclude %{vagrant_dir}/contrib
|
|
|
|
# various dotfiles we don't care about (.travis.yml et.al.)
|
|
|
|
%exclude %{vagrant_dir}/.*
|
|
|
|
# Development files
|
|
|
|
%exclude %{vagrant_dir}/Vagrantfile
|
|
|
|
%exclude %{vagrant_dir}/Rakefile
|
|
|
|
%exclude %{vagrant_dir}/Gemfile
|
|
|
|
%exclude %{vagrant_dir}/RELEASE.md
|
|
|
|
%exclude %{vagrant_dir}/tasks/*
|
|
|
|
# ruby configuration for acceptance tests
|
|
|
|
%exclude %{vagrant_dir}/vagrant-spec.config.example.rb
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
%dir %{vagrant_plugin_docdir}
|
|
|
|
%doc %{vagrant_plugin_docdir}/rdoc
|
|
|
|
%doc %{vagrant_plugin_docdir}/ri
|
2016-04-12 19:31:48 +02:00
|
|
|
|
|
|
|
%files vim
|
2018-07-06 10:42:03 +02:00
|
|
|
%{vim_data_dir}/%{mod_name}.vim
|
2016-04-12 19:31:48 +02:00
|
|
|
|
|
|
|
%files emacs
|
|
|
|
%{_datadir}/emacs/site-lisp/%{mod_name}.el
|
|
|
|
|
|
|
|
%files bash-completion
|
2019-04-11 20:03:08 +02:00
|
|
|
%{_datadir}/bash-completion/completions/%{mod_name}
|
2016-04-12 19:31:48 +02:00
|
|
|
|
|
|
|
%changelog
|