ruby-common/ruby-common.spec

93 lines
3.0 KiB
RPMSpec

#
# spec file for package ruby-common
#
# Copyright (c) 2015 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