File project.diff of Package debian-ruby-common
--- gem_install.sh.orig
+++ gem_install.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# vim: set sw=2 sts=2 et tw=80 ft=ruby:
=begin &>/dev/null
# workaround for rubinius bug
@@ -40,7 +40,7 @@ options.docfiles=[]
options.gemname=nil
options.gemversion=nil
options.gemsuffix=nil
-options.otheropts=[]
+options.otheropts=["--bindir", "/usr/bin"]
options.ua_dir='/etc/alternatives'
options.docdir='/usr/share/doc/packages'
# once we start fixing packages set this to true
--- gem_packages.sh.orig
+++ gem_packages.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# we always start in /home/abuild but in older distros we wouldnt find the sources that way.
# switch to /usr/src/packages/
-if [ ! -d $PWD/rpmbuild ] ; then
+if [ ! -d $PWD/debbuild ] ; then
cd /usr/src/packages/
fi
shopt -s nullglob
@@ -14,7 +14,7 @@ fi
eval set -- "$options"
-otheropts="--local -t /usr/lib/rpm/gem_packages.template"
+otheropts="--local -t /usr/lib/rpm/gem_packages.template"
defaultgem=
buildroot=
gemfile=
@@ -36,14 +36,14 @@ do
shift
done
-if [ "x$gem_config" = "x" ] ; then
+if [ "x$gem_config" = "x" ] ; then
gem_config=$(find $RPM_SOURCE_DIR -name "*gem2rpm.yml")
- if [ "x$gem_config" != "x" ] ; then
+ if [ "x$gem_config" != "x" ] ; then
otheropts="$otheropts --config=$gem_config"
fi
fi
-if [ "x$gemfile" = "x" ] ; then
+if [ "x$gemfile" = "x" ] ; then
gemfile=$(find . -maxdepth 2 -type f -name "$defaultgem" -not -path \*/.gem/\* | head -n 1)
# if still empty, we pick the sources
if [ "x$gemfile" = "x" ] ; then
@@ -56,6 +56,4 @@ fi
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
set -x
-for gr in $(/usr/bin/ruby-find-versioned gem2rpm) ; do
- $gr $otheropts
-done
+gem2rpm $otheropts
--- ruby-common.macros.orig
+++ ruby-common.macros
@@ -6,7 +6,8 @@
#
# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
#
-%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygem() ruby-%1
+
%rubygemsSTOP() %nil
%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
%rubygemsxxSTOP(a:) %{-a*}) %*
@@ -14,7 +15,7 @@
%rubySTOP() %nil
%rubyxSTOP() %*
-%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+%ruby() %rb_default_ruby_suffix %1 %2
%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
--- ruby-common.spec.orig
+++ ruby-common.spec
@@ -43,14 +43,14 @@ Source14: gemfile.rb
Source15: rails.macros
Source16: g2r
Source17: rubygems_bundled.attr
+Source100: debian-ruby.macros
Summary: Collection of scripts and macros for ruby packaging
License: MIT
Group: Development/Languages/Ruby
Url: https://github.com/openSUSE/ruby-packaging/
-Requires: /usr/bin/getopt
+# For getopt
+Requires: util-linux
#Requires: ruby-devel
-Requires: rubygem(gem2rpm)
-Recommends: rubygem(%{rb_default_ruby_abi}:gem2rpm)
#Requires: rubygems > 1.8
Requires: fdupes
BuildArch: noarch
@@ -65,8 +65,7 @@ This package is needed for (generated) r
automatic rpm provides and requires and macros that gem2rpm uses.
%package rails
-Requires: rubygem(bundler)
-Recommends: rubygem(%{rb_default_ruby_abi}:bundler)
+Requires: bundler
Requires: %{name} = %{version}-%{release}
Summary: Rails packaging support
@@ -87,8 +86,9 @@ Rails packaging support files.
%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:8} %{buildroot}/etc/debbuild/macros.ruby-common
+install -D -m 0644 %{S:9} %{buildroot}/etc/debbuild/macros.suse-ruby
+install -D -m 0644 %{S:100} %{buildroot}/etc/debbuild/macros.debian-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
@@ -99,7 +99,7 @@ install -D -m 0644 %{S:11} %{buildroot}/
install -D -m 0755 %{S:12} %{buildroot}%{_bindir}/ruby-find-versioned
install -D -m 0644 %{S:13} %{buildroot}/usr/lib/rpm/fileattrs/gemfile.attr
install -D -m 0755 %{S:14} %{buildroot}/usr/lib/rpm/gemfile.rb
-install -D -m 0644 %{S:15} %{buildroot}/etc/rpm/macros.rails
+install -D -m 0644 %{S:15} %{buildroot}/etc/debbuild/macros.rails
install -D -m 0755 %{S:16} %{buildroot}%{_bindir}/g2r
install -D -m 0644 %{S:17} %{buildroot}/usr/lib/rpm/fileattrs/rubygems_bundled.attr
@@ -108,7 +108,7 @@ install -D -m 0644 %{S:17} %{buildroot}
%if %{with ship_gemrc}
%config /etc/gemrc
%endif
-%config /etc/rpm/macros.*ruby*
+%config /etc/debbuild/macros.*ruby*
%dir /usr/lib/rpm/fileattrs
/usr/lib/rpm/fileattrs/rubygems.attr
/usr/lib/rpm/fileattrs/rubygems_bundled.attr
@@ -122,7 +122,7 @@ install -D -m 0644 %{S:17} %{buildroot}
%files rails
%defattr(-,root,root)
-%config /etc/rpm/macros.rails
+%config /etc/debbuild/macros.rails
/usr/lib/rpm/fileattrs/gemfile.attr
/usr/lib/rpm/gemfile.rb