--- ooo2dbk-2.1.0.orig/debian/docs
+++ ooo2dbk-2.1.0/debian/docs
@@ -1,8 +1,3 @@
-HISTORY
+CHANGELOG.txt
 README.txt
-VERSION
-doc/ABOUT.txt
-doc/howto-use_psmi.txt
-doc/TODO.txt
-ooo/templateOOo2dbk-en.stw
-ooo/templateOOo2dbk-fr.stw
+version.txt
--- ooo2dbk-2.1.0.orig/debian/control
+++ ooo2dbk-2.1.0/debian/control
@@ -2,12 +2,13 @@
 Section: text
 Priority: optional
 Maintainer: Mohammed AdnÃ¨ne Trojette <adn+deb@diwi.org>
-Build-Depends: debhelper (>= 4.0.0), python-dev (>= 2.3)
-Standards-Version: 3.6.2
+Build-Depends: debhelper (>= 5.0.37.2), cdbs (>= 0.4.43), quilt, patchutils (>= 0.2.25), python-all-dev (>= 2.3.5-11), python-support (>= 0.3.2)
+Standards-Version: 3.7.2
 
 Package: ooo2dbk
 Architecture: all
 Depends: ${misc:Depends}, ${python:Depends}, xsltproc | libsaxon-java
+Recommends: python-uno
 Suggests: docbook-xsl
 Description: converts OpenOffice.org SXW documents to DocBook XML
  OOo2Dbk allows to convert documents from OpenOffice-Writer SXW format to
--- ooo2dbk-2.1.0.orig/debian/links
+++ ooo2dbk-2.1.0/debian/links
@@ -0,0 +1 @@
+usr/share/ooo2dbk/ole2img.py usr/bin/ole2img
--- ooo2dbk-2.1.0.orig/debian/rules
+++ ooo2dbk-2.1.0/debian/rules
@@ -1,60 +1,13 @@
 #!/usr/bin/make -f
-# -*- makefile -*-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
 
-configure-stamp:
-	dh_testdir
+# DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
+DEB_INSTALL_MANPAGES_ooo2dbk := doc/ooo2dbk.1 debian/ole2img.1
+DEB_PYTHON_SYSTEM := pysupport
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/makefile.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
 
-	touch configure-stamp
-
-
-build: build-stamp
-
-build-stamp: configure-stamp 
-	dh_testdir
-
-	touch build-stamp
-
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp configure-stamp
-
-	dh_clean 
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_clean -k 
-	dh_installdirs
-
-# Build architecture-dependent files here.
-binary-arch: build install
-# We have nothing to do by default.
-
-# Build architecture-independent files here.
-binary-indep: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs 
-	dh_installdocs
-	dh_installexamples
-	dh_install
-	#mv debian/ooo2dbk/usr/share/doc/ooo2dbk/doc/template.stw debian/ooo2dbk/usr/share/ooo2dbk
-	chmod +x debian/ooo2dbk/usr/share/ooo2dbk/ooo2dbk debian/ooo2dbk/usr/share/ooo2dbk/ole2img.py
-	echo "#!/bin/sh" > debian/ooo2dbk/usr/bin/ooo2dbk
-	echo "/usr/share/ooo2dbk/ooo2dbk -c /etc/ooo2dbk.xml \"\$$@\"" >> debian/ooo2dbk/usr/bin/ooo2dbk
-	dh_installman doc/ooo2dbk.1
-	dh_link
-	dh_strip
-	dh_compress
-	dh_fixperms
-	dh_python
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+binary-install/ooo2dbk::
+	chmod +x debian/ooo2dbk/usr/share/ooo2dbk/ole2img.py
--- ooo2dbk-2.1.0.orig/debian/ole2img.1
+++ ooo2dbk-2.1.0/debian/ole2img.1
@@ -0,0 +1,39 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH OLE2IMG 1 "April 28, 2006"
+.SH NAME
+Ole2img \- programe to convert all OLE objects of a .sxw OpenOffice.org document as images in a target directory
+.SH SYNOPSIS
+.B Ole2img
+.RI [ options ] " openoffice.org-file"
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B ole2img
+commands.
+.PP
+.SH OPTIONS
+This version of Ole2img understands the following command line options.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-\-target
+Target directory (mandatory)
+.TP
+.B \-\-oooserverhost
+Name of server running OpenOffice.org (defaults to localhost)
+.TP
+.B \-\-oooserverport
+Port of the server running OpenOffice.org (defaults to 2002)
+.TP
+.B \-\-format
+Exported image format (defaults to png) [svg, eps, jpg, bmp-ms, gif, tiff, bmp-portable, png]
+.TP
+.B \-\-version
+Show version and exit
+.br
+.SH AUTHOR
+Ole2img was written by Indesko (http://www.indesko.com/)
+.PP
+This manual page was written by Mohammed Adnene Trojette <adn+deb@diwi.org>,
+for the Debian project (but may be used by others).
--- ooo2dbk-2.1.0.orig/debian/changelog
+++ ooo2dbk-2.1.0/debian/changelog
@@ -1,3 +1,52 @@
+ooo2dbk (2.1.0-1) unstable; urgency=low
+
+  * New upstream release. (Closes: #408681)
+  * Totally revamp package:
+     + set debian/compat to 5 and bump debhelper compatibility to 5.
+     + use CDBS.
+     + use quilt to patch setup.py where needed.
+  * Use upstream's ole2img.1 dropped manual page.
+
+ -- Mohammed AdnÃ¨ne Trojette <adn+deb@diwi.org>  Wed, 18 Jul 2007 01:48:43 +0200
+
+ooo2dbk (1.5.0-3) unstable; urgency=low
+
+  * Bump Standards-Version to 3.7.2
+  * Move python-uno from Depends to Recommends (Closes: #373755)
+
+ -- Mohammed AdnÃ¨ne Trojette <adn+deb@diwi.org>  Mon,  1 May 2006 02:28:42 +0200
+
+ooo2dbk (1.5.0-2) unstable; urgency=low
+
+  * ooo2dbk.xml: correct python path
+  * Activate the ole2img command:
+     - debian/rules: add ole2img.py in /usr/bin
+     - debian/control: add dependency on python-uno (Closes: #304706)
+     - debian/README.Debian: remove the note about python-uno
+     - doc/ole2img.1: add manpage
+  * debian/control: change Build-Depends to Build-Depends-Indep
+  * debian/copyright: add packaging copyright information
+
+ -- Mohammed AdnÃ¨ne Trojette <adn+deb@diwi.org>  Sat, 28 Jan 2006 01:45:37 +0100
+
+ooo2dbk (1.5.0-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Mohammed AdnÃ¨ne Trojette <adn+deb@diwi.org>  Sat, 10 Dec 2005 21:51:48 +0100
+
+ooo2dbk (1.4.3-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Mohammed AdnÃ¨ne Trojette <adn+deb@diwi.org>  Fri, 25 Nov 2005 00:23:28 +0100
+
+ooo2dbk (1.4.1-2) unstable; urgency=low
+
+  * Bump to new Standard-Versions
+
+ -- Mohammed AdnÃ¨ne Trojette <adn+deb@diwi.org>  Mon, 12 Sep 2005 16:34:17 +0200
+
 ooo2dbk (1.4.1-1) unstable; urgency=low
 
   * New upstream release
--- ooo2dbk-2.1.0.orig/debian/pyversions
+++ ooo2dbk-2.1.0/debian/pyversions
@@ -0,0 +1 @@
+2.3-
--- ooo2dbk-2.1.0.orig/debian/compat
+++ ooo2dbk-2.1.0/debian/compat
@@ -1 +1 @@
-4
+5
--- ooo2dbk-2.1.0.orig/debian/README.Debian
+++ ooo2dbk-2.1.0/debian/README.Debian
@@ -9,10 +9,4 @@
    /usr/share/doc/ooo2dbk/doc to create your own OOo SXW file. There is
    one in English and one in French.
 
- - Unfortunately, you cannot use --ole option in this package because
-   of the lack of pyuno which is not provided by OpenOffice.org binaries
-   and will not be packaged (see #220226). You then need a local version
-   of pyuno installed. You may find the oleimg.py python script in
-   /usr/share/ooo2dbk tough, in case you have pyuno.
-
  -- Mohammed Adnène Trojette <adn+deb@diwi.org>, Fri,  3 Jun 2005 12:23:05 +0100
--- ooo2dbk-2.1.0.orig/debian/control.in
+++ ooo2dbk-2.1.0/debian/control.in
@@ -0,0 +1,33 @@
+Source: ooo2dbk
+Section: text
+Priority: optional
+Maintainer: Mohammed AdnÃ¨ne Trojette <adn+deb@diwi.org>
+Build-Depends: @cdbs@, debhelper (>= 5), quilt
+Build-Depends-Indep: python-all-dev (>= 2.3)
+Standards-Version: 3.7.2
+
+Package: ooo2dbk
+Architecture: all
+Depends: ${misc:Depends}, ${python:Depends}, xsltproc | libsaxon-java
+Recommends: python-uno
+Suggests: docbook-xsl
+Description: converts OpenOffice.org SXW documents to DocBook XML
+ OOo2Dbk allows to convert documents from OpenOffice-Writer SXW format to
+ a simplified DocBook XML format.
+ .
+ OOo2Dbk is made of an XSLT stylesheet and a set of Python scripts that
+ permit direct processing of SXW documents and extraction of the pictures
+ included in the document.
+ .
+ It can also be used autonomously in order to convert OpenOffice-Writer
+ XML documents produced with a FlatXML filter.
+ .
+ The original version of ooo2dbk is ooo2sdbk, written
+ by Eric Bellot. This version can still be found at
+ http://www.chez.com/ebellot/ooo2sdbk/
+ .
+ OOo2Dbk can at the moment only process files generated by the
+ OpenOffice.org 1.1.x series.
+ .
+ Future versions of OOo2Dbk will process files generated by the
+ OpenOffice.org 2.x series.
--- ooo2dbk-2.1.0.orig/debian/pycompat
+++ ooo2dbk-2.1.0/debian/pycompat
@@ -0,0 +1 @@
+2
--- ooo2dbk-2.1.0.orig/debian/patches/series
+++ ooo2dbk-2.1.0/debian/patches/series
@@ -0,0 +1 @@
+01_fix_setup-py.diff
--- ooo2dbk-2.1.0.orig/debian/patches/01_fix_setup-py.diff
+++ ooo2dbk-2.1.0/debian/patches/01_fix_setup-py.diff
@@ -0,0 +1,45 @@
+Index: ooo2dbk-2.1.0/setup.py
+===================================================================
+--- ooo2dbk-2.1.0.orig/setup.py	2007-07-18 01:34:24.000000000 +0200
++++ ooo2dbk-2.1.0/setup.py	2007-07-18 01:42:25.000000000 +0200
+@@ -12,25 +12,22 @@
+     setup(console=['ooo2dbk'])
+ 
+ elif platform.system() == 'Linux':
+-    os.system('patch -p1 <distrib.patch')
+     setup(name='ooo2dbk',
+-        version='2.0',
++        version='2.1.0',
+         package_dir={'ooo2dbk': '.'},
+-        scripts=['ooo2dbk', 'ole2img.py'],
++        scripts=['ooo2dbk'],
+         data_files=[('/etc', ['ooo2dbk.xml',]),
+-                    ('/usr/share/xml/ooo2dbk', ['ooo2dbk-fo.xsl',
++                    ('/usr/share/xml/ooo2dbk', ['ole2img.py',
++                                                'ooo2dbk-fo.xsl',
+                                                 'docbook-psmi.xsl',
+                                                 'ooo2dbk.xsl',
+                                                 'ooo2dbk.odf.xsl']),
+                     ('/usr/share/doc/ooo2dbk', ['README.txt',
+-                                            'HISTORY',
+                                             'COPYING',
+-                                            'CHANGES',
+                                             'doc/ABOUT.txt',
+                                             'doc/howto-use_psmi.txt',
+-                                            'doc/ooo2dbk.1',
+                                             'doc/TODO.txt',
+                                             'ooo/templateOOo2dbk-fr.stw',
+                                             'ooo/templateOOo2dbk-en.stw',]),
+                     ]
+-        )
+\ No newline at end of file
++        )
+Index: ooo2dbk-2.1.0/setup.cfg
+===================================================================
+--- ooo2dbk-2.1.0.orig/setup.cfg	2007-07-18 01:34:24.000000000 +0200
++++ ooo2dbk-2.1.0/setup.cfg	2007-07-18 01:41:41.000000000 +0200
+@@ -1,2 +1,2 @@
+ [install]
+-install-scripts=/usr/local/bin
+\ No newline at end of file
++install-scripts=/usr/bin
--- ooo2dbk-2.1.0.orig/debian/copyright
+++ ooo2dbk-2.1.0/debian/copyright
@@ -1,23 +1,32 @@
 This package was debianized by Mohammed Adnène Trojette <adn+deb@diwi.org> on
 Fri,  7 Jan 2005 03:24:31 +0100.
 
+The current Debian maintainer is Mohammed Adnène Trojette
+<adn+deb@diwi.org>.
+
 It was downloaded from http://www.indesko.com/telechargements/
 
-OOo2DBK Copyright (c) 2004-2005 Nuxeo SARL <http://nuxeo.com>
+OOo2DBK Copyright (c) 2004-2006 Nuxeo SARL <http://nuxeo.com>
 
 Upstream Authors: M.-A. Darche (Nuxeo), Laurent Godard (Indesko),
          Ruslan Spivak (Nuxeo), Eric Bellot <ebellot@netcourrier.com>
 
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-License:
-
-      GNU LESSER GENERAL PUBLIC LICENSE
-           Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
+On Debian systems, the complete text of the GNU Lesser General Public
+License, can be found in /usr/share/common-licenses/LGPL.
 
-On Debian GNU/Linux systems, the complete text of the GNU Lesser General
-Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
+The current Debian packaging is (C) 2004-2006, Mohammed Adnène Trojette
+<adn+deb@diwi.org> and is licensed under the GPL, see above.
--- ooo2dbk-2.1.0.orig/debian/install
+++ ooo2dbk-2.1.0/debian/install
@@ -0,0 +1,2 @@
+debian/ooo2dbk/usr/local/bin/ole2img.py /usr/bin/
+debian/ooo2dbk/usr/local/bin/ooo2dbk /usr/bin/
