ruby/ruby.rpm-macros
Klaus Kämpf 9594841e44 Accepting request 220747 from openSUSE:Factory:Staging:H
- readd old macros - for now at least
- generate provides for embedded rubygems
- merged ruby-common
- new package split - only single Ruby version installable
  ruby - binary
  libruby2_1-2_0 - ruby runtime library
  ruby-stdlib - ruby standard library
  ruby-doc - ruby documentation
  ruby-devel - ruby development
- revert the ruby split (ruby - ruby21)
  rename ruby21 to ruby, integrate 'ruby' and 'ruby-common'
- remove part of rubygems1.5 patch that modify mkmf which is
  already fixed upstream
- fix rb_arch in spec: append -gnu
- fix native gem builds: create gem native extensions dir
- initial version for ruby 2.1.0 - changes to Ruby 2.0:
  VM (method cache)
  RGenGC (See ko1’s RubyKaigi presentation and RubyConf 2013 presentation)
  refinements #8481 #8571
  syntax changes
  Rational/Complex Literal #8430
  def’s return value #3753
  Bignum
  use GMP #8796
  String#scrub #8414
  Socket.getifaddrs #8368
  RDoc 4.1.0 and RubyGems 2.2.0
  “literal”.freeze is now optimized #9042
  add Exception#cause #8257
  update libraries like BigDecimal, JSON, NKF, Rake, RubyGems, and RDoc

OBS-URL: https://build.opensuse.org/request/show/220747
OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby?expand=0&rev=70
2014-02-03 20:16:17 +00:00

55 lines
2.1 KiB
Plaintext

# %%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}%{!?gem_binary:/usr/bin/gem} unpack --verbose $source \
cd %{mod_name}-%{version} \
chmod og-w -R . \
%{?gem_binary}%{!?gem_binary:/usr/bin/gem} specification --ruby $source > %{mod_name}-%{version}.gemspec \
%{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}%{!?gem_binary:/usr/bin/gem} 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_binary}}
# we need to copy parts of the %fdupes macro as rpm can't expand parameters in macro "calls" ;(
%gem_cleanup() \
/usr/lib/rpm/gem_build_cleanup.sh %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/ \
fdupes -q -p -n -r %{buildroot}%{gem_base} | \
while read _file; do \
if test -z "$_target" ; then \
_target="$_file"; \
else \
if test -z "$_file" ; then \
_target=""; \
continue ; \
fi ; \
ln -sf "${_target#%{buildroot}}" "$_file"; \
fi ; \
done \
%{nil}
# this is used in older gems - but it's pointless with newer ruby/rpm versions
%rubygems_requires %{nil}
%gem_base %(%{rb_binary} -rrubygems -e 'print Gem::Specification.new.base_dir' )
%gem_extensions %(%{rb_binary} -rrubygems -e 'print Gem::Specification.new.extensions_dir' || echo %{_libdir}/ruby/gems/%{rb_ver}/gems )
%gem_doc_ext %(%{rb_binary} -r rubygems -e 'bs = Gem::Specification.new; rp = bs.extensions_dir.rpartition(bs.base_dir); print rp[1]+"/doc"+rp[2]' )
%gem_platform %(%{rb_binary} -r rubygems -r rbconfig -e 'print Gem::Platform.new(RbConfig::CONFIG["arch"]).to_s' )