ruby/ruby.macros

61 lines
1.7 KiB
Plaintext
Raw Normal View History

%rubygems_requires %{rubygems19_requires}
%rb_binary %{rb19_binary}
%gem_binary /usr/bin/gem1.9
%rb_arch %{rb19_arch}
%rb_ver %{rb19_ver}
%rb_dir %{rb19_dir}
%rb_libdir %{rb19_libdir}
%rb_archdir %{rb19_archdir}
%rb_sitedir %rb19_sitedir
%rb_sitelibdir %rb19_sitelibdir
%rb_sitearchdir %rb19_sitearchdir
%rb_vendordir %rb19_vendordir
%rb_vendorlibdir %rb19_vendorlibdir
%rb_vendorarchdir %rb19_vendorarchdir
# old names
%rb_sitelib %rb19_sitelibdir
%rb_sitearch %rb19_sitearchdir
#
%rb_vendorlib %rb19_vendorlibdir
%rb_vendorarch %rb19_vendorarchdir
# %%gem_unpack macro unpacks a gem file into %%{_builddir}
#
# example:
# %prep
# %gem_unpack %{SOURCE0}
# %patch1 -p1
#
%gem_unpack(s:) \
source=%{-s:%{-s*}}%{!-s:%{SOURCE0}} \
%{gem_binary} unpack --verbose $source \
cd %{mod_name}-%{version} \
chmod og-w -R . \
%{gem_binary} unpack --spec --verbose $source \
%{nil}
# %%gem_build macro ...
#
%gem_build() \
GEMSPEC_SOURCE_DIR=`find . -maxdepth 2 -type f -name %{mod_name}-%{version}.gemspec | xargs dirname` \
cd $GEMSPEC_SOURCE_DIR && %{gem_binary} build --verbose %{mod_name}-%{version}.gemspec \
%{nil}
# %%gem_install macro ...
#
# When invoked with a single parameter, the macro retains the old macro behavior, i.e.
# building the upstream gem directly in $RPM_BUILD_ROOT without unpacking to %{_builddir} first.
#
%gem_install /usr/lib/rpm/gem_install.sh --default-gem %{mod_name}-%{version}.gem --build-root %{buildroot} --gem-binary %{gem_binary}
%gem_cleanup() \
/usr/lib/rpm/gem_build_cleanup.sh %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/ \
%{nil}