ruby-common/ruby-common.spec
Marcus Rueckert 0c812e5108 Accepting request 253103 from home:darix:ruby
- we dont always have /usr/bin/ruby, use perl for patching the
  version in the bin wrapper. also replaced the sed for patching
  the shebang line.
- fixed a bad bug in the shebang line. we had an additional "."
  there.

- install gemrc on all distros

- dont delete .a files. there are actually gems where we need them
  like rubygem-libv8 for rubygem-therubyracer

- fix the case where we dont symlink the binaries. 

- gem_cleanup macro was missed when updating for old ruby versions.

- switch from "ruby -rrubygems -e 
  'print Gem::Specification.new.base_dir'"
  to "gem env gemdir"
 

- gem_build_cleanup: also delete static library files

- ruby 1.8 support:
  - gem_packages.sh: change to /usr/src/packages when
    /home/abuild/rpmbuild doesn't exist.
  - gem_packages template:
    - require rbconfigpackagingsupport to fix the ruby_install_name
      dependent variables. we do that for all distros but catch the
      LoadError and continue.
    - and dont use not(), we need to use "!" instead.

OBS-URL: https://build.opensuse.org/request/show/253103
OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby-common?expand=0&rev=73
2014-09-29 13:29:35 +00:00

93 lines
3.0 KiB
RPMSpec

#
# spec file for package ruby-common
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#
Name: ruby-common
Version: 2.1
Release: 0
# ruby-macros and ruby-common version
%define rpm_macros_version 5
%if 0
%bcond_with ship_gemrc
%else
%bcond_without ship_gemrc
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source1: gem_build_cleanup
Source2: gemrc
Source4: rubygems.attr
Source5: rubygemsdeps.rb
Source6: gem_install.sh
Source7: generate_buildrequires.sh
Source8: ruby-common.macros
Source9: ruby.rpm-macros
Source10: gem_packages.sh
Source11: opensuse.spec.erb
Summary: Collection of scripts and macros for ruby packaging
License: MIT
Group: Development/Languages/Ruby
Requires: /usr/bin/getopt
#Requires: ruby-devel
Requires: rubygem(gem2rpm)
#Requires: rubygems > 1.8
Requires: fdupes
BuildArch: noarch
Provides: ruby-macros = %{rpm_macros_version}
%if 0%{?suse_version} < 1140 && 0%{?suse_version} > 1110
# we need a patched rpm
Requires: rpm-with-ruby-provide-hook
%endif
%description
This package is needed for (generated) ruby gems. It provides hooks for
automatic rpm provides and requires and macros that gem2rpm uses.
%prep
%build
%install
# we need to make sure it overwrites older macro versions and rpm sorts alphabetically
%if %{with ship_gemrc}
install -D -m 0644 %{S:2} %{buildroot}/etc/gemrc
%endif
install -D -m 0644 %{S:8} %{buildroot}/etc/rpm/macros.ruby-common
install -D -m 0644 %{S:9} %{buildroot}/etc/rpm/macros.suse-ruby
install -D -m 0644 %{S:4} %{buildroot}/usr/lib/rpm/fileattrs/rubygems.attr
install -D -m 0755 %{S:5} %{buildroot}/usr/lib/rpm/rubygemsdeps.rb
install -D -m 0755 %{S:6} %{buildroot}/usr/lib/rpm/gem_install.sh
install -D -m 0755 %{S:1} %{buildroot}/usr/lib/rpm/gem_build_cleanup.sh
install -D -m 0755 %{S:7} %{buildroot}/usr/lib/rpm/generate_buildrequires.sh
install -D -m 0755 %{S:10} %{buildroot}/usr/lib/rpm/gem_packages.sh
install -D -m 0644 %{S:11} %{buildroot}/usr/lib/rpm/gem_packages.template
%files
%defattr(-,root,root)
%if %{with ship_gemrc}
%config /etc/gemrc
%endif
%config /etc/rpm/macros.*
%dir /usr/lib/rpm/fileattrs
/usr/lib/rpm/fileattrs/rubygems.attr
/usr/lib/rpm/rubygemsdeps.rb
/usr/lib/rpm/gem_install.sh
/usr/lib/rpm/gem_build_cleanup.sh
/usr/lib/rpm/generate_buildrequires.sh
/usr/lib/rpm/gem_packages.*
%changelog