[DRE-commits] r3729 - in packages-wip/libprawn-ruby/trunk/debian: . patches

Gunnar Wolf gwolf at alioth.debian.org
Wed Jul 1 23:28:15 UTC 2009


Author: gwolf
Date: 2009-07-01 23:28:15 +0000 (Wed, 01 Jul 2009)
New Revision: 3729

Added:
   packages-wip/libprawn-ruby/trunk/debian/patches/
   packages-wip/libprawn-ruby/trunk/debian/patches/fix_paths
   packages-wip/libprawn-ruby/trunk/debian/patches/series
Modified:
   packages-wip/libprawn-ruby/trunk/debian/control
   packages-wip/libprawn-ruby/trunk/debian/rules
Log:
Fixing paths and policy incompatibilities... almost there!

Modified: packages-wip/libprawn-ruby/trunk/debian/control
===================================================================
--- packages-wip/libprawn-ruby/trunk/debian/control	2009-07-01 18:40:28 UTC (rev 3728)
+++ packages-wip/libprawn-ruby/trunk/debian/control	2009-07-01 23:28:15 UTC (rev 3729)
@@ -3,20 +3,27 @@
 Priority: optional
 Maintainer: Gunnar Wolf <gwolf at debian.org>
 Uploaders: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
-Build-Depends: ruby-pkg-tools (>= 0.8), cdbs, debhelper (>= 7), libsetup-ruby1.8
+Build-Depends: ruby-pkg-tools (>= 0.8), cdbs, debhelper (>= 7), libsetup-ruby1.8, quilt
 Build-Depends-Indep: ruby1.8, rdoc
-Standards-Version: 3.8.1
+Standards-Version: 3.8.2
 Homepage: http://prawn.majesticseacreature.com/
 Vcs-Svn: svn://svn.debian.org/pkg-ruby-extras/libprawn-ruby/trunk/
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-ruby-extras/libprawn-ruby/trunk/
 
 Package: libprawn-ruby1.8
 Architecture: all
-Depends: ${misc:Depends}, ruby1.8
-Recommends: rails (>= 2.0.0)
+Depends: ${misc:Depends}, ruby1.8, libprawn-ruby-common
+Recommends: ttf-dejavu-core
 Description: Prawn: Fast, Nimble PDF Generation For Ruby
  (a decent description goes here)
 
+Package: libprawn-ruby1.9
+Architecture: all
+Depends: ${misc:Depends}, ruby1.9, libprawn-ruby-common
+Recommends: ttf-dejavu-core
+Description: Prawn: Fast, Nimble PDF Generation For Ruby
+ (a decent description goes here)
+
 Package: libprawn-ruby
 Architecture: all
 Depends: ${misc:Depends}, libprawn-ruby1.8
@@ -25,3 +32,12 @@
  .
  This is a dummy package depending on the library for the current default
  version of Ruby.
+
+Package: libprawn-ruby-common
+Architecture: all
+Depends: ${misc:Depends}
+Suggests: ttf-dejavu-core, ttf-dustin, ttf-arphic-gkai00mp
+Description: Prawn: Fast, Nimble PDF Generation For Ruby
+ (a decent description goes here)
+ .
+ Common files used by both Ruby 1.8 and 1.9 versions of libprawn-ruby

Added: packages-wip/libprawn-ruby/trunk/debian/patches/fix_paths
===================================================================
--- packages-wip/libprawn-ruby/trunk/debian/patches/fix_paths	                        (rev 0)
+++ packages-wip/libprawn-ruby/trunk/debian/patches/fix_paths	2009-07-01 23:28:15 UTC (rev 3729)
@@ -0,0 +1,254 @@
+Index: libprawn-ruby-0.4.1/lib/prawn/font/afm.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/lib/prawn/font/afm.rb	2009-07-01 18:21:40.000000000 -0500
++++ libprawn-ruby-0.4.1/lib/prawn/font/afm.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -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.4.1/lib/prawn/encoding.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/lib/prawn/encoding.rb	2009-07-01 18:21:40.000000000 -0500
++++ libprawn-ruby-0.4.1/lib/prawn/encoding.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -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.4.1/examples/general/background.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/general/background.rb	2009-07-01 18:21:41.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/general/background.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -7,7 +7,7 @@
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
+ require "prawn"
+ 
+-img = "#{Prawn::BASEDIR}/data/images/letterhead.jpg"
++img = "/usr/share/libprawn-ruby/images/letterhead.jpg"
+ 
+ Prawn::Document.generate("background.pdf", :background => img) do
+   text_options.update(:size => 18, :align => :right)
+Index: libprawn-ruby-0.4.1/examples/graphics/basic_images.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/graphics/basic_images.rb	2009-07-01 18:21:40.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/graphics/basic_images.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -8,20 +8,20 @@
+ require "prawn"
+    
+ Prawn::Document.generate("basic_images.pdf", :page_layout => :landscape) do     
+-  pigs = "#{Prawn::BASEDIR}/data/images/pigs.jpg" 
++  pigs = "/usr/share/libprawn-ruby/images/pigs.jpg" 
+   image pigs, :at => [50,450], :scale => 0.5                                       
+   
+-  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
+\ No newline at end of file
+Index: libprawn-ruby-0.4.1/examples/graphics/cmyk.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/graphics/cmyk.rb	2009-07-01 18:21:40.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/graphics/cmyk.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -8,6 +8,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.4.1/examples/graphics/image_fit.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/graphics/image_fit.rb	2009-07-01 18:21:40.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/graphics/image_fit.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -9,7 +9,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.4.1/examples/graphics/image_flow.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/graphics/image_flow.rb	2009-07-01 18:21:41.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/graphics/image_flow.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -10,7 +10,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.4.1/examples/graphics/image_position.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/graphics/image_position.rb	2009-07-01 18:21:41.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/graphics/image_position.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -7,7 +7,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.4.1/examples/graphics/png_types.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/graphics/png_types.rb	2009-07-01 18:21:40.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/graphics/png_types.rb	2009-07-01 18:22:30.000000000 -0500
+@@ -7,11 +7,11 @@
+ require "prawn"
+ 
+ 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.4.1/examples/m17n/chinese_text_wrapping.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/m17n/chinese_text_wrapping.rb	2009-07-01 18:23:22.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/m17n/chinese_text_wrapping.rb	2009-07-01 18:26:31.000000000 -0500
+@@ -8,7 +8,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"   
+   text_options.update(:wrap => :character, :size => 16)
+   long_text = "更可怕的是,同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容,写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事,这样的话,你就非常被动了。写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事"                                                       
+   text long_text
+@@ -17,4 +17,4 @@
+   text_options.update(:wrap => :spaces)
+   long_text = "Text with some spaces " * 25
+   text long_text
+-end
+\ No newline at end of file
++end
+Index: libprawn-ruby-0.4.1/examples/m17n/sjis.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/m17n/sjis.rb	2009-07-01 18:23:22.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/m17n/sjis.rb	2009-07-01 18:26:23.000000000 -0500
+@@ -20,7 +20,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.4.1/examples/m17n/utf8.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/m17n/utf8.rb	2009-07-01 18:23:22.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/m17n/utf8.rb	2009-07-01 18:25:33.000000000 -0500
+@@ -7,8 +7,8 @@
+ require "prawn"
+ 
+ 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.4.1/examples/text/dfont.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/text/dfont.rb	2009-07-01 18:23:22.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/text/dfont.rb	2009-07-01 18:26:12.000000000 -0500
+@@ -3,7 +3,7 @@
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
+ require "prawn"
+ 
+-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.4.1/examples/text/font_calculations.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/text/font_calculations.rb	2009-07-01 18:23:22.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/text/font_calculations.rb	2009-07-01 18:26:00.000000000 -0500
+@@ -85,7 +85,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.4.1/examples/text/kerning.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/text/kerning.rb	2009-07-01 18:23:22.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/text/kerning.rb	2009-07-01 18:25:55.000000000 -0500
+@@ -17,7 +17,7 @@
+   
+   text "To not kern and wrap. " * 5, :size => 24, :kerning => false
+ 
+-  font "#{Prawn::BASEDIR}/data/fonts/Dustismo_Roman.ttf"
++  font "/usr/share/libprawn-ruby/fonts/Dustismo_Roman.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.4.1/examples/text/simple_text_ttf.rb
+===================================================================
+--- libprawn-ruby-0.4.1.orig/examples/text/simple_text_ttf.rb	2009-07-01 18:23:22.000000000 -0500
++++ libprawn-ruby-0.4.1/examples/text/simple_text_ttf.rb	2009-07-01 18:25:50.000000000 -0500
+@@ -7,10 +7,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

Added: packages-wip/libprawn-ruby/trunk/debian/patches/series
===================================================================
--- packages-wip/libprawn-ruby/trunk/debian/patches/series	                        (rev 0)
+++ packages-wip/libprawn-ruby/trunk/debian/patches/series	2009-07-01 23:28:15 UTC (rev 3729)
@@ -0,0 +1 @@
+fix_paths

Modified: packages-wip/libprawn-ruby/trunk/debian/rules
===================================================================
--- packages-wip/libprawn-ruby/trunk/debian/rules	2009-07-01 18:40:28 UTC (rev 3728)
+++ packages-wip/libprawn-ruby/trunk/debian/rules	2009-07-01 23:28:15 UTC (rev 3729)
@@ -2,4 +2,41 @@
 
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 
+DEB_RUBY_CONFIG_ARGS = --installdirs=std --datadir=/usr/share/libprawn-ruby/
+
+clean::
+	rm -f lib/ttfunk lib/ttfunk.rb lib/pdf 
+
+makebuilddir/libprawn-ruby::
+	[ -e lib/ttfunk    ] || ln -s ../vendor/ttfunk/lib/ttfunk lib/
+	[ -e lib/ttfunk.rb ] || ln -s ../vendor/ttfunk/lib/ttfunk.rb lib/
+	[ -e lib/pdf       ] || ln -s ../vendor/pdf-inspector/lib/pdf lib/
+
+
+install/libprawn-ruby1.8::
+	dh_installexamples examples/*
+	# Files common to 1.8 and 1.9 versions are moved to libprawn-ruby-common
+	mkdir -p ./debian/libprawn-ruby-common/usr/share/
+	mv ./debian/libprawn-ruby1.8/usr/share/libprawn-ruby/ ./debian/libprawn-ruby-common/usr/share/
+
+install/libprawn-ruby1.9::
+	dh_installexamples examples/*
+	# The relevant files were moved to libprawn-ruby-common in
+	# install/libprawn-ruby1.8
+	rm -rf ./debian/libprawn-ruby1.9/usr/share/libprawn-ruby/
+
+install/libprawn-ruby1.9::
+	# Instead of copying fonts that are often found in Debian
+	# systems, recommend the relevant packages and symlink
+	# them. That way, lintian will be happier.
+	rm ./debian/libprawn-ruby-common/usr/share/libprawn-ruby/fonts/DejaVuSans.ttf
+	ln -s ../../fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
+		./debian/libprawn-ruby-common/usr/share/libprawn-ruby/fonts/DejaVuSans.ttf
+	rm ./debian/libprawn-ruby-common/usr/share/libprawn-ruby/fonts/Dustismo_Roman.ttf
+	ln -s ../../fonts/truetype/dustin/Dustismo_Roman.ttf \
+		./debian/libprawn-ruby-common/usr/share/libprawn-ruby/fonts/Dustismo_Roman.ttf
+	rm ./debian/libprawn-ruby-common/usr/share/libprawn-ruby/fonts/gkai00mp.ttf
+	ln -s ../../fonts/truetype/arphic/gkai00mp.ttf \
+		./debian/libprawn-ruby-common/usr/share/libprawn-ruby/fonts/gkai00mp.ttf




More information about the Pkg-ruby-extras-commits mailing list