Mon Dec 12 11:33:28 2011 UTC ()
* apply patch for python<=2.5, taken from upstream.
* install manual page.

Bump PKGREVISION.


(obache)
diff -r1.5 -r1.6 pkgsrc/graphics/py-blockdiag/Makefile
diff -r1.5 -r1.6 pkgsrc/graphics/py-blockdiag/PLIST
diff -r1.5 -r1.6 pkgsrc/graphics/py-blockdiag/distinfo
diff -r0 -r1.1 pkgsrc/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_test__rst__directives.py
diff -r0 -r1.1 pkgsrc/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_test__utils__fontmap.py
diff -r0 -r1.1 pkgsrc/graphics/py-blockdiag/patches/patch-src_blockdiag_tests_utils.py

cvs diff -r1.5 -r1.6 pkgsrc/graphics/py-blockdiag/Makefile (expand / switch to unified diff)

--- pkgsrc/graphics/py-blockdiag/Makefile 2011/12/07 13:12:08 1.5
+++ pkgsrc/graphics/py-blockdiag/Makefile 2011/12/12 11:33:27 1.6
@@ -1,24 +1,31 @@ @@ -1,24 +1,31 @@
1# $NetBSD: Makefile,v 1.5 2011/12/07 13:12:08 obache Exp $ 1# $NetBSD: Makefile,v 1.6 2011/12/12 11:33:27 obache Exp $
2# 2#
3 3
4DISTNAME= blockdiag-1.1.1 4DISTNAME= blockdiag-1.1.1
5PKGNAME= ${PYPKGPREFIX}-${DISTNAME} 5PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
 6PKGREVISION= 1
6CATEGORIES= graphics 7CATEGORIES= graphics
7MASTER_SITES= http://pypi.python.org/packages/source/b/blockdiag/ 8MASTER_SITES= http://pypi.python.org/packages/source/b/blockdiag/
8 9
9MAINTAINER= obache@NetBSD.org 10MAINTAINER= obache@NetBSD.org
10HOMEPAGE= http://blockdiag.com/ 11HOMEPAGE= http://blockdiag.com/
11COMMENT= Generate block-diagram image file from spec-text file 12COMMENT= Generate block-diagram image file from spec-text file
12LICENSE= apache-2.0 13LICENSE= apache-2.0
13 14
14DEPENDS+= ${PYPKGPREFIX}-imaging>=1.1.7nb3:../../graphics/py-imaging 15DEPENDS+= ${PYPKGPREFIX}-imaging>=1.1.7nb3:../../graphics/py-imaging
15DEPENDS+= ${PYPKGPREFIX}-ordereddict-[0-9]*:../../devel/py-ordereddict 16DEPENDS+= ${PYPKGPREFIX}-ordereddict-[0-9]*:../../devel/py-ordereddict
16DEPENDS+= ${PYPKGPREFIX}-funcparserlib>=0.3.4:../../devel/py-funcparserlib 17DEPENDS+= ${PYPKGPREFIX}-funcparserlib>=0.3.4:../../devel/py-funcparserlib
17DEPENDS+= ${PYPKGPREFIX}-webcolors-[0-9]*:../../www/py-webcolors 18DEPENDS+= ${PYPKGPREFIX}-webcolors-[0-9]*:../../www/py-webcolors
18 19
19PKG_DESTDIR_SUPPORT= user-destdir 20PKG_DESTDIR_SUPPORT= user-destdir
20 21
21USE_LANGUAGES= # none 22USE_LANGUAGES= # none
22 23
 24INSTALLATION_DIRS+= ${PKGMANDIR}/man1
 25
 26post-install:
 27 ${INSTALL_MAN} ${WRKSRC}/blockdiag.1 \
 28 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
 29
23.include "../../lang/python/egg.mk" 30.include "../../lang/python/egg.mk"
24.include "../../mk/bsd.pkg.mk" 31.include "../../mk/bsd.pkg.mk"

cvs diff -r1.5 -r1.6 pkgsrc/graphics/py-blockdiag/PLIST (expand / switch to unified diff)

--- pkgsrc/graphics/py-blockdiag/PLIST 2011/12/07 13:12:08 1.5
+++ pkgsrc/graphics/py-blockdiag/PLIST 2011/12/12 11:33:27 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1@comment $NetBSD: PLIST,v 1.5 2011/12/07 13:12:08 obache Exp $ 1@comment $NetBSD: PLIST,v 1.6 2011/12/12 11:33:27 obache Exp $
2bin/blockdiag 2bin/blockdiag
3${PYSITELIB}/${EGG_INFODIR}/PKG-INFO 3${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
4${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt 4${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
5${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt 5${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
6${PYSITELIB}/${EGG_INFODIR}/entry_points.txt 6${PYSITELIB}/${EGG_INFODIR}/entry_points.txt
7${PYSITELIB}/${EGG_INFODIR}/requires.txt 7${PYSITELIB}/${EGG_INFODIR}/requires.txt
8${PYSITELIB}/${EGG_INFODIR}/top_level.txt 8${PYSITELIB}/${EGG_INFODIR}/top_level.txt
9${PYSITELIB}/blockdiag/DiagramDraw.py 9${PYSITELIB}/blockdiag/DiagramDraw.py
10${PYSITELIB}/blockdiag/DiagramDraw.pyc 10${PYSITELIB}/blockdiag/DiagramDraw.pyc
11${PYSITELIB}/blockdiag/DiagramDraw.pyo 11${PYSITELIB}/blockdiag/DiagramDraw.pyo
12${PYSITELIB}/blockdiag/DiagramMetrics.py 12${PYSITELIB}/blockdiag/DiagramMetrics.py
13${PYSITELIB}/blockdiag/DiagramMetrics.pyc 13${PYSITELIB}/blockdiag/DiagramMetrics.pyc
14${PYSITELIB}/blockdiag/DiagramMetrics.pyo 14${PYSITELIB}/blockdiag/DiagramMetrics.pyo
@@ -335,13 +335,14 @@ ${PYSITELIB}/blockdiag/utils/rst/__init_ @@ -335,13 +335,14 @@ ${PYSITELIB}/blockdiag/utils/rst/__init_
335${PYSITELIB}/blockdiag/utils/rst/__init__.pyo 335${PYSITELIB}/blockdiag/utils/rst/__init__.pyo
336${PYSITELIB}/blockdiag/utils/rst/directives.py 336${PYSITELIB}/blockdiag/utils/rst/directives.py
337${PYSITELIB}/blockdiag/utils/rst/directives.pyc 337${PYSITELIB}/blockdiag/utils/rst/directives.pyc
338${PYSITELIB}/blockdiag/utils/rst/directives.pyo 338${PYSITELIB}/blockdiag/utils/rst/directives.pyo
339${PYSITELIB}/blockdiag/utils/urlutil.py 339${PYSITELIB}/blockdiag/utils/urlutil.py
340${PYSITELIB}/blockdiag/utils/urlutil.pyc 340${PYSITELIB}/blockdiag/utils/urlutil.pyc
341${PYSITELIB}/blockdiag/utils/urlutil.pyo 341${PYSITELIB}/blockdiag/utils/urlutil.pyo
342${PYSITELIB}/blockdiag/utils/uuid.py 342${PYSITELIB}/blockdiag/utils/uuid.py
343${PYSITELIB}/blockdiag/utils/uuid.pyc 343${PYSITELIB}/blockdiag/utils/uuid.pyc
344${PYSITELIB}/blockdiag/utils/uuid.pyo 344${PYSITELIB}/blockdiag/utils/uuid.pyo
345${PYSITELIB}/blockdiag_sphinxhelper.py 345${PYSITELIB}/blockdiag_sphinxhelper.py
346${PYSITELIB}/blockdiag_sphinxhelper.pyc 346${PYSITELIB}/blockdiag_sphinxhelper.pyc
347${PYSITELIB}/blockdiag_sphinxhelper.pyo 347${PYSITELIB}/blockdiag_sphinxhelper.pyo
 348man/man1/blockdiag.1

cvs diff -r1.5 -r1.6 pkgsrc/graphics/py-blockdiag/distinfo (expand / switch to unified diff)

--- pkgsrc/graphics/py-blockdiag/distinfo 2011/12/07 13:12:08 1.5
+++ pkgsrc/graphics/py-blockdiag/distinfo 2011/12/12 11:33:27 1.6
@@ -1,5 +1,8 @@ @@ -1,5 +1,8 @@
1$NetBSD: distinfo,v 1.5 2011/12/07 13:12:08 obache Exp $ 1$NetBSD: distinfo,v 1.6 2011/12/12 11:33:27 obache Exp $
2 2
3SHA1 (blockdiag-1.1.1.tar.gz) = d5c2942019f7c837531e44dc7384225993ecd497 3SHA1 (blockdiag-1.1.1.tar.gz) = d5c2942019f7c837531e44dc7384225993ecd497
4RMD160 (blockdiag-1.1.1.tar.gz) = d2e8689ef092a24b6681753995b33709c871b8a0 4RMD160 (blockdiag-1.1.1.tar.gz) = d2e8689ef092a24b6681753995b33709c871b8a0
5Size (blockdiag-1.1.1.tar.gz) = 128625 bytes 5Size (blockdiag-1.1.1.tar.gz) = 128625 bytes
 6SHA1 (patch-src_blockdiag_tests_test__rst__directives.py) = 52c467a3223b42b651e8e9c93582c3b0f0c706d3
 7SHA1 (patch-src_blockdiag_tests_test__utils__fontmap.py) = 430e7322ebc8ac9080274a8bd888f1bf05e70570
 8SHA1 (patch-src_blockdiag_tests_utils.py) = bf965de7cd031c3729cd8d91ce9b006a52fe07b0

File Added: pkgsrc/graphics/py-blockdiag/patches/Attic/patch-src_blockdiag_tests_test__rst__directives.py
$NetBSD: patch-src_blockdiag_tests_test__rst__directives.py,v 1.1 2011/12/12 11:33:28 obache Exp $

* Fix testcase using 'with' statement are failed in python2.5 environment
  https://bitbucket.org/tk0miya/blockdiag/changeset/f078235db9b9

--- src/blockdiag/tests/test_rst_directives.py.orig	2011-11-21 02:41:13.000000000 +0000
+++ src/blockdiag/tests/test_rst_directives.py
@@ -5,7 +5,7 @@ import os
 import sys
 import tempfile
 import unittest2
-from utils import stderr_wrapper
+from utils import stderr_wrapper, assertRaises
 from docutils import nodes
 from docutils.core import publish_doctree
 from docutils.parsers.rst import directives as docutils
@@ -150,20 +150,20 @@ class TestRstDirectives(unittest2.TestCa
         self.assertFalse('target' in doctree[0])
 
     @use_tmpdir
+    @assertRaises(RuntimeError)
     def test_rst_directives_with_block_fontpath1(self, path):
-        with self.assertRaises(RuntimeError):
-            directives.setup(format='SVG', fontpath=['dummy.ttf'],
-                             outputdir=path)
-            text = ".. blockdiag::\n   :alt: hello world\n\n   { A -> B }"
-            doctree = publish_doctree(text)
+        directives.setup(format='SVG', fontpath=['dummy.ttf'],
+                         outputdir=path)
+        text = ".. blockdiag::\n   :alt: hello world\n\n   { A -> B }"
+        doctree = publish_doctree(text)
 
     @use_tmpdir
+    @assertRaises(RuntimeError)
     def test_rst_directives_with_block_fontpath2(self, path):
-        with self.assertRaises(RuntimeError):
-            directives.setup(format='SVG', fontpath='dummy.ttf',
-                             outputdir=path)
-            text = ".. blockdiag::\n   :alt: hello world\n\n   { A -> B }"
-            doctree = publish_doctree(text)
+        directives.setup(format='SVG', fontpath='dummy.ttf',
+                         outputdir=path)
+        text = ".. blockdiag::\n   :alt: hello world\n\n   { A -> B }"
+        doctree = publish_doctree(text)
 
     @use_tmpdir
     def test_rst_directives_with_block_maxwidth(self, path):

File Added: pkgsrc/graphics/py-blockdiag/patches/Attic/patch-src_blockdiag_tests_test__utils__fontmap.py
$NetBSD: patch-src_blockdiag_tests_test__utils__fontmap.py,v 1.1 2011/12/12 11:33:28 obache Exp $

* Fix testcase using 'with' statement are failed in python2.5 environment
  https://bitbucket.org/tk0miya/blockdiag/changeset/f078235db9b9

--- src/blockdiag/tests/test_utils_fontmap.py.orig	2011-11-21 02:38:58.000000000 +0000
+++ src/blockdiag/tests/test_utils_fontmap.py
@@ -3,7 +3,7 @@
 import os
 import sys
 import unittest2
-from utils import stderr_wrapper
+from utils import stderr_wrapper, assertRaises
 from cStringIO import StringIO
 from blockdiag.utils.collections import namedtuple
 from blockdiag.utils.fontmap import FontInfo, FontMap
@@ -31,33 +31,33 @@ class TestUtilsFontmap(unittest2.TestCas
         FontInfo("my-cursive", None, 11)
         FontInfo("-fantasy", None, 11)
 
+    @assertRaises(AttributeError)
     def test_fontinfo_invalid_familyname1(self):
-        with self.assertRaises(AttributeError):
-            FontInfo("unknown", None, 11)
+        FontInfo("unknown", None, 11)
 
+    @assertRaises(AttributeError)
     def test_fontinfo_invalid_familyname2(self):
-        with self.assertRaises(AttributeError):
-            FontInfo("sansserif-", None, 11)
+        FontInfo("sansserif-", None, 11)
 
+    @assertRaises(AttributeError)
     def test_fontinfo_invalid_familyname3(self):
-        with self.assertRaises(AttributeError):
-            FontInfo("monospace-unkown", None, 11)
+        FontInfo("monospace-unkown", None, 11)
 
+    @assertRaises(AttributeError)
     def test_fontinfo_invalid_familyname4(self):
-        with self.assertRaises(AttributeError):
-            FontInfo("cursive-bold-bold", None, 11)
+        FontInfo("cursive-bold-bold", None, 11)
 
+    @assertRaises(AttributeError)
     def test_fontinfo_invalid_familyname4(self):
-        with self.assertRaises(AttributeError):
-            FontInfo("SERIF", None, 11)
+        FontInfo("SERIF", None, 11)
 
+    @assertRaises(TypeError)
     def test_fontinfo_invalid_fontsize1(self):
-        with self.assertRaises(TypeError):
-            FontInfo("serif", None, None)
+        FontInfo("serif", None, None)
 
+    @assertRaises(ValueError)
     def test_fontinfo_invalid_fontsize2(self):
-        with self.assertRaises(ValueError):
-            FontInfo("serif", None, '')
+        FontInfo("serif", None, '')
 
     def test_fontinfo_parse(self):
         font = FontInfo("serif", None, 11)
@@ -212,15 +212,17 @@ class TestUtilsFontmap(unittest2.TestCas
         self.assertEqual(11, font1.size)
 
     def test_fontmap_duplicated_fontentry1(self):
-        _config = "[fontmap]\nsansserif: %s\nsansserif-normal: %s\n" % \
-                  (self.fontpath[0], self.fontpath[1])
-        config = StringIO(_config)
-        fmap = FontMap(config)
-
-        font1 = fmap.find()
-        self.assertEqual('sansserif', font1.generic_family)
-        self.assertEqual(self.fontpath[1], font1.path)
-        self.assertEqual(11, font1.size)
+        # this testcase is only for python2.6 or later
+        if sys.version_info > (2, 6):
+            _config = "[fontmap]\nsansserif: %s\nsansserif-normal: %s\n" % \
+                      (self.fontpath[0], self.fontpath[1])
+            config = StringIO(_config)
+            fmap = FontMap(config)
+
+            font1 = fmap.find()
+            self.assertEqual('sansserif', font1.generic_family)
+            self.assertEqual(self.fontpath[1], font1.path)
+            self.assertEqual(11, font1.size)
 
     @stderr_wrapper
     def test_fontmap_with_nodefault_fontentry(self):

File Added: pkgsrc/graphics/py-blockdiag/patches/Attic/patch-src_blockdiag_tests_utils.py
$NetBSD: patch-src_blockdiag_tests_utils.py,v 1.1 2011/12/12 11:33:28 obache Exp $

* Fix testcase using 'with' statement are failed in python2.5 environment
  https://bitbucket.org/tk0miya/blockdiag/changeset/f078235db9b9

--- src/blockdiag/tests/utils.py.orig	2011-11-13 08:30:10.000000000 +0000
+++ src/blockdiag/tests/utils.py
@@ -38,6 +38,24 @@ def stderr_wrapper(func):
     return wrap
 
 
+def assertRaises(exc):
+    def decorator(func):
+        def fn(self, *args, **kwargs):
+            try:
+                func(self, *args, **kwargs)
+            except exc:
+                pass
+            else:
+                msg = '%s does not raise exceptions: %s' % \
+                      (func.__name__, str(exc))
+                self.fail(msg)
+
+        fn.__name__ = func.__name__
+        return fn
+
+    return decorator
+
+
 def __build_diagram(filename):
     import os
     testdir = os.path.dirname(__file__)