Source: xapian-bindings
Version: 1.2.10-1
Severity: normal
Tags: patch

Dear Maintainer,

The Ruby team has formed a new policy for Ruby packaging. A patch is
attached which ports the ruby packaging for xapian-bindings to this new
policy.

For more information see the bits from the Ruby team that discusses the
transition to the new Ruby policy. [0]

[0] https://lists.debian.org/debian-devel-announce/2012/06/msg00001.html


Thanks for your work for Debian!


Best,
Per

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-4-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From f26638b87a440794bf074387e981fd5e99fb150b Mon Sep 17 00:00:00 2001
From: Per Andersson <[email protected]>
Date: Sat, 2 Jun 2012 01:07:22 +0200
Subject: [PATCH] Migrate Ruby xapian-bindings to gem2deb.

Introduce ruby-xapian, which is built for all Ruby versions, and create
transitional packages.

Stay backwards compatible with debian/rules maint process for lenny etc.
---
 debian/changelog                       |   18 +++++++++
 debian/control                         |   48 +++++++++++++-----------
 debian/control-ruby-gem2deb.in         |   41 ++++++++++++++++++++
 debian/control.in                      |    1 +
 debian/libxapian-ruby1.8.doc-base      |   13 ------
 debian/libxapian-ruby1.8.doc-base.in   |   13 ++++++
 debian/libxapian-ruby1.8.install       |    3 -
 debian/libxapian-ruby1.8.install.in    |    3 +
 debian/libxapian-ruby1.9.1.doc-base    |   13 ------
 debian/libxapian-ruby1.9.1.doc-base.in |   13 ++++++
 debian/libxapian-ruby1.9.1.install     |    3 -
 debian/libxapian-ruby1.9.1.install.in  |    3 +
 debian/ruby-xapian.doc-base            |   13 ++++++
 debian/ruby-xapian.doc-base.in         |   13 ++++++
 debian/ruby-xapian.install             |    5 ++
 debian/ruby-xapian.install.in          |    5 ++
 debian/rules                           |   64 +++++++++++++++++++++++++++-----
 17 files changed, 208 insertions(+), 64 deletions(-)
 create mode 100644 debian/control-ruby-gem2deb.in
 delete mode 100644 debian/libxapian-ruby1.8.doc-base
 create mode 100644 debian/libxapian-ruby1.8.doc-base.in
 delete mode 100644 debian/libxapian-ruby1.8.install
 create mode 100644 debian/libxapian-ruby1.8.install.in
 delete mode 100644 debian/libxapian-ruby1.9.1.doc-base
 create mode 100644 debian/libxapian-ruby1.9.1.doc-base.in
 delete mode 100644 debian/libxapian-ruby1.9.1.install
 create mode 100644 debian/libxapian-ruby1.9.1.install.in
 create mode 100644 debian/ruby-xapian.doc-base
 create mode 100644 debian/ruby-xapian.doc-base.in
 create mode 100644 debian/ruby-xapian.install
 create mode 100644 debian/ruby-xapian.install.in

diff --git a/debian/changelog b/debian/changelog
index 19a4d66..2289d81 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+xapian-bindings (1.2.10-2) UNRELEASED; urgency=low
+
+  [ Per Andersson ]
+  * Migrate to gem2deb packaging.
+    + Introduce new binary package ruby-xapian which includes bindings for
+      both Ruby 1.8 and 1.9.1.
+    + Install to vendor_ruby dir.
+    + Bump debhelper version dependency to >= 7.0.50~.
+    + Add build dependency on gem2deb >= 0.2.13~.
+    + Add new debian/control-ruby-gem2deb.in file which declares ruby-xapian
+      and transitional packages.
+    + Build for all Ruby versions.
+    + Add transitional packages.
+    + Install to vendorlibdir and vendorarchdir instead of rubylibdir and
+      archdir, respectively.
+
+ -- Olly Betts <[email protected]>  Fri, 01 Jun 2012 12:43:00 +0200
+
 xapian-bindings (1.2.10-1) unstable; urgency=low
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index 6344f62..ac580bc 100644
--- a/debian/control
+++ b/debian/control
@@ -3,8 +3,9 @@ Section: libs
 Priority: optional
 Maintainer: Olly Betts <[email protected]>
 Standards-Version: 3.9.3
-Build-Depends: debhelper (>= 7), python, python-all-dev (>= 2.6.6-3~),   
tcl-dev, ruby1.8-dev, ruby1.9.1-dev, ruby1.8, ruby1.9.1, libxapian-dev (>= 
1.2.10), libxapian-dev (<< 1.3.0), autotools-dev, libxapian-dev (>= 1.2.0-2~)
+Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.2.13~), python, 
python-all-dev (>= 2.6.6-3~),   tcl-dev, libxapian-dev (>= 1.2.10), 
libxapian-dev (<< 1.3.0), autotools-dev, libxapian-dev (>= 1.2.0-2~)
 X-Python-Version: >= 2.3
+XS-Ruby-Versions: all
 Homepage: http://xapian.org/
 Vcs-Browser: http://trac.xapian.org/browser/trunk/xapian-bindings
 Vcs-svn: svn://svn.xapian.org/xapian/trunk/xapian-bindings
@@ -51,13 +52,17 @@ Description: Xapian search engine interface for Python
  The Xapian Python bindings provide an interface to the Xapian library from the
  Python programming language, allowing both indexing and retrieval operations.
 
-Package: libxapian-ruby1.8
+Package: ruby-xapian
 Section: ruby
 Architecture: any
-Depends: libruby1.8, ${shlibs:Depends}, ${misc:Depends}
+XB-Ruby-Versions: ${ruby:Versions}
+Depends: ruby | ruby-interpeter, ${shlibs:Depends}, ${misc:Depends}
+Replaces: libxapian-ruby1.8 (<< 1.2.10-2~), libxapian-ruby1.9.1 (<< 1.2.10-2~)
+Breaks: libxapian-ruby1.8 (<< 1.2.10-2~), libxapian-ruby1.9.1 (<< 1.2.10-2~)
+Provides: libxapian-ruby1.8, libxapian-ruby1.9.1
 Suggests: xapian-doc
-Description: Xapian search engine interface for Ruby 1.8
- This package provides Xapian Ruby bindings built for Ruby 1.8.
+Description: Xapian search engine interface for Ruby
+ This package provides Xapian Ruby bindings built for Ruby.
  .
  The Xapian search engine library is a highly adaptable toolkit which allows
  developers to easily add advanced indexing and search facilities to their own
@@ -70,21 +75,20 @@ Description: Xapian search engine interface for Ruby 1.8
  The Xapian Ruby bindings provide an interface to the Xapian library from the
  Ruby programming language, allowing both indexing and retrieval operations.
 
+Package: libxapian-ruby1.8
+Section: oldlibs
+Priority: extra
+Architecture: all
+depends: ${misc:Depends}, ruby-xapian
+Description: Transitional package for ruby-xapian
+ This is a transitional package to ease upgrades to ruby-xapian package.
+ It can safely be removed.
+
 Package: libxapian-ruby1.9.1
-Section: ruby
-Architecture: any
-Depends: libruby1.9.1, ${shlibs:Depends}, ${misc:Depends}
-Suggests: xapian-doc
-Description: Xapian search engine interface for Ruby 1.9.1
- This package provides Xapian Ruby bindings built for Ruby 1.9.1.
- .
- The Xapian search engine library is a highly adaptable toolkit which allows
- developers to easily add advanced indexing and search facilities to their own
- applications.  It implements the probabilistic model of information retrieval,
- and provides facilities for performing ranked free-text searches, relevance
- feedback, phrase searching, boolean searching, stemming, and simultaneous
- update and searching.  It is highly scalable, and is capable of working with
- collections containing hundreds of millions of documents.
- .
- The Xapian Ruby bindings provide an interface to the Xapian library from the
- Ruby programming language, allowing both indexing and retrieval operations.
+Section: oldlibs
+Priority: extra
+Architecture: all
+depends: ${misc:Depends}, ruby-xapian
+Description: Transitional package for ruby-xapian
+ This is a transitional package to ease upgrades to ruby-xapian package.
+ It can safely be removed.
diff --git a/debian/control-ruby-gem2deb.in b/debian/control-ruby-gem2deb.in
new file mode 100644
index 0000000..9a6a1f0
--- /dev/null
+++ b/debian/control-ruby-gem2deb.in
@@ -0,0 +1,41 @@
+
+Package: ruby-xapian
+Section: ruby
+Architecture: any
+@XB_RUBY_VERSIONS@
+Depends: ruby | ruby-interpeter, ${shlibs:Depends}, ${misc:Depends}
+Replaces: libxapian-ruby1.8 (<< 1.2.10-2~), libxapian-ruby1.9.1 (<< 1.2.10-2~)
+Breaks: libxapian-ruby1.8 (<< 1.2.10-2~), libxapian-ruby1.9.1 (<< 1.2.10-2~)
+Provides: libxapian-ruby1.8, libxapian-ruby1.9.1
+Suggests: xapian-doc
+Description: Xapian search engine interface for Ruby
+ This package provides Xapian Ruby bindings built for Ruby.
+ .
+ The Xapian search engine library is a highly adaptable toolkit which allows
+ developers to easily add advanced indexing and search facilities to their own
+ applications.  It implements the probabilistic model of information retrieval,
+ and provides facilities for performing ranked free-text searches, relevance
+ feedback, phrase searching, boolean searching, stemming, and simultaneous
+ update and searching.  It is highly scalable, and is capable of working with
+ collections containing hundreds of millions of documents.
+ .
+ The Xapian Ruby bindings provide an interface to the Xapian library from the
+ Ruby programming language, allowing both indexing and retrieval operations.
+
+Package: libxapian-ruby1.8
+Section: oldlibs
+Priority: extra
+Architecture: all
+depends: ${misc:Depends}, ruby-xapian
+Description: Transitional package for ruby-xapian
+ This is a transitional package to ease upgrades to ruby-xapian package.
+ It can safely be removed.
+
+Package: libxapian-ruby1.9.1
+Section: oldlibs
+Priority: extra
+Architecture: all
+depends: ${misc:Depends}, ruby-xapian
+Description: Transitional package for ruby-xapian
+ This is a transitional package to ease upgrades to ruby-xapian package.
+ It can safely be removed.
diff --git a/debian/control.in b/debian/control.in
index cfb67b5..0a1da40 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -5,6 +5,7 @@ Maintainer: Olly Betts <[email protected]>
 Standards-Version: 3.9.3
 Build-Depends: @BUILD_DEPS@ autotools-dev, libxapian-dev (>= 1.2.0-2~)
 @X_PYTHON_VERSION@
+@XS_RUBY_VERSIONS@
 Homepage: http://xapian.org/
 Vcs-Browser: http://trac.xapian.org/browser/trunk/xapian-bindings
 Vcs-svn: svn://svn.xapian.org/xapian/trunk/xapian-bindings
diff --git a/debian/libxapian-ruby1.8.doc-base 
b/debian/libxapian-ruby1.8.doc-base
deleted file mode 100644
index d1b6eda..0000000
--- a/debian/libxapian-ruby1.8.doc-base
+++ /dev/null
@@ -1,13 +0,0 @@
-Document: xapian-ruby-docs
-Title: Using Xapian from Ruby
-Abstract: Documentation on how to use the Xapian search engine library from
- Ruby.
-Section: Programming/Ruby
-
-Format: HTML
-Index: /usr/share/doc/libxapian-ruby1.8/index.html
-Files: /usr/share/doc/libxapian-ruby1.8/index.html
- /usr/share/doc/libxapian-ruby1.8/rdocs/*.html
- /usr/share/doc/libxapian-ruby1.8/rdocs/*/*.html
- /usr/share/doc/libxapian-ruby1.8/rdocs/*/*/*.html
- /usr/share/doc/libxapian-ruby1.8/rdocs/*/*/*/*.html
diff --git a/debian/libxapian-ruby1.8.doc-base.in 
b/debian/libxapian-ruby1.8.doc-base.in
new file mode 100644
index 0000000..d1b6eda
--- /dev/null
+++ b/debian/libxapian-ruby1.8.doc-base.in
@@ -0,0 +1,13 @@
+Document: xapian-ruby-docs
+Title: Using Xapian from Ruby
+Abstract: Documentation on how to use the Xapian search engine library from
+ Ruby.
+Section: Programming/Ruby
+
+Format: HTML
+Index: /usr/share/doc/libxapian-ruby1.8/index.html
+Files: /usr/share/doc/libxapian-ruby1.8/index.html
+ /usr/share/doc/libxapian-ruby1.8/rdocs/*.html
+ /usr/share/doc/libxapian-ruby1.8/rdocs/*/*.html
+ /usr/share/doc/libxapian-ruby1.8/rdocs/*/*/*.html
+ /usr/share/doc/libxapian-ruby1.8/rdocs/*/*/*/*.html
diff --git a/debian/libxapian-ruby1.8.install b/debian/libxapian-ruby1.8.install
deleted file mode 100644
index 0488963..0000000
--- a/debian/libxapian-ruby1.8.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/lib/ruby/1.8
-usr/share/doc/xapian-bindings-ruby1.8/ruby/* usr/share/doc/libxapian-ruby1.8
-usr/share/doc/xapian-bindings-ruby1.8/ruby/examples/*.rb 
usr/share/doc/libxapian-ruby1.8/examples
diff --git a/debian/libxapian-ruby1.8.install.in 
b/debian/libxapian-ruby1.8.install.in
new file mode 100644
index 0000000..0488963
--- /dev/null
+++ b/debian/libxapian-ruby1.8.install.in
@@ -0,0 +1,3 @@
+usr/lib/ruby/1.8
+usr/share/doc/xapian-bindings-ruby1.8/ruby/* usr/share/doc/libxapian-ruby1.8
+usr/share/doc/xapian-bindings-ruby1.8/ruby/examples/*.rb 
usr/share/doc/libxapian-ruby1.8/examples
diff --git a/debian/libxapian-ruby1.9.1.doc-base 
b/debian/libxapian-ruby1.9.1.doc-base
deleted file mode 100644
index 0805768..0000000
--- a/debian/libxapian-ruby1.9.1.doc-base
+++ /dev/null
@@ -1,13 +0,0 @@
-Document: xapian-ruby-docs-1.9
-Title: Using Xapian from Ruby 1.9
-Abstract: Documentation on how to use the Xapian search engine library from
- Ruby 1.9.
-Section: Programming/Ruby
-
-Format: HTML
-Index: /usr/share/doc/libxapian-ruby1.9.1/index.html
-Files: /usr/share/doc/libxapian-ruby1.9.1/index.html
- /usr/share/doc/libxapian-ruby1.9.1/rdocs/*.html
- /usr/share/doc/libxapian-ruby1.9.1/rdocs/*/*.html
- /usr/share/doc/libxapian-ruby1.9.1/rdocs/*/*/*.html
- /usr/share/doc/libxapian-ruby1.9.1/rdocs/*/*/*/*.html
diff --git a/debian/libxapian-ruby1.9.1.doc-base.in 
b/debian/libxapian-ruby1.9.1.doc-base.in
new file mode 100644
index 0000000..0805768
--- /dev/null
+++ b/debian/libxapian-ruby1.9.1.doc-base.in
@@ -0,0 +1,13 @@
+Document: xapian-ruby-docs-1.9
+Title: Using Xapian from Ruby 1.9
+Abstract: Documentation on how to use the Xapian search engine library from
+ Ruby 1.9.
+Section: Programming/Ruby
+
+Format: HTML
+Index: /usr/share/doc/libxapian-ruby1.9.1/index.html
+Files: /usr/share/doc/libxapian-ruby1.9.1/index.html
+ /usr/share/doc/libxapian-ruby1.9.1/rdocs/*.html
+ /usr/share/doc/libxapian-ruby1.9.1/rdocs/*/*.html
+ /usr/share/doc/libxapian-ruby1.9.1/rdocs/*/*/*.html
+ /usr/share/doc/libxapian-ruby1.9.1/rdocs/*/*/*/*.html
diff --git a/debian/libxapian-ruby1.9.1.install 
b/debian/libxapian-ruby1.9.1.install
deleted file mode 100644
index 1cc8219..0000000
--- a/debian/libxapian-ruby1.9.1.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/lib/ruby/1.9.1
-usr/share/doc/xapian-bindings-ruby1.9.1/ruby/* 
usr/share/doc/libxapian-ruby1.9.1
-usr/share/doc/xapian-bindings-ruby1.9.1/ruby/examples/*.rb 
usr/share/doc/libxapian-ruby1.9.1/examples
diff --git a/debian/libxapian-ruby1.9.1.install.in 
b/debian/libxapian-ruby1.9.1.install.in
new file mode 100644
index 0000000..1cc8219
--- /dev/null
+++ b/debian/libxapian-ruby1.9.1.install.in
@@ -0,0 +1,3 @@
+usr/lib/ruby/1.9.1
+usr/share/doc/xapian-bindings-ruby1.9.1/ruby/* 
usr/share/doc/libxapian-ruby1.9.1
+usr/share/doc/xapian-bindings-ruby1.9.1/ruby/examples/*.rb 
usr/share/doc/libxapian-ruby1.9.1/examples
diff --git a/debian/ruby-xapian.doc-base b/debian/ruby-xapian.doc-base
new file mode 100644
index 0000000..bb3edc0
--- /dev/null
+++ b/debian/ruby-xapian.doc-base
@@ -0,0 +1,13 @@
+Document: xapian-ruby-docs
+Title: Using Xapian from Ruby
+Abstract: Documentation on how to use the Xapian search engine library from
+ Ruby.
+Section: Programming/Ruby
+
+Format: HTML
+Index: /usr/share/doc/ruby-xapian/index.html
+Files: /usr/share/doc/ruby-xapian/index.html
+ /usr/share/doc/ruby-xapian/rdocs/*.html
+ /usr/share/doc/ruby-xapian/rdocs/*/*.html
+ /usr/share/doc/ruby-xapian/rdocs/*/*/*.html
+ /usr/share/doc/ruby-xapian/rdocs/*/*/*/*.html
diff --git a/debian/ruby-xapian.doc-base.in b/debian/ruby-xapian.doc-base.in
new file mode 100644
index 0000000..bb3edc0
--- /dev/null
+++ b/debian/ruby-xapian.doc-base.in
@@ -0,0 +1,13 @@
+Document: xapian-ruby-docs
+Title: Using Xapian from Ruby
+Abstract: Documentation on how to use the Xapian search engine library from
+ Ruby.
+Section: Programming/Ruby
+
+Format: HTML
+Index: /usr/share/doc/ruby-xapian/index.html
+Files: /usr/share/doc/ruby-xapian/index.html
+ /usr/share/doc/ruby-xapian/rdocs/*.html
+ /usr/share/doc/ruby-xapian/rdocs/*/*.html
+ /usr/share/doc/ruby-xapian/rdocs/*/*/*.html
+ /usr/share/doc/ruby-xapian/rdocs/*/*/*/*.html
diff --git a/debian/ruby-xapian.install b/debian/ruby-xapian.install
new file mode 100644
index 0000000..f9c0140
--- /dev/null
+++ b/debian/ruby-xapian.install
@@ -0,0 +1,5 @@
+usr/lib/ruby/vendor_ruby/1.8/xapian.rb usr/lib/ruby/vendor_ruby
+usr/lib/ruby/vendor_ruby/1.8/i486-linux
+usr/lib/ruby/vendor_ruby/1.9.1/i486-linux
+usr/share/doc/xapian-bindings-ruby1.8/ruby/* usr/share/doc/ruby-xapian
+usr/share/doc/xapian-bindings-ruby1.8/ruby/examples/*.rb 
usr/share/doc/ruby-xapian/examples
diff --git a/debian/ruby-xapian.install.in b/debian/ruby-xapian.install.in
new file mode 100644
index 0000000..f9c0140
--- /dev/null
+++ b/debian/ruby-xapian.install.in
@@ -0,0 +1,5 @@
+usr/lib/ruby/vendor_ruby/1.8/xapian.rb usr/lib/ruby/vendor_ruby
+usr/lib/ruby/vendor_ruby/1.8/i486-linux
+usr/lib/ruby/vendor_ruby/1.9.1/i486-linux
+usr/share/doc/xapian-bindings-ruby1.8/ruby/* usr/share/doc/ruby-xapian
+usr/share/doc/xapian-bindings-ruby1.8/ruby/examples/*.rb 
usr/share/doc/ruby-xapian/examples
diff --git a/debian/rules b/debian/rules
index 34f633c..c8ddda7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,7 +36,7 @@ XAPIAN_VERSION_CEILING := $(shell echo 
'$(XAPIAN_VERSION)'|awk -F. '{print $$1".
 # `--exclude=.EXT' arguments to pass dh_install
 DH_INSTALL_EXCLUDE := --exclude=.pyc --exclude=.pyo
 
-BUILD_DEPS := debhelper (>= 7),
+BUILD_DEPS := debhelper (>= 7.0.50~),
 
 # Disabled due to incompatibility of GPL and PHP licence.  Uncomment to build
 # your own binary packages (just don't distribute them!)
@@ -44,8 +44,15 @@ BUILD_DEPS := debhelper (>= 7),
 
 ifeq ($(findstring .$(CODENAME)., .lenny.hardy.intrepid.jaunty.), )
 RUBY_VERSIONS := 1.8 1.9.1
+BUILD_DEPS += gem2deb (>= 0.2.13~),
+XB_RUBY_VERSIONS := XB-Ruby-Versions: $${ruby:Versions}
+XS_RUBY_VERSIONS := XS-Ruby-Versions: all
 else
 RUBY_VERSIONS := 1.8
+# Only the first % in the replacement part is substituted, so we need to do
+# this in two goes.
+BUILD_DEPS += $(RUBY_VERSIONS:%=ruby%-dev,)
+BUILD_DEPS += $(RUBY_VERSIONS:%=ruby%,)
 endif
 
 # The python versions to build for:
@@ -114,13 +121,6 @@ BUILD_DEPS += $(PHP_VERSIONS:%=php%-cli,)
 BUILD_DEPS += tcl-dev,# NB Trailing ',' required here!
 TCLSH=/usr/bin/tclsh-default
 
-# Build depends for Ruby.
-#
-# Only the first % in the replacement part is substituted, so we need to do
-# this in two goes.
-BUILD_DEPS += $(RUBY_VERSIONS:%=ruby%-dev,)
-BUILD_DEPS += $(RUBY_VERSIONS:%=ruby%,)
-
 # We need a versioned build dependency on libxapian-dev.
 # NB Trailing ',' required here!
 BUILD_DEPS += \
@@ -140,21 +140,56 @@ maint: debian/control
 
 maintclean: clean
        rm -f debian/control
+       rm -f debian/libxapian-ruby1.8.doc-base
+       rm -f debian/libxapian-ruby1.8.install
+       rm -f debian/libxapian-ruby1.9.1.doc-base
+       rm -f debian/libxapian-ruby1.9.1.install
+       rm -f debian/ruby-xapian.doc-base
+       rm -f debian/ruby-xapian.install
 
 debian/control: debian/rules debian/control.in
        rm -f debian/control.tmp
+ifdef XS_RUBY_VERSIONS
+       sed -e 's/@BUILD_DEPS@/$(BUILD_DEPS)/g' \
+           -e 's/@X_PYTHON_VERSION@/$(X_PYTHON_VERSION)/g' \
+           -e 's/@XB_PYTHON_VERSION@/$(XB_PYTHON_VERSION)/g' \
+           -e 's/@XS_RUBY_VERSIONS@/$(XS_RUBY_VERSIONS)/g' \
+           < debian/control.in > debian/control.tmp
+else
        sed -e 's/@BUILD_DEPS@/$(BUILD_DEPS)/g' \
            -e 's/@X_PYTHON_VERSION@/$(X_PYTHON_VERSION)/g' \
            -e 's/@XB_PYTHON_VERSION@/$(XB_PYTHON_VERSION)/g' \
+           -e '/@XS_RUBY_VERSIONS@/d' \
            < debian/control.in > debian/control.tmp
+endif
        for v in $(PHP_VERSIONS); do \
            sed "s/@PHP_VERSION@/$$v/g" debian/control-php.in ;\
        done >> debian/control.tmp
+ifdef XB_RUBY_VERSIONS
+       sed -e 's/@XB_RUBY_VERSIONS@/$(XB_RUBY_VERSIONS)/g' \
+           < debian/control-ruby-gem2deb.in >> debian/control.tmp
+       cp debian/ruby-xapian.doc-base.in debian/ruby-xapian.doc-base
+       cp debian/ruby-xapian.install.in debian/ruby-xapian.install
+else
        for v in $(RUBY_VERSIONS); do \
            sed "s/@RUBY_VERSION@/$$v/g" debian/control-ruby.in ;\
        done >> debian/control.tmp
+       # install files to old packages
+       cp debian/libxapian-ruby1.8.doc-base.in 
debian/libxapian-ruby1.8.doc-base
+       cp debian/libxapian-ruby1.8.install.in debian/libxapian-ruby1.8.install
+       cp debian/libxapian-ruby1.9.1.doc-base.in 
debian/libxapian-ruby1.9.1.doc-base
+       cp debian/libxapian-ruby1.9.1.install.in 
debian/libxapian-ruby1.9.1.install
+endif
        mv debian/control.tmp debian/control
 
+ifdef XS_RUBY_VERSIONS
+rubylibdir := 'puts Config::CONFIG["vendorlibdir"]'
+rubyarchdir := 'puts Config::CONFIG["vendorarchdir"]'
+else
+rubylibdir := 'puts Config::CONFIG["rubylibdir"]'
+rubyarchdir := 'puts Config::CONFIG["archdir"]'
+endif
+
 configure: configure-stamp
 configure-stamp:
        dh_testdir
@@ -193,8 +228,9 @@ configure-stamp:
            ../../../configure $(commonconfflags) --with-ruby \
                --docdir=/usr/share/doc/xapian-bindings-ruby$$v \
                RUBY=$$RUBY \
-               RUBY_LIB=`$$RUBY -rrbconfig -e 'puts 
Config::CONFIG["rubylibdir"]'` \
-               RUBY_LIB_ARCH=`$$RUBY -rrbconfig -e 'puts 
Config::CONFIG["archdir"]'`; \
+               RUBY_LIB=`$$RUBY -rrbconfig -e $(rubylibdir)` \
+               RUBY_LIB_ARCH=`$$RUBY -rrbconfig -e $(rubyarchdir)`; \
+               echo $$RUBY_LIB $$RUBY_LIB_ARCH; \
            cd ../../..; \
        done
 
@@ -264,6 +300,14 @@ install: build
            set -e; \
            $(MAKE) -C debian/build/ruby$$v DESTDIR=$(CURDIR)/debian/tmp 
install; \
        done
+ifdef XB_RUBY_VERSIONS
+       # Only need one xapian.rb for ruby-xapian, and we install version 1.8 
and
+       # remove 1.9.1. They are exactly the same anyway.
+       rm $(CURDIR)/debian/tmp/usr/lib/ruby/vendor_ruby/1.9.1/xapian.rb
+       # The same goes for the docs. Docs for 1.8 are installed by
+       # ruby-xapian.install.
+       rm -r $(CURDIR)/debian/tmp/usr/share/doc/xapian-bindings-ruby1.9.1
+endif
 
        $(MAKE) -C debian/build/tcl DESTDIR=$(CURDIR)/debian/tmp install
 
-- 
1.7.7.3

Reply via email to