This patch updates textproc/markdown to 1.6b, the most recent stable
release. This release includes a test suite, which is enabled in
this patch with a few modifications (see patch-test-markdown_py).
Since the footnotes and RSS extensions are no longer distributed
(but still enabled in setup.py), I disable them in a new patch as
well (patch-setup_py).

Tested on -current/i386. Patch below and available via HTTP:
    
    http://www.lfod.us/files/ports/markdown-1.6b.diff

Thanks!

diffstat:
    5 files changed, 96 insertions(+), 13 deletions(-)
    Makefile                       |   14 ++++---
    distinfo                       |   10 ++---
    patches/patch-setup_py         |   11 ++++++
    patches/patch-test-markdown_py |   71 
++++++++++++++++++++++++++++++++++++++++
    pkg/PLIST                      |    3 -

-- 

o--------------------------{ Will Maier }--------------------------o
| web:.......http://www.lfod.us/ | [EMAIL PROTECTED] |
*------------------[ BSD Unix: Live Free or Die ]------------------*

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,9 @@
 
 COMMENT=       text-to-HTML conversion tool
 
-DISTNAME=      markdown-1.6a
-PKGNAME=       ${DISTNAME}p0
+V=             1.6b
+DISTNAME=      markdown-${V}
+PKGNAME=       ${DISTNAME}
 CATEGORIES=    textproc
 
 HOMEPAGE=      http://www.freewisdom.org/projects/python-markdown/
@@ -21,9 +22,7 @@ MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=python-markdown/}
 EXTRACT_SUFX=  .zip
 
-WRKDIST=       ${WRKDIR}/markdown-1.6
-
-NO_REGRESS=    Yes
+WRKDIST=       ${WRKDIR}/markdown-${V}
 
 pre-build:
        @sed -e "1s|%MODPY_BIN%|${MODPY_BIN}|" ${FILESDIR}/markdown > \
@@ -32,6 +31,9 @@ post-install:
 post-install:
        ${INSTALL_SCRIPT} ${WRKSRC}/markdown ${PREFIX}/bin/markdown
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/markdown
-       ${INSTALL_DATA} ${WRKSRC}/mdx_*py ${PREFIX}/share/examples/markdown/
+
+do-regress:
+       @cd ${WRKDIST} && ${MODPY_BIN} test-markdown.py
+
 
 .include <bsd.port.mk>
diff --git a/distinfo b/distinfo
--- a/distinfo
+++ b/distinfo
@@ -1,5 +1,5 @@ MD5 (markdown-1.6a.zip) = IbWIL3YmT4Swxu
-MD5 (markdown-1.6a.zip) = IbWIL3YmT4Swxu31TKONLQ==
-RMD160 (markdown-1.6a.zip) = Yxgn/EwV+oJA5zjPspnPnB1nRno=
-SHA1 (markdown-1.6a.zip) = D9l3QDnX0HOL/f3OkiF6TFuZoQk=
-SHA256 (markdown-1.6a.zip) = +/NJuNTkWU7qUMkxJ1Q3DGnY31rnr0tvXYV9F/hxIXs=
-SIZE (markdown-1.6a.zip) = 25236
+MD5 (markdown-1.6b.zip) = h8GaXcx3ApvQFdjt5j4NCw==
+RMD160 (markdown-1.6b.zip) = tOBaR5XMxzutbhO5scnn+m1LIbQ=
+SHA1 (markdown-1.6b.zip) = 0AAjrwkoGwPU98e/omi2ehju6aM=
+SHA256 (markdown-1.6b.zip) = FckzuopmsfsxdteSpHPRZ8xCL123HMu9Aj6A6iAYGeQ=
+SIZE (markdown-1.6b.zip) = 214972
diff --git a/patches/patch-setup_py b/patches/patch-setup_py
new file mode 100644
--- /dev/null
+++ b/patches/patch-setup_py
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- setup.py.orig      Mon Nov 19 14:20:16 2007
++++ setup.py   Mon Nov 19 14:20:20 2007
+@@ -8,6 +8,6 @@ setup(
+     maintainer = "Yuri Takhteyev",
+     maintainer_email = "yuri [at] freewisdom.org",
+     url = "http://www.freewisdom.org/projects/python-markdown";,
+-    py_modules = ["markdown","mdx_footnotes", "mdx_rss"],
++    py_modules = ["markdown",],
+ 
+     ) 
diff --git a/patches/patch-test-markdown_py b/patches/patch-test-markdown_py
new file mode 100644
--- /dev/null
+++ b/patches/patch-test-markdown_py
@@ -0,0 +1,71 @@
+$OpenBSD$
+--- test-markdown.py.orig      Sat Aug 18 15:24:21 2007
++++ test-markdown.py   Fri Nov 30 19:49:38 2007
+@@ -212,9 +212,9 @@ def testDirectory(dir, measure_time = False) :
+     d = difflib.Differ()
+     hd = difflib.HtmlDiff()
+ 
+-    htmlDiffFilePath = os.path.join(TMP_DIR, os.path.split(dir)[-1]) + ".html"
+-    htmlDiffFile = codecs.open(htmlDiffFilePath, "w", encoding=encoding)
+-    htmlDiffFile.write(DIFF_FILE_TEMPLATE)
++    #htmlDiffFilePath = os.path.join(TMP_DIR, os.path.split(dir)[-1]) + 
".html"
++    #htmlDiffFile = codecs.open(htmlDiffFilePath, "w", encoding=encoding)
++    #htmlDiffFile.write(DIFF_FILE_TEMPLATE)
+ 
+     diffsBuffer = ""
+ 
+@@ -222,7 +222,7 @@ def testDirectory(dir, measure_time = False) :
+ 
+         print "--- %s ---" % test
+ 
+-        htmlDiffFile.write("<tr><td>%s</td>" % test)
++        #htmlDiffFile.write("<tr><td>%s</td>" % test)
+ 
+         input_file = os.path.join(dir, test + ".txt")
+         output_file = os.path.join(dir, test + ".html")
+@@ -260,12 +260,13 @@ def testDirectory(dir, measure_time = False) :
+ 
+         if not diff:
+ 
+-            htmlDiffFile.write("<td class='ok'>OK</td>")
++            print 'OK'
++            #htmlDiffFile.write("<td class='ok'>OK</td>")
+ 
+         else :
+ 
+-            htmlDiffFile.write("<td class='failed'>" +
+-                               "<a href='#diff-%s'>FAILED</a></td>" % test)
++            #htmlDiffFile.write("<td class='failed'>" +
++            #                   "<a href='#diff-%s'>FAILED</a></td>" % test)
+             
+             print "MISMATCH on %s/%s.txt" % (dir, test)
+             print
+@@ -283,20 +284,20 @@ def testDirectory(dir, measure_time = False) :
+ 
+         expected_time, expected_mem = saved_benchmarks.get(test, ("na", "na"))
+ 
+-        htmlDiffFile.write(get_benchmark_html(conversion_time, expected_time))
+-        htmlDiffFile.write(get_benchmark_html(conversion_mem, expected_mem))
+-        htmlDiffFile.write("</tr>\n")
++        #htmlDiffFile.write(get_benchmark_html(conversion_time, 
expected_time))
++        #htmlDiffFile.write(get_benchmark_html(conversion_mem, expected_mem))
++        #htmlDiffFile.write("</tr>\n")
+ 
+             
+         benchmark_buffer += "%s:%f:%f\n" % (test,
+                                             conversion_time, conversion_mem)
+ 
+-    htmlDiffFile.write("</table>")
++    #htmlDiffFile.write("</table>")
+ 
+-    htmlDiffFile.write(diffsBuffer.decode("utf8"))
+-    htmlDiffFile.write(FOOTER)
+-    htmlDiffFile.close()
+-    print "Diff written to %s" % htmlDiffFilePath
++    #htmlDiffFile.write(diffsBuffer.decode("utf8"))
++    #htmlDiffFile.write(FOOTER)
++    #htmlDiffFile.close()
++    #print "Diff written to %s" % htmlDiffFilePath
+ 
+     benchmark_output_file_name = benchmark_file_name
+ 
diff --git a/pkg/PLIST b/pkg/PLIST
--- a/pkg/PLIST
+++ b/pkg/PLIST
@@ -1,7 +1,6 @@
 @comment $OpenBSD: PLIST,v 1.2 2006/10/14 12:04:11 alek Exp $
 bin/markdown
+lib/python${MODPY_VERSION}/site-packages/markdown-1.6b-py${MODPY_VERSION}.egg-info
 lib/python${MODPY_VERSION}/site-packages/markdown.py
 lib/python${MODPY_VERSION}/site-packages/markdown.pyc
 share/examples/markdown/
-share/examples/markdown/mdx_footnotes.py
-share/examples/markdown/mdx_rss.py

Reply via email to