[packages/ruby-grit] up to 2.4.1, build as noarch, install to vendor dir

glen glen at pld-linux.org
Sun May 5 17:00:04 CEST 2013


commit 196e97ef8f8b64e6a802a8188c2ad20da8c3a22f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun May 5 17:50:08 2013 +0300

    up to 2.4.1, build as noarch, install to vendor dir

 ruby-grit-nogems.patch | 43 +++++++++++++++++++++---------------------
 ruby-grit.spec         | 51 ++++++++++++++++++++++++--------------------------
 2 files changed, 45 insertions(+), 49 deletions(-)
---
diff --git a/ruby-grit.spec b/ruby-grit.spec
index 2a16be2..e17f838 100644
--- a/ruby-grit.spec
+++ b/ruby-grit.spec
@@ -1,24 +1,21 @@
-
-%define gitrev 7609e74
-%define gitauthor mojombo
-%define gitname grit
-
-Summary:	Ruby interface to Git
-Name:		ruby-grit
-Version:	2.2.0
+%define	pkgname	grit
+Summary:	Ruby Git bindings
+Name:		ruby-%{pkgname}
+Version:	2.4.1
 Release:	1
 License:	MIT
-Group:		Development/Tools
-Source0:	http://download.github.com/%{gitauthor}-%{gitname}-v%{version}-0-g%{gitrev}.tar.gz
-# Source0-md5:	5e6a2d136de6c66059d439f3e2a41b55
+Group:		Development/Languages
+Source0:	http://rubygems.org/downloads/%{pkgname}-%{version}.gem
+# Source0-md5:	c8bee515d6eace9aec7336e0ac6b0768
 Patch0:		%{name}-nogems.patch
-URL:		http://grit.rubyforge.org/
-BuildRequires:	rpmbuild(macros) >= 1.277
-BuildRequires:	ruby
-BuildRequires:	ruby-modules
-BuildRequires:	setup.rb >= 3.4.1
-%{?ruby_mod_ver_requires_eq}
-#BuildArch:	noarch
+URL:		http://github.com/mojombo/grit
+BuildRequires:	rpm-rubyprov
+BuildRequires:	rpmbuild(macros) >= 1.656
+Requires:	ruby-diff-lcs < 2
+Requires:	ruby-diff-lcs >= 1.1
+Requires:	ruby-mime-types < 2
+Requires:	ruby-mime-types >= 1.15
+BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -31,23 +28,23 @@ choice, however, is transparent to end users, and you need not know
 which method is being used.
 
 %prep
-%setup -q -n %{gitauthor}-%{gitname}-%{gitrev}
+%setup -q -n %{pkgname}-%{version}
 %patch0 -p1
-cp %{_datadir}/setup.rb .
-ruby setup.rb config \
-	--installdirs=std
-ruby setup.rb setup
 
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}}
+cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
 
-ruby setup.rb install \
-	--prefix=$RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%{ruby_rubylibdir}/grit.rb
-%{ruby_rubylibdir}/grit
+%doc README.md API.txt History.txt PURE_TODO LICENSE
+%{ruby_vendorlibdir}/%{pkgname}.rb
+%{ruby_vendorlibdir}/%{pkgname}
+%{_examplesdir}/%{name}-%{version}
diff --git a/ruby-grit-nogems.patch b/ruby-grit-nogems.patch
index fd6b884..af9cde4 100644
--- a/ruby-grit-nogems.patch
+++ b/ruby-grit-nogems.patch
@@ -1,5 +1,3 @@
-Only in mojombo-grit-7609e74: InstalledFiles
-diff -ur mojombo-grit-7609e74-o/lib/grit/git-ruby/repository.rb mojombo-grit-7609e74/lib/grit/git-ruby/repository.rb
 --- mojombo-grit-7609e74-o/lib/grit/git-ruby/repository.rb	2010-08-19 18:55:45.000000000 -0600
 +++ mojombo-grit-7609e74/lib/grit/git-ruby/repository.rb	2010-08-28 11:26:32.000000000 -0600
 @@ -13,7 +13,11 @@
@@ -15,27 +13,28 @@ diff -ur mojombo-grit-7609e74-o/lib/grit/git-ruby/repository.rb mojombo-grit-760
  require 'diff/lcs'
  require 'diff/lcs/hunk'
  
-diff -ur mojombo-grit-7609e74-o/lib/grit.rb mojombo-grit-7609e74/lib/grit.rb
---- mojombo-grit-7609e74-o/lib/grit.rb	2010-08-19 18:55:45.000000000 -0600
-+++ mojombo-grit-7609e74/lib/grit.rb	2010-08-28 11:25:09.000000000 -0600
-@@ -18,12 +18,15 @@
- end
+--- grit-2.4.1/lib/grit.rb~	2013-05-05 17:53:11.000000000 +0300
++++ grit-2.4.1/lib/grit.rb	2013-05-05 17:56:31.533333692 +0300
+@@ -13,14 +13,16 @@
  
- # third party
--require 'rubygems'
  begin
--  gem "mime-types", ">=0"
--  require 'mime/types'
--rescue Gem::LoadError => e
--  puts "WARNING: Gem LoadError: #{e.message}"
-+  require 'rubygems'
-+  begin
-+    gem "mime-types", ">=0"
-+    require 'mime/types'
-+  rescue Gem::LoadError => e
-+    puts "WARNING: Gem LoadError: #{e.message}"
-+  end
-+rescue LoadError
+   require 'mime/types'
+-  require 'rubygems'
+ rescue LoadError
+-  require 'rubygems'
+   begin
+-    gem "mime-types", ">=0"
+-    require 'mime/types'
+-  rescue Gem::LoadError => e
+-    puts "WARNING: Gem LoadError: #{e.message}"
++    require 'rubygems'
++    begin
++      gem "mime-types", ">=0"
++      require 'mime/types'
++    rescue Gem::LoadError => e
++      puts "WARNING: Gem LoadError: #{e.message}"
++    end
++  rescue LoadError
+   end
  end
  
- # ruby 1.9 compatibility
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-grit.git/commitdiff/196e97ef8f8b64e6a802a8188c2ad20da8c3a22f



More information about the pld-cvs-commit mailing list