[Python-apps-commits] r2913 - in packages/vitables/trunk/debian (4 files)

xnox-guest at users.alioth.debian.org xnox-guest at users.alioth.debian.org
Mon May 11 03:23:05 UTC 2009


    Date: Monday, May 11, 2009 @ 03:23:03
  Author: xnox-guest
Revision: 2913

Using distutils, intead of ugly make to build docs.

Added:
  packages/vitables/trunk/debian/patches/use_distutils_for_docs.patch
Modified:
  packages/vitables/trunk/debian/patches/remove_buildtime_dependency.patch
  packages/vitables/trunk/debian/patches/series
  packages/vitables/trunk/debian/rules

Modified: packages/vitables/trunk/debian/patches/remove_buildtime_dependency.patch
===================================================================
--- packages/vitables/trunk/debian/patches/remove_buildtime_dependency.patch	2009-05-10 22:37:40 UTC (rev 2912)
+++ packages/vitables/trunk/debian/patches/remove_buildtime_dependency.patch	2009-05-11 03:23:03 UTC (rev 2913)
@@ -1,9 +1,9 @@
 Don't check run-time required libraries at buildtime.
-Index: bvitables/setup.py
+Index: vitables-2.0+hg96+dfsg/setup.py
 ===================================================================
---- bvitables.orig/setup.py	2009-05-09 18:32:20.000000000 +0100
-+++ bvitables/setup.py	2009-05-09 18:34:12.000000000 +0100
-@@ -209,8 +209,8 @@
+--- vitables-2.0+hg96+dfsg.orig/setup.py	2009-05-11 04:09:18.000000000 +0100
++++ vitables-2.0+hg96+dfsg/setup.py	2009-05-11 04:14:38.000000000 +0100
+@@ -227,8 +227,8 @@
          helpAsked = True
          break
  

Modified: packages/vitables/trunk/debian/patches/series
===================================================================
--- packages/vitables/trunk/debian/patches/series	2009-05-10 22:37:40 UTC (rev 2912)
+++ packages/vitables/trunk/debian/patches/series	2009-05-11 03:23:03 UTC (rev 2913)
@@ -1,3 +1,4 @@
 desktop-file.patch
 remove_buildtime_dependency.patch
 
+use_distutils_for_docs.patch

Added: packages/vitables/trunk/debian/patches/use_distutils_for_docs.patch
===================================================================
--- packages/vitables/trunk/debian/patches/use_distutils_for_docs.patch	                        (rev 0)
+++ packages/vitables/trunk/debian/patches/use_distutils_for_docs.patch	2009-05-11 03:23:03 UTC (rev 2913)
@@ -0,0 +1,132 @@
+Index: vitables-2.0+hg96+dfsg/setup.py
+===================================================================
+--- vitables-2.0+hg96+dfsg.orig/setup.py	2009-05-11 04:16:22.000000000 +0100
++++ vitables-2.0+hg96+dfsg/setup.py	2009-05-11 04:20:47.000000000 +0100
+@@ -21,12 +21,85 @@
+ #----------------------------------------------------------------------
+ # Setup script for the vitables package
+ 
++
+ import sys
+ import os
+ import glob
++import shutil
+ 
+-from distutils.core import setup
++from distutils.core import setup, Command
++from distutils.command.build import build
++from distutils.command.install import install
+ from distutils.command.install_data import install_data
++from distutils.command.clean import clean
++from distutils.dist import Distribution
++from distutils.spawn import find_executable, spawn
++from distutils import dir_util
++
++class DocbookDistribution(Distribution):
++    def __init__(self, attrs=None):
++        self.docbooks = None
++        Distribution.__init__(self, attrs)
++
++class BuildDocbook(Command):
++    description = "Build Docbook documentation"
++
++    user_options = [('xsltproc-path=', None, "Path to the XSLT processor"),
++                    ('fop-path=', None, "Path to FOP"),
++                    ('xsl-style=', None, "Catalogue URI to the XSL style sheet"),
++                    ('fop-style=', None, "Catalogue URI for the FOP style sheet")]
++
++    def initialize_options(self):
++        self.xsltproc_path = None
++        self.fop_path = None
++        self.xsl_style = None
++        self.fop_style = None
++
++    def finalize_options(self):
++        if self.xsltproc_path is None:
++            self.xsltproc_path = find_executable("xsltproc")
++            if self.xsltproc_path is None:
++                raise SystemExit, "Unable to find 'xsltproc', needed to generate Docbook documentation."
++
++        if self.fop_path is None:
++            self.fop_path = find_executable("fop")
++            if self.fop_path is None:
++                raise SystemExit, "Unable to find 'fop', needed to generate Docbook HTML documentation."
++
++        if self.xsl_style is None:
++            self.xsl_style = "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"
++
++        if self.fop_style is None:
++            self.fop_style = "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"
++
++
++    def get_command_name(self):
++        return 'build_doc'
++
++    def run(self):
++        for input_file in self.distribution.docbooks:
++            self.announce("Building Docbook documentation from %s." % input_file)
++
++            if not os.path.exists(input_file):
++                raise SystemExit, "File %s is missing." % input_file
++
++            input_file_name = os.path.splitext(input_file)[0]
++            input_dir =os.path.dirname(input_file)
++            os.mkdir(os.path.join(input_dir,"html"))
++            spawn([self.xsltproc_path, "-o", os.path.join(input_dir, "html", ""), self.xsl_style, input_file])
++            spawn([self.xsltproc_path, "-o", input_file_name+".fo", self.fop_style, input_file])
++            spawn([self.fop_path, "-q", input_file_name+".fo", input_file_name+".pdf"])
++
++            shutil.copytree(os.path.join(input_dir,"images"),os.path.join(input_dir,"html","images"))
++
++
++def has_docbook(build):
++    return (build.distribution.docbooks is not None and
++            build.distribution.docbooks != [])
++
++class Build(build):
++    sub_commands = build.sub_commands[:]
++    sub_commands.append(('build_doc', has_docbook))
+ 
+ use_py2app = False
+ if sys.platform == 'darwin' and 'py2app' in sys.argv:
+@@ -267,7 +340,9 @@
+    ``macosxapp/make.sh`` script.)
+ """
+ 
+-setup(name = 'vitables', # The name of the distribution
++setup(
++    distclass=DocbookDistribution,
++    name='vitables', # The name of the distribution
+     version = "%s" % vt_version,
+     description = 'A viewer for pytables package',
+     long_description = \
+@@ -295,8 +370,18 @@
+     'vitables.preferences', 'vitables.plugins', 
+     'vitables.vtTables', 'vitables.vtWidgets'],
+     scripts = ['scripts/vitables'],
+-    cmdclass = {"install_data":smart_install_data},
++    cmdclass = {
++          "install_data":smart_install_data,
++          'build': Build,
++          'build_doc': BuildDocbook,
++          },
++    docbooks=[
++        'doc/usersguide.xml'
++    ],
+     data_files = [
++    ('doc', glob.glob('doc/*.pdf')),
++    ('doc/html', glob.glob('doc/html/*.html')),
++    ('doc/html/images', glob.glob('doc/html/images/*.png')),
+     ('examples', glob.glob('examples/*.h5')),
+     ('examples/arrays', glob.glob('examples/arrays/*.h5')),
+     ('examples/misc', glob.glob('examples/misc/*.h5')),
+@@ -304,9 +389,6 @@
+     ('examples/tables', glob.glob('examples/tables/*.h5')),
+     ('examples/tests', glob.glob('examples/tests/*.h5')),
+     ('examples/timeseries', glob.glob('examples/timeseries/*.h5')),
+-    ('doc', ['doc/usersguide.xml']),
+-    ('doc', glob.glob('doc/*.pdf')),
+-    ('doc/images', glob.glob('doc/images/*.png')),
+     ('', ['LICENSE.txt', 'LICENSE.html']),
+     ('', ['VERSION'])
+     ],

Modified: packages/vitables/trunk/debian/rules
===================================================================
--- packages/vitables/trunk/debian/rules	2009-05-10 22:37:40 UTC (rev 2912)
+++ packages/vitables/trunk/debian/rules	2009-05-11 03:23:03 UTC (rev 2913)
@@ -3,7 +3,6 @@
 	dh --with quilt $@
 
 override_dh_auto_build:
-	cd doc && make
 	pyrcc4 -o vitables/qrc_resources.py resources.qrc
 	pyuic4 -o vitables/queries/queryUI.py vitables/queries/query_dlg.ui
 	pyuic4 -o vitables/preferences/settingsUI.py vitables/preferences/settings_dlg.ui
@@ -38,7 +37,6 @@
 
 	wget http://hg.berlios.de/repos/vitables/archive/e80739d79701.tar.gz
 	tar xvf *.tar.gz
-	sed -i "3s/Makefile.*/*/" $(tmp_dir)/MANIFEST.in 
 	echo "include resources.qrc \nrecursive-include icons * \n\
 recursive-include vitables/queries *.ui\nrecursive-include vitables/preferences *.ui" \
 	>> $(tmp_dir)/MANIFEST.in




More information about the Python-apps-commits mailing list