# Generated from <%= package.spec.file_name %> by gem2rpm -*- rpm-spec -*- %global vagrant_plugin_name <%= spec.name %> Name: %{vagrant_plugin_name} Version: <%= spec.version %> Release: 1%{?dist} Summary: <%= spec.summary.gsub(/\.$/, "") %> Group: Development/Languages License: <%= spec.licenses.join(" and ") %> <% if spec.homepage -%> URL: <%= spec.homepage %> <% end -%> Source0: <%= download_path %>%{vagrant_plugin_name}-%{version}.gem Requires(posttrans): vagrant Requires(preun): vagrant Requires: vagrant BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby BuildRequires: vagrant <% if spec.extensions.empty? -%> BuildArch: noarch <% end -%> Provides: vagrant(%{vagrant_plugin_name}) = %{version} %description <%= spec.description %> <% if doc_subpackage -%> %package doc Summary: Documentation for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name}. <% end # if doc_subpackage -%> %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{vagrant_plugin_name}-%{version} gem spec %{SOURCE0} -l --ruby > %{vagrant_plugin_name}.gemspec %build # Create the gem as gem install only works on a gem file gem build %{vagrant_plugin_name}.gemspec # %%vagrant_plugin_install compiles any C extensions and installs the gem into ./%%gem_dir # by default, so that we can move it into the buildroot in %%install %vagrant_plugin_install %install mkdir -p %{buildroot}%{vagrant_plugin_dir} cp -a .%{vagrant_plugin_dir}/* \ %{buildroot}%{vagrant_plugin_dir}/ <% unless spec.extensions.empty? -%> mkdir -p %{buildroot}%{vagrant_plugin_extdir_mri} cp -a .%{vagrant_plugin_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{vagrant_plugin_extdir_mri}/ <% for ext in spec.extensions -%> # Prevent dangling symlink in -debuginfo (rhbz#878863). rm -rf %{buildroot}%{vagrant_plugin_instdir}/<%= ext.split(File::SEPARATOR).first %>/ <% end -%> <% end -%> <% unless spec.executables.nil? or spec.executables.empty? -%> mkdir -p %{buildroot}%{_bindir} cp -pa .%{_bindir}/* \ %{buildroot}%{_bindir}/ <% end -%> <% unless spec.executables.empty? -%> find %{buildroot}%{vagrant_plugin_instdir}/bin -type f | xargs chmod a+x <% end -%> # Run the test suite %check pushd .%{vagrant_plugin_instdir} popd %posttrans %vagrant_plugin_register %{vagrant_plugin_name} %preun %vagrant_plugin_unregister %{vagrant_plugin_name} <% # Change macros for Vagrant packaging config.macros[:instdir] = '%{vagrant_plugin_instdir}' config.macros[:libdir] = '%{vagrant_plugin_libdir}' -%> %files %dir %{vagrant_plugin_instdir} <% unless spec.executables.nil? or spec.executables.empty? -%> <% for f in spec.executables -%> %{_bindir}/<%= f %> <% end -%> <% end -%> <% unless spec.extensions.empty? -%> %{vagrant_plugin_extdir_mri} <% end -%> <%= main_file_entries(spec) %> <% unless doc_subpackage -%> %doc %{vagrant_plugin_docdir} <%= doc_file_entries(spec) -%> <% end -%> %exclude %{vagrant_plugin_cache} %{vagrant_plugin_spec} <% if doc_subpackage -%> %files doc %doc %{vagrant_plugin_docdir} <%= doc_file_entries(spec) %> <% end # if doc_subpackage -%> %changelog * <%= Time.now.strftime("%a %b %d %Y") %> <%= packager %> - <%= spec.version %>-1 - Initial package