%define name <%= pkg.name %> %define version <%= pkg.version %> %define unmangled_version <%= pkg.version %> %define release 1 Summary: <%= pkg.summary %> Name: %{name} Version: %{version} Release: %{release} Source0: %{name}-%{unmangled_version}.tar.gz License: <%= pkg.license %> Group: Development/Tools Prefix: %{_prefix} Vendor: <%= pkg.authors.first %> <<%= pkg.email.first %>> Url: <%= pkg.homepage %> BuildArch: noarch BuildRequires: ruby, rubygem-rake, rubygem-bundler Requires: ruby, rubygem-rake %define gemdir <%= Gem.dir %> %define gembuilddir %{buildroot}%{gemdir} %description <%= pkg.description %> %prep %setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version} %build %install %{__rm} -rf %{buildroot} mkdir -p %{gembuilddir} sed -i -e 's#spec.files\s*=.*#spec.files = Dir.glob("**/*")#' %{name}.gemspec rake build gem install --local --install-dir %{gembuilddir} --force pkg/*.gem mkdir -p %{buildroot}/%{_bindir} mv %{gembuilddir}/bin/* %{buildroot}/%{_bindir} rmdir %{gembuilddir}/bin %clean rm -rf $RPM_BUILD_ROOT %files %{gemdir} %{_bindir}/*