Fwd: Re: ruby 1.8.7.x for rawhide

Jim Meyering jim at meyering.net
Tue Jun 22 10:44:29 UTC 2010


Mohammed Morsi wrote:
> I added this patch to my specfile as well, bumped the release, and
> updated the changelog to include your feedback.

Thanks for the new version.
I too am interested in this, and based on your work, have eliminated
most of the complaints from rpmlint and made a few other improvements.
Here are the first few changes that affect only your spec file:

summary:
      remove trailing blanks
      placate rpmlint
      ruby_* definitions: do not use trailing slashes in directory names
      _normalized_cpu: simplify definition

>From e4fbf5ea1b44a77957733c80df55a98706da4785 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Tue, 22 Jun 2010 12:31:31 +0200
Subject: [PATCH 1/4] remove trailing blanks

---
 spec |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/spec b/spec
index 4f90823..8751612 100644
--- a/spec
+++ b/spec
@@ -12,8 +12,8 @@
 %{!?ruby_sitearch:   %global ruby_sitearch   %{ruby_vendorarch}site_ruby}

 # for compatability w/ macros defined in 1.8.6 rpm spec
-%global sitedir  %{ruby_sitearch} 
-%global sitedir2 %{ruby_sitelib} 
+%global sitedir  %{ruby_sitearch}
+%global sitedir2 %{ruby_sitelib}

 %define	_normalized_cpu	     %(echo `echo %{_target_cpu} | sed 's/^ppc/powerpc/' | sed -e 's|i.86|i386|'`)
 %define tk_using_svn_number  27738
@@ -29,8 +29,8 @@ License:    Ruby or GPLv2
 URL:		    http://www.ruby-lang.org/
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

-BuildRequires:  ncurses ncurses-devel gdbm gdbm-devel 
-BuildRequires:  glibc-devel tcl-devel tk-devel libX11-devel 
+BuildRequires:  ncurses ncurses-devel gdbm gdbm-devel
+BuildRequires:  glibc-devel tcl-devel tk-devel libX11-devel
 BuildRequires:  autoconf gcc unzip openssl-devel db4-devel byacc
 BuildRequires:	bison
 BuildRequires:	emacs
@@ -479,7 +479,7 @@ rm -rf $RPM_BUILD_ROOT

 * Thu Jul 23 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.8.6.369-2
 - Make sure that readline.so is linked against readline 5 because
-  Ruby is under GPLv2 
+  Ruby is under GPLv2

 * Sat Jun 20 2009  Jeroen van Meeuwen <kanarip at fedoraproject.org> - 1.8.6.369-1
 - New patchlevel fixing CVE-2009-1904
-- 
1.7.1.664.gf1fb2


>From 3b5de2f0f0da8af72ab99f5412c3fb1f1936bc96 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Tue, 22 Jun 2010 12:37:08 +0200
Subject: [PATCH 2/4] placate rpmlint

replace spaces with TABs
remove comments containing % directives
---
 spec |   57 ++++++++++++++++++++++++++-------------------------------
 1 files changed, 26 insertions(+), 31 deletions(-)

diff --git a/spec b/spec
index 8751612..8c22931 100644
--- a/spec
+++ b/spec
@@ -1,41 +1,41 @@
-%define	rubyxver	  1.8
-%define	rubyver		  1.8.7
+%define rubyxver	1.8
+%define rubyver		1.8.7
 %define _patchlevel	249

 %define dotpatchlevel	%{?_patchlevel:.%{_patchlevel}}
 %define patchlevel	%{?_patchlevel:-p%{_patchlevel}}
-%define	arcver		%{rubyver}%{?patchlevel}
+%define arcver		%{rubyver}%{?patchlevel}

-%{!?ruby_vendorlib:  %global ruby_vendorlib  %{_prefix}/lib/ruby/}
-%{!?ruby_vendorarch: %global ruby_vendorarch %{_libdir}/ruby/}
-%{!?ruby_sitelib:    %global ruby_sitelib    %{ruby_vendorlib}site_ruby}
-%{!?ruby_sitearch:   %global ruby_sitearch   %{ruby_vendorarch}site_ruby}
+%{!?ruby_vendorlib:	%global ruby_vendorlib  %{_prefix}/lib/ruby/}
+%{!?ruby_vendorarch:	%global ruby_vendorarch %{_libdir}/ruby/}
+%{!?ruby_sitelib:	%global ruby_sitelib    %{ruby_vendorlib}site_ruby}
+%{!?ruby_sitearch:	%global ruby_sitearch   %{ruby_vendorarch}site_ruby}

-# for compatability w/ macros defined in 1.8.6 rpm spec
-%global sitedir  %{ruby_sitearch}
-%global sitedir2 %{ruby_sitelib}
+# for compatibility with macros defined in 1.8.6 rpm spec
+%global sitedir		%{ruby_sitearch}
+%global sitedir2	%{ruby_sitelib}

 %define	_normalized_cpu	     %(echo `echo %{_target_cpu} | sed 's/^ppc/powerpc/' | sed -e 's|i.86|i386|'`)
-%define tk_using_svn_number  27738
+%define tk_using_svn_number 27738

 # emacs sitelisp directory
-%{!?_emacs_sitelispdir:  %global _emacs_sitelispdir  %{_datadir}/emacs/site-lisp}
+%{!?_emacs_sitelispdir: %global _emacs_sitelispdir %{_datadir}/emacs/site-lisp}
 %{!?_emacs_sitestartdir: %global _emacs_sitestartdir %{_datadir}/emacs/site-lisp/site-start.d}

-Name:		    ruby
-Version:    %{rubyver}%{?dotpatchlevel}
-Release:    2%{?dist}
-License:    Ruby or GPLv2
-URL:		    http://www.ruby-lang.org/
+Name:		ruby
+Version:	%{rubyver}%{?dotpatchlevel}
+Release:	2%{?dist}
+License:	Ruby or GPLv2
+URL:		http://www.ruby-lang.org/
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

-BuildRequires:  ncurses ncurses-devel gdbm gdbm-devel
-BuildRequires:  glibc-devel tcl-devel tk-devel libX11-devel
-BuildRequires:  autoconf gcc unzip openssl-devel db4-devel byacc
+BuildRequires:	ncurses ncurses-devel gdbm gdbm-devel
+BuildRequires:	glibc-devel tcl-devel tk-devel libX11-devel
+BuildRequires:	autoconf gcc unzip openssl-devel db4-devel byacc
 BuildRequires:	bison
 BuildRequires:	emacs
 %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
-BuildRequires:  compat-readline5-devel
+BuildRequires:	compat-readline5-devel
 %else
 BuildRequires:	readline readline-devel
 %endif
@@ -48,8 +48,8 @@ Patch29:	ruby-1.8.7-always-use-i386.patch
 Patch30:	ruby-1.8.7-openssl-1.0.patch
 Patch33:	ruby-1.8.7-p249-mkmf-use-shared.patch

-Patch100: ruby-1.8.7-lib-paths.patch
-Patch101: ruby_1_8_7-rb_gc_guard_ptr-optimization.patch
+Patch100:	ruby-1.8.7-lib-paths.patch
+Patch101:	ruby_1_8_7-rb_gc_guard_ptr-optimization.patch

 Summary:	An interpreter of object-oriented scripting language
 Group:		Development/Languages
@@ -80,7 +80,6 @@ This package includes the libruby, necessary to run Ruby.
 Summary:	A Ruby development environment
 Group:		Development/Languages
 Requires:	%{name}-libs = %{version}-%{release}
-#Provides:	%{name}-libs-static = %{version}-%{release}

 %description devel
 Header files and libraries for building a extension library for the
@@ -112,8 +111,6 @@ Summary:	A tool to generate documentation from Ruby source files
 Group:		Development/Languages
 # generators/template/html/html.rb is under CC-BY
 License:	(GPLv2 or Ruby) and CC-BY
-## ruby-irb requires ruby
-#Requires:	%{name} = %{version}-%{release}
 Requires:	%{name}-irb = %{version}-%{release}
 Provides:	rdoc = %{version}-%{release}
 Obsoletes:	rdoc <= %{version}-%{release}
@@ -135,8 +132,6 @@ Manuals and FAQs for the object-oriented scripting language Ruby.
 %package ri
 Summary:	Ruby interactive reference
 Group:		Documentation
-## ruby-irb requires ruby, which ruby-rdoc requires
-#Requires:	%{name} = %{version}-%{release}
 Requires:	%{name}-rdoc = %{version}-%{release}
 Provides:	ri = %{version}-%{release}
 Obsoletes:	ri <= %{version}-%{release}
@@ -151,9 +146,9 @@ along with a list of the methods the class or module implements.
 ## ruby-tcltk
 ##
 %package tcltk
-Summary:    Tcl/Tk interface for scripting language Ruby
-Group:      Development/Languages
-Requires:   %{name}-libs = %{version}-%{release}
+Summary:	Tcl/Tk interface for scripting language Ruby
+Group:		Development/Languages
+Requires:	%{name}-libs = %{version}-%{release}

 %description tcltk
 Tcl/Tk interface for the object-oriented scripting language Ruby.
-- 
1.7.1.664.gf1fb2


>From eabd0fef5d35f76b714834d4ef9906a173187d1e Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Tue, 22 Jun 2010 12:39:50 +0200
Subject: [PATCH 3/4] ruby_* definitions: do not use trailing slashes in directory names

This change avoids the double slashes e.g., in this output:

  $ ruby -e 'puts $:' | grep //
  /usr/lib64/ruby//1.8.7
  /usr/lib64/ruby//1.8
  /usr/lib64/ruby//1.8.7/x86_64-linux
  /usr/lib/ruby//1.8.7
  /usr/lib/ruby//1.8
---
 spec |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/spec b/spec
index 8c22931..864e6ad 100644
--- a/spec
+++ b/spec
@@ -6,10 +6,10 @@
 %define patchlevel	%{?_patchlevel:-p%{_patchlevel}}
 %define arcver		%{rubyver}%{?patchlevel}

-%{!?ruby_vendorlib:	%global ruby_vendorlib  %{_prefix}/lib/ruby/}
-%{!?ruby_vendorarch:	%global ruby_vendorarch %{_libdir}/ruby/}
-%{!?ruby_sitelib:	%global ruby_sitelib    %{ruby_vendorlib}site_ruby}
-%{!?ruby_sitearch:	%global ruby_sitearch   %{ruby_vendorarch}site_ruby}
+%{!?ruby_vendorlib:	%global ruby_vendorlib  %{_prefix}/lib/ruby}
+%{!?ruby_vendorarch:	%global ruby_vendorarch %{_libdir}/ruby}
+%{!?ruby_sitelib:	%global ruby_sitelib    %{ruby_vendorlib}/site_ruby}
+%{!?ruby_sitearch:	%global ruby_sitearch   %{ruby_vendorarch}/site_ruby}

 # for compatibility with macros defined in 1.8.6 rpm spec
 %global sitedir		%{ruby_sitearch}
-- 
1.7.1.664.gf1fb2


>From 7e01513f7d84110b823ade57d5e3483b824905b5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Tue, 22 Jun 2010 12:41:21 +0200
Subject: [PATCH 4/4] _normalized_cpu: simplify definition

Remove excess "echo" and subshell.
Combine sed -e arguments into one and drop the -e.
---
 spec |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/spec b/spec
index 864e6ad..f182ab0 100644
--- a/spec
+++ b/spec
@@ -15,7 +15,8 @@
 %global sitedir		%{ruby_sitearch}
 %global sitedir2	%{ruby_sitelib}

-%define	_normalized_cpu	     %(echo `echo %{_target_cpu} | sed 's/^ppc/powerpc/' | sed -e 's|i.86|i386|'`)
+%define _normalized_cpu %(echo %{_target_cpu} | sed 's/^ppc/powerpc/;s/i.86/i386/')
+
 %define tk_using_svn_number 27738

 # emacs sitelisp directory
-- 
1.7.1.664.gf1fb2



More information about the ruby-sig mailing list