Origin: vendor
Forwarded: not-needed
From: Gunnar Wolf <gwolf@debian.org>
Last-Update: 2009-11-24
Subject: Replace the upstream hardcoded paths for Debian-policy-compliant ones
 Upstream packaging hardcodes several paths which make sense in Gems-based
 installations, but do not work in Debian systems; here we patch to make the
 packages be policy-compliant.
 .
 Of course, that's the reason for the packages not to be considerable for 
 upstream acceptance.
Index: libprawn-ruby-0.6.3+dfsg/lib/prawn/font/afm.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/lib/prawn/font/afm.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/lib/prawn/font/afm.rb	2009-11-24 17:15:19.000000000 -0600
@@ -12,11 +12,9 @@
         if m = ENV['METRICS']
           @metrics_path ||= m.split(':')
         else
-          @metrics_path ||= [
-            ".", "/usr/lib/afm",
-            "/usr/local/lib/afm",
-            "/usr/openwin/lib/fonts/afm/",
-             Prawn::BASEDIR+'/data/fonts/']
+          # Use this module's and systemwide fonts path (Debian patch)
+          @metrics_path ||= [ '/usr/share/libprawn-ruby/fonts',
+                              '/usr/share/fonts/' ]
         end
       end
 
Index: libprawn-ruby-0.6.3+dfsg/lib/prawn/encoding.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/lib/prawn/encoding.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/lib/prawn/encoding.rb	2009-11-24 17:15:19.000000000 -0600
@@ -84,7 +84,8 @@
       ]    
       
       def initialize
-        @mapping_file = "#{Prawn::BASEDIR}/data/encodings/win_ansi.txt"
+        # Assume Debian-installed path
+        @mapping_file = '/usr/share/libprawn-ruby/encodings/win_ansi.txt'
         load_mapping if self.class.mapping.empty?
       end
 
Index: libprawn-ruby-0.6.3+dfsg/examples/general/background.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/general/background.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/general/background.rb	2009-11-24 17:15:19.000000000 -0600
@@ -6,7 +6,7 @@
 #
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
 
-img = "#{Prawn::BASEDIR}/data/images/letterhead.jpg"
+img = "/usr/share/libprawn-ruby/images/letterhead.jpg"
 
 Prawn::Document.generate("background.pdf", :background => img) do
   text "My report caption", :size => 18, :align => :right
Index: libprawn-ruby-0.6.3+dfsg/examples/graphics/basic_images.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/graphics/basic_images.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/graphics/basic_images.rb	2009-11-24 17:16:59.000000000 -0600
@@ -7,17 +7,17 @@
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
    
 Prawn::Document.generate("basic_images.pdf", :page_layout => :landscape) do     
-  stef = "#{Prawn::BASEDIR}/data/images/stef.jpg"
+  stef = "/usr/share/libprawn-ruby/images/stef.jpg"
   image stef, :at => [75, 75] 
   
-  stef = "#{Prawn::BASEDIR}/data/images/stef.jpg"
+  stef = "/usr/share/libprawn-ruby/images/stef.jpg"
   image stef, :at => [500, 400], :width => 200, :height => 200 
   
   text "Please enjoy the pigs", :size => 36, :at => [200,15]   
   
-  ruport = "#{Prawn::BASEDIR}/data/images/ruport.png"  
+  ruport = "/usr/share/libprawn-ruby/images/ruport.png"  
   image ruport, :at => [400,200], :width => 150 
 
-  ruport = "#{Prawn::BASEDIR}/data/images/ruport_transparent.png"  
+  ruport = "/usr/share/libprawn-ruby/images/ruport_transparent.png"  
   image ruport, :at => [50,525] 
 end
Index: libprawn-ruby-0.6.3+dfsg/examples/graphics/cmyk.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/graphics/cmyk.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/graphics/cmyk.rb	2009-11-24 17:15:19.000000000 -0600
@@ -7,6 +7,6 @@
 Prawn::Document.generate("cmyk.pdf", :page_layout => :landscape) do
   fill_color 50, 100, 0, 0
   text "Prawn is CYMK Friendly"
-  fractal = "#{Prawn::BASEDIR}/data/images/fractal.jpg"
+  fractal = "/usr/share/libprawn-ruby/images/fractal.jpg"
   image fractal, :at => [50,450]
 end
Index: libprawn-ruby-0.6.3+dfsg/examples/graphics/image_fit.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/graphics/image_fit.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/graphics/image_fit.rb	2009-11-24 17:15:19.000000000 -0600
@@ -8,7 +8,7 @@
    
 Prawn::Document.generate("image_fit.pdf", :page_layout => :landscape) do
 
-  pigs = "#{Prawn::BASEDIR}/data/images/pigs.jpg" 
+  pigs = "/usr/share/libprawn-ruby/images/pigs.jpg" 
   stroke_rectangle [50,450], 200, 200
   image pigs, :at => [50,450], :fit => [200,200]
 
Index: libprawn-ruby-0.6.3+dfsg/examples/graphics/image_flow.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/graphics/image_flow.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/graphics/image_flow.rb	2009-11-24 17:15:19.000000000 -0600
@@ -9,7 +9,7 @@
    
 Prawn::Document.generate("image-flow.pdf", :page_layout => :landscape) do  
   self.font_size = 8                           
-  stef = "#{Prawn::BASEDIR}/data/images/stef.jpg"  
+  stef = "/usr/share/libprawn-ruby/images/stef.jpg"  
   
   text "Image at default position with no arguments"
   
Index: libprawn-ruby-0.6.3+dfsg/examples/graphics/image_position.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/graphics/image_position.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/graphics/image_position.rb	2009-11-24 17:15:19.000000000 -0600
@@ -6,7 +6,7 @@
    
 Prawn::Document.generate("image_position.pdf", :page_layout => :landscape) do
 
-  dice = "#{Prawn::BASEDIR}/data/images/dice.png"
+  dice = "/usr/share/libprawn-ruby/images/dice.png"
 
   image dice, :scale => 0.2, :position => :left,   :vposition => :top
   image dice, :scale => 0.2, :position => :right,  :vposition => :top
Index: libprawn-ruby-0.6.3+dfsg/examples/graphics/png_types.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/graphics/png_types.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/graphics/png_types.rb	2009-11-24 17:15:19.000000000 -0600
@@ -6,11 +6,11 @@
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
 
 images = [
-          ["Type 0", "#{Prawn::BASEDIR}/data/images/web-links.png"],
-          ["Type 2", "#{Prawn::BASEDIR}/data/images/ruport.png"],
-          ["Type 3", "#{Prawn::BASEDIR}/data/images/rails.png"],
-          ["Type 4", "#{Prawn::BASEDIR}/data/images/page_white_text.png"],
-          ["Type 6", "#{Prawn::BASEDIR}/data/images/dice.png"],
+          ["Type 0", "/usr/share/libprawn-ruby/images/web-links.png"],
+          ["Type 2", "/usr/share/libprawn-ruby/images/ruport.png"],
+          ["Type 3", "/usr/share/libprawn-ruby/images/rails.png"],
+          ["Type 4", "/usr/share/libprawn-ruby/images/page_white_text.png"],
+          ["Type 6", "/usr/share/libprawn-ruby/images/dice.png"],
 ]
 
 Prawn::Document.generate("png_types.pdf", :page_size => "A5") do
Index: libprawn-ruby-0.6.3+dfsg/examples/m17n/chinese_text_wrapping.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/m17n/chinese_text_wrapping.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/m17n/chinese_text_wrapping.rb	2009-11-24 17:17:25.000000000 -0600
@@ -7,7 +7,7 @@
 
 start = Time.now
 Prawn::Document.generate("chinese_flow.pdf") do  
-  font "#{Prawn::BASEDIR}/data/fonts/gkai00mp.ttf"   
+  font "/usr/share/libprawn-ruby/fonts/gkai00mp.ttf"   
   font_size 16
 
   long_text = "更可怕的是，同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容，写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事，这样的话，你就非常被动了。写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事"                                                       
Index: libprawn-ruby-0.6.3+dfsg/examples/m17n/sjis.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/m17n/sjis.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/m17n/sjis.rb	2009-11-24 17:15:19.000000000 -0600
@@ -19,7 +19,7 @@
     sjis_str = File.open(datafile, "r:shift_jis") { |f| f.gets }
 
     Prawn::Document.generate("sjis.pdf") do
-      font "#{Prawn::BASEDIR}/data/fonts/gkai00mp.ttf"
+      font "/usr/share/libprawn-ruby/fonts/gkai00mp.ttf"
       text sjis_str
     end       
   end
Index: libprawn-ruby-0.6.3+dfsg/examples/m17n/utf8.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/m17n/utf8.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/m17n/utf8.rb	2009-11-24 17:15:19.000000000 -0600
@@ -6,8 +6,8 @@
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
 
 Prawn::Document.generate("utf8.pdf") do
-  font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
+  font "/usr/share/libprawn-ruby/fonts/DejaVuSans.ttf"
   text "ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει." * 20
 end
 
-      
\ No newline at end of file
+      
Index: libprawn-ruby-0.6.3+dfsg/examples/text/dfont.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/text/dfont.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/text/dfont.rb	2009-11-24 17:15:19.000000000 -0600
@@ -2,7 +2,7 @@
 
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
 
-DFONT_FILE = "#{Prawn::BASEDIR}/data/fonts/Action Man.dfont"
+DFONT_FILE = "/usr/share/libprawn-ruby/fonts/Action Man.dfont"
 puts "There are #{Prawn::Font::DFont.font_count(DFONT_FILE)} fonts in #{DFONT_FILE}:"
 Prawn::Font::DFont.named_fonts(DFONT_FILE).each do |name|
   puts "* #{name}"
Index: libprawn-ruby-0.6.3+dfsg/examples/text/font_calculations.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/text/font_calculations.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/text/font_calculations.rb	2009-11-24 17:15:19.000000000 -0600
@@ -84,7 +84,7 @@
   demonstration
   
   move_down 75
-  font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
+  font "/usr/share/libprawn-ruby/fonts/DejaVuSans.ttf"
   text "Using TTF", :size => 20
   demonstration
   
Index: libprawn-ruby-0.6.3+dfsg/examples/text/kerning.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/text/kerning.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/text/kerning.rb	2009-11-24 17:17:40.000000000 -0600
@@ -16,7 +16,7 @@
   
   text "To not kern and wrap. " * 5, :size => 24, :kerning => false
 
-  font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
+  font "/usr/share/libprawn-ruby/fonts/DejaVuSans.ttf"
   
   text "To kern?", :at => [200,660], :size => 24, :kerning => true
   text "To not kern?", :at => [200,630], :size => 24, :kerning => false     
Index: libprawn-ruby-0.6.3+dfsg/examples/text/simple_text_ttf.rb
===================================================================
--- libprawn-ruby-0.6.3+dfsg.orig/examples/text/simple_text_ttf.rb	2009-11-24 17:14:01.000000000 -0600
+++ libprawn-ruby-0.6.3+dfsg/examples/text/simple_text_ttf.rb	2009-11-24 17:15:19.000000000 -0600
@@ -6,10 +6,10 @@
 
 Prawn::Document.generate "simple_text_ttf.pdf" do       
   fill_color "0000ff"
-  font "#{Prawn::BASEDIR}/data/fonts/comicsans.ttf" 
+  font "/usr/share/libprawn-ruby/fonts/comicsans.ttf" 
   text "Hello World", :at => [200,720], :size => 32         
 
-  font "#{Prawn::BASEDIR}/data/fonts/Chalkboard.ttf"
+  font "/usr/share/libprawn-ruby/fonts/Chalkboard.ttf"
 
   pad(20) do
     text "This is chalkboard wrapping " * 20
