vagrant/vagrant.spec

250 lines
8.5 KiB
RPMSpec

#
# spec file for package vagrant
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# 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}
%{!?vim_data_dir:%global vim_data_dir /usr/share/vim/%(readlink /usr/share/vim/current)}
Name: vagrant
Version: 1.9.7
Release: 0
Summary: Build and distribute virtualized development environments
License: MIT
Group: Development/Languages/Ruby
Url: https://github.com/mitchellh/vagrant
Source0: https://github.com/mitchellh/vagrant/archive/v%{version}/%{mod_name}-%{version}.tar.gz
Source2: vagrant.1
Source3: README.SUSE
Source99: %{name}-rpmlintrc
Provides: rubygem-vagrant = %{version}
Obsoletes: rubygem-vagrant < %{version}
Recommends: vagrant-libvirt
#
Patch1: 0001-Disable-Checkpoint.patch
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
Patch6: 0006-Relax-dependency-resolution.patch
Patch8: 0008-Read-data-from-usr-share-vagrant.patch
Patch9: 0009-plugins-don-t-abuse-require_relative.patch
Patch10: 0010-virtualbox-5.2-support.patch
#
#
# try building with ruby2.4
Patch20: 0020-also-build-with-ruby2.4.patch
Patch21: 0021-Use-Integer-instead-of-Fixnum-for-Ruby-2.4-compatibi.patch
Patch22: 0022-Do-not-use-deprecated-API.patch
Patch23: 0023-vbox-fix-package.patch
Patch24: 0024-do-not-depend-on-wdm.patch
Patch25: 0025-do-not-abuse-relative-paths-in-docker-plugin.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define rb_build_versions %rb_default_ruby
%define rb_build_abi %rb_default_ruby_abi
#
BuildRequires: %{ruby >= 2.0.0}
BuildRequires: %{rubygem bundler}
BuildRequires: %{rubygem childprocess <= 0.7 }
BuildRequires: %{rubygem crack }
# Prevent have choice for rubygem(ruby:2.2.0:erubis)
BuildRequires: %{rubygem erubis >= 2.7}
BuildRequires: %{rubygem fake_ftp < 0.3}
BuildRequires: %{rubygem hashicorp-checkpoint}
BuildRequires: %{rubygem i18n <= 0.8 }
BuildRequires: %{rubygem listen >= 3.1.5}
BuildRequires: %{rubygem log4r}
# Prevent have choice for rubygem(ruby:2.2.0:net-scp)
BuildRequires: %{rubygem net-scp >= 1.2}
BuildRequires: %{rubygem net-sftp}
BuildRequires: %{rubygem net-ssh:4.1}
# Prevent have choice for rubygem(ruby:2.2.0:nokogiri)
BuildRequires: %{rubygem nokogiri >= 1.7}
# Prevent have choice for rubygem(ruby:2.1.0:mime-types) >= 1.16
BuildRequires: %{rubygem mime-types >= 2}
# Prevent have choice for rubygem(ruby:2.4.0:addressable) >= 2.3.6
BuildRequires: %{rubygem addressable >= 2.4 }
# Prevent have choice for rubygem(ruby:2.4.0:builder) >= 2.1.2
BuildRequires: %{rubygem builder >= 3.1 }
BuildRequires: ruby-macros >= 5
# inotify should go here
#BuildRequires: %{rubygem rb-kqueue}
BuildRequires: %{rubygem rake <= 12.0 }
BuildRequires: %{rubygem rake >= 11.3 }
BuildRequires: %{rubygem rb-kqueue }
BuildRequires: %{rubygem rest-client}
BuildRequires: %{rubygem rspec <= 2.15 }
BuildRequires: %{rubygem ruby_dep <= 1.5 }
# Intentionally removed, wdm only works on Windows
# BuildRequires: %{rubygem wdm }
BuildRequires: %{rubygem webmock }
BuildRequires: %{rubygem winrm }
BuildRequires: %{rubygem winrm-elevated }
BuildRequires: %{rubygem winrm-fs }
#
Requires: %{rubygem childprocess}
# Prevent have choice for rubygem(ruby:2.2.0:erubis)
Requires: %{rubygem erubis >= 2.7}
Requires: %{rubygem i18n}
Requires: %{rubygem listen}
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}
# inotify should go here
#Requires: %{rubygem rb-kqueue0}
Requires: %{rubygem rest-client}
# We don't require rubygem mime-types since it's pulled in transitively
#
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
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
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)
Requires: bash
BuildArch: noarch
%description bash-completion
Optional dependency offering bash completion for vagrant
%prep
%setup -q -n %{mod_full_name}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch6 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
#
#
#
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
cp %{SOURCE3} .
%build
mv %{mod_name}.gemspec %{mod_full_name}.gemspec
%gem_build
mv %{mod_full_name}.gem %{_sourcedir}
bundle exec bin/vagrant --version
%install
# Tumbleweed OR Leap 42.2+
%if %suse_version >= 1320 || 0%{?sle_version} >= 120200
%gem_install -f --no-symlink-binaries
%else
%gem_install -f
%endif
%{__mkdir_p} %{buildroot}%{_mandir}/man1
install -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1/vagrant.1
install -D -d -m 0755 \
%{buildroot}%{_sysconfdir}/bash_completion.d/ \
%{buildroot}%{vim_data_dir}/plugin/ \
%{buildroot}%{_datadir}/emacs/site-lisp/
mv %{buildroot}%{gem_base}/gems/%{mod_full_name}/contrib/bash/completion.sh %{buildroot}%{_sysconfdir}/bash_completion.d/%{mod_name}.sh
mv %{buildroot}%{gem_base}/gems/%{mod_full_name}/contrib/vim/vagrantfile.vim %{buildroot}%{vim_data_dir}/plugin/%{mod_name}.vim
mv %{buildroot}%{gem_base}/gems/%{mod_full_name}/contrib/emacs/vagrant.el %{buildroot}%{_datadir}/emacs/site-lisp/%{mod_name}.el
# Tumbleweed OR Leap 42.2+
%if %suse_version >= 1320 || 0%{?sle_version} >= 120200
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
rm -rf %{buildroot}%{gem_base}/gems/%{mod_full_name}/.travis.yml
rm -rf %{buildroot}%{gem_base}/gems/%{mod_full_name}/.gitignore
%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,-)
%{vim_data_dir}/plugin/%{mod_name}.vim
%files emacs
%defattr(-,root,root,-)
%{_datadir}/emacs/site-lisp/%{mod_name}.el
%files bash-completion
%defattr(-,root,root,-)
%config %{_sysconfdir}/bash_completion.d/%{mod_name}.sh
%changelog