[alexandria] fix build

Tom Callaway spot at fedoraproject.org
Fri Mar 23 21:19:24 UTC 2012


commit 1673216819f7d9c2058924feda32dc31cc3541ac
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Fri Mar 23 17:19:21 2012 -0400

    fix build

 alexandria-0.6.8-ascii-fix.patch |   16 +++++++++++++++
 alexandria-0.6.8-evalfix.patch   |   25 ++++++++++++++++++++++++
 alexandria-0.6.8-kcodefix.patch  |   21 ++++++++++++++++++++
 alexandria-0.6.8-rbconfig.patch  |   19 ++++++++++++++++++
 alexandria-0.6.8-rdoc.patch      |   13 ++++++++++++
 alexandria.spec                  |   39 ++++++++++++++++++++++++++++---------
 6 files changed, 123 insertions(+), 10 deletions(-)
---
diff --git a/alexandria-0.6.8-ascii-fix.patch b/alexandria-0.6.8-ascii-fix.patch
new file mode 100644
index 0000000..5c43ebf
--- /dev/null
+++ b/alexandria-0.6.8-ascii-fix.patch
@@ -0,0 +1,16 @@
+diff -up alexandria-0.6.8/util/rake/omfgenerate.rb.ascii alexandria-0.6.8/util/rake/omfgenerate.rb
+--- alexandria-0.6.8/util/rake/omfgenerate.rb.ascii	2012-03-23 15:31:31.766631433 -0400
++++ alexandria-0.6.8/util/rake/omfgenerate.rb	2012-03-23 15:31:50.460456351 -0400
+@@ -73,10 +73,10 @@ class OmfGenerateTask < Rake::TaskLib
+     rule '.omf' => ['.omf.in'] do |t|
+       path = File.join(@gnome_helpfiles_dir, @projectname,
+                        locale_for(t.name), "#{@projectname}.xml")
+-      data = IO.read(t.source)
++      data = IO.read(t.source, :encoding => "BINARY")
+       data.sub!(/PATH_TO_DOC_FILE/, path)
+       puts "Generating #{t.name}..."
+-      File.open(t.name, 'w') { |io| io.puts data }
++      File.open(t.name, 'w', :encoding => "BINARY") { |io| io.puts data }
+     end
+     omf_files.each {|o| @generated_files << o }
+   end
diff --git a/alexandria-0.6.8-evalfix.patch b/alexandria-0.6.8-evalfix.patch
new file mode 100644
index 0000000..487ab16
--- /dev/null
+++ b/alexandria-0.6.8-evalfix.patch
@@ -0,0 +1,25 @@
+diff -up alexandria-0.6.8/lib/alexandria/book_providers.rb.evalfix alexandria-0.6.8/lib/alexandria/book_providers.rb
+--- alexandria-0.6.8/lib/alexandria/book_providers.rb.evalfix	2011-11-15 07:43:04.000000000 -0500
++++ alexandria-0.6.8/lib/alexandria/book_providers.rb	2012-03-23 16:25:22.415869366 -0400
+@@ -375,7 +375,7 @@ module Alexandria
+       providers = {}
+       self.class.constants.each do |constant|
+         next unless md = /(.+)Provider$/.match(constant)
+-        klass = self.class.module_eval(constant)
++        klass = self.class.module_eval(constant.to_s)
+         if klass.ancestors.include?(AbstractProvider) and
+             klass != GenericProvider and
+             klass != WebsiteBasedProvider and
+diff -up alexandria-0.6.8/lib/alexandria/smart_library.rb.evalfix alexandria-0.6.8/lib/alexandria/smart_library.rb
+--- alexandria-0.6.8/lib/alexandria/smart_library.rb.evalfix	2009-03-25 19:09:32.000000000 -0400
++++ alexandria-0.6.8/lib/alexandria/smart_library.rb	2012-03-23 16:24:11.833511912 -0400
+@@ -471,8 +471,7 @@ begin
+ 
+                                       })
+ 
+-        ALL = self.constants.map \
+-        { |x| self.module_eval(x) }.select \
++        ALL = self.constants.map { |x| self.module_eval(x.to_s) }.select \
+         { |x| x.is_a?(Operator) }
+       end
+ 
diff --git a/alexandria-0.6.8-kcodefix.patch b/alexandria-0.6.8-kcodefix.patch
new file mode 100644
index 0000000..da16b0c
--- /dev/null
+++ b/alexandria-0.6.8-kcodefix.patch
@@ -0,0 +1,21 @@
+diff -up alexandria-0.6.8/bin/alexandria.kcodefix alexandria-0.6.8/bin/alexandria
+--- alexandria-0.6.8/bin/alexandria.kcodefix	2012-03-23 14:39:42.898463507 -0400
++++ alexandria-0.6.8/bin/alexandria	2012-03-23 14:42:24.785019154 -0400
+@@ -1,6 +1,7 @@
+ #!/usr/bin/env ruby
++# encoding: utf-8
+ 
+-$KCODE = 'U'
++$KCODE = 'U' unless RUBY_VERSION > "1.9.0"
+ 
+ require 'rubygems'
+ begin
+diff -up alexandria-0.6.8/lib/alexandria/about.rb.kcodefix alexandria-0.6.8/lib/alexandria/about.rb
+--- alexandria-0.6.8/lib/alexandria/about.rb.kcodefix	2012-03-23 14:41:48.288345224 -0400
++++ alexandria-0.6.8/lib/alexandria/about.rb	2012-03-23 14:42:03.952205307 -0400
+@@ -1,3 +1,5 @@
++# encoding: utf-8
++
+ # Copyright (C) 2004-2006 Laurent Sansonetti
+ # Copyright (C) 2008 Joseph Method
+ #
diff --git a/alexandria-0.6.8-rbconfig.patch b/alexandria-0.6.8-rbconfig.patch
new file mode 100644
index 0000000..32e2a46
--- /dev/null
+++ b/alexandria-0.6.8-rbconfig.patch
@@ -0,0 +1,19 @@
+diff -up alexandria-0.6.8/util/rake/fileinstall.rb.fix alexandria-0.6.8/util/rake/fileinstall.rb
+--- alexandria-0.6.8/util/rake/fileinstall.rb.fix	2012-03-23 12:15:39.827228029 -0400
++++ alexandria-0.6.8/util/rake/fileinstall.rb	2012-03-23 12:16:01.774011895 -0400
+@@ -185,12 +185,12 @@ class FileInstallTask < Rake::TaskLib
+   private
+ 
+   def calculate_ruby_dir
+-    ruby_prefix = Config::CONFIG['prefix']
++    ruby_prefix = RbConfig::CONFIG['prefix']
+ 
+     if @install_to_rubylibdir
+-      ruby_libdir = Config::CONFIG['rubylibdir']
++      ruby_libdir = RbConfig::CONFIG['rubylibdir']
+     else
+-      ruby_libdir = Config::CONFIG['sitelibdir']
++      ruby_libdir = RbConfig::CONFIG['sitelibdir']
+     end
+     if ENV.has_key?('RUBYLIBDIR')
+       ruby_libdir = ENV['RUBYLIBDIR']
diff --git a/alexandria-0.6.8-rdoc.patch b/alexandria-0.6.8-rdoc.patch
new file mode 100644
index 0000000..a6d2417
--- /dev/null
+++ b/alexandria-0.6.8-rdoc.patch
@@ -0,0 +1,13 @@
+diff -up alexandria-0.6.8/doc/cuecat_support.rdoc alexandria-0.6.8/doc/cuecat_support
+diff -up alexandria-0.6.8/Rakefile.rdoc alexandria-0.6.8/Rakefile
+--- alexandria-0.6.8/Rakefile.rdoc	2012-03-23 12:19:23.151041440 -0400
++++ alexandria-0.6.8/Rakefile	2012-03-23 12:19:32.967945925 -0400
+@@ -32,7 +32,7 @@ rescue LoadError
+ end
+ 
+ require 'rake/clean'
+-require 'rake/rdoctask'
++require 'rdoc/task'
+ require 'rake/packagetask'
+ 
+ $:.unshift(File.join(File.dirname(__FILE__), 'util/rake'))
diff --git a/alexandria.spec b/alexandria.spec
index 8cfc058..e727afb 100644
--- a/alexandria.spec
+++ b/alexandria.spec
@@ -1,4 +1,3 @@
-%{!?ruby_sitelib:	%global ruby_sitelib	%(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
 %define		rubyabi		1.8
 %define		repoid		75529
 
@@ -6,14 +5,14 @@
 %undefine		minorver	
 %undefine		ifpre	
 
-%define		fedorarel	2
+%define		fedorarel	3
 %define		rel		%{?ifpre:0.}%{fedorarel}%{?minorver:.%minorver}
 
 
 
 Name:		alexandria
 Version:	%{majorver}
-Release:	%{rel}%{?dist}.1
+Release:	%{rel}%{?dist}
 Summary:	Book collection manager
 
 Group:		Applications/Productivity
@@ -39,9 +38,21 @@ Patch4:		alexandria-0.6.8-set_status_label.patch
 #Patch10:	alexandria-0.6.8-nogst-support.patch
 # Always require rubygems
 Patch11:	alexandria-0.6.8-always-require-rubygems.patch
+# Use RbConfig
+Patch12:	alexandria-0.6.8-rbconfig.patch
+# Use rdoc
+Patch13:	alexandria-0.6.8-rdoc.patch
+# Force encoding type to make rake happy
+Patch14:	alexandria-0.6.8-ascii-fix.patch
+# Fix kcode issues with 1.9
+Patch15:	alexandria-0.6.8-kcodefix.patch
+# eval fix
+Patch16:	alexandria-0.6.8-evalfix.patch
 
 BuildArch:	noarch
-BuildRequires:	ruby(abi) = %{rubyabi}
+BuildRequires:	ruby(abi) >= %{rubyabi}
+# For ruby macros
+BuildRequires:	ruby-devel
 BuildRequires:	rubygem(rake)
 BuildRequires:	desktop-file-utils
 # For gconf related macros
@@ -50,7 +61,7 @@ BuildRequires:	gettext
 BuildRequires:	intltool
 
 Requires:	ruby
-Requires:	ruby(abi) = %{rubyabi}
+Requires:	ruby(abi) >= %{rubyabi}
 
 # Amazon AWS v3 -> v4 switch
 # AWS v4 is supported by alexandria itself
@@ -97,7 +108,12 @@ Alexandria is a GNOME application to help you manage your book collection.
 %patch3 -p1 -b .up28263.isdn
 %patch4 -p0 -b .up29479.search
 #%%patch10 -p1 -b .nogst
-%patch11 -p1 -b .gem
+%patch11 -p1 -b .gem 
+%patch12 -p1 -b .rbconfig 
+%patch13 -p1 -b .rdoc 
+%patch14 -p1 -b .ascii 
+%patch15 -p1 -b .kcodefix 
+%patch16 -p1 -b .evalfix
 
 # Embed Fedora EVR
 %{__sed} -i.evr \
@@ -110,12 +126,12 @@ Alexandria is a GNOME application to help you manage your book collection.
 	util/rake/gettextgenerate.rb
 
 %build
-rake build
+rake build --trace
 
 %install
 rake install_package_staging \
 	DESTDIR=$RPM_BUILD_ROOT \
-	RUBYLIBDIR=%{ruby_sitelib}
+	RUBYLIBDIR=%{ruby_vendorlibdir}
 
 desktop-file-install \
 	--vendor fedora \
@@ -178,8 +194,8 @@ exit 0
 %{_mandir}/man1/%{name}.1*
 
 %{_bindir}/%{name}
-%{ruby_sitelib}/%{name}.rb
-%{ruby_sitelib}/%{name}/
+%{ruby_vendorlibdir}/%{name}.rb
+%{ruby_vendorlibdir}/%{name}/
 
 %{_sysconfdir}/gconf/schemas/%{name}.schemas
 
@@ -192,6 +208,9 @@ exit 0
 %{_datadir}/icons/hicolor/*/apps/%{name}.*
 
 %changelog
+* Fri Mar 23 2012 Tom Callaway <spot at fedoraproject.org> - 0.6.8-3
+- get working again
+
 * Thu Jan 12 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.6.8-2.1
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list