# $Id: Portfile 78852 2011-05-24 13:24:08Z ryandesign@macports.org $

PortSystem          1.0

name                multimarkdown
set git_name        peg-${name}
set git_author      fletcher
version             3.0b11
revision            3
categories          textproc
license             GPL-2+ MIT
maintainers         singingwolfboy openmaintainer
description         turn minimally marked-up plain text into well formatted documents
long_description    \
    MultiMarkdown, or MMD, is a tool to help turn minimally marked-up plain \
    text into well formatted documents, including HTML, PDF (by way of \
    LaTeX), OPML, or OpenDocument. MMD is a superset of the Markdown syntax, \
    originally created by John Gruber. It adds multiple syntax features \
    (tables, footnotes, and citations, to name a few), in addition to the \
    various output formats listed above (Markdown only creates HTML). \
    Additionally, it builds in “smart” typography for various languages \
    (proper left- and right-sided quotes, for example).

homepage            http://fletcherpenney.net/multimarkdown/
platforms           darwin
#master_sites        https://github.com/${git_author}/${git_name}/tarball/${version}
#distname            ${git_author}-${git_name}-${version}-0-g92e0466
#worksrcdir          ${git_author}-${git_name}-8486af4
#checksums           md5     7814325404daa9b570b4506f8302c034 \
#                    sha1    42f6882bb55092c2b89aae124ac54a70dd0215d7 \
#                    rmd160  5c2b3f58b99196dd78128de25aef94fc2f7001e5

fetch.type          git
git.url             https://github.com/${git_author}/${git_name}
git.branch          ${version}
configure {
    system "cd ${worksrcpath} && git submodule init"
    reinplace "s|git@github.com:|https://github.com/|" ${worksrcpath}/.git/config
    system "cd ${worksrcpath} && git submodule update"
}

variant universal {}
if {[variant_isset universal]} {
    set archflags ${configure.universal_cflags}
} else {
    set archflags ${configure.cc_archflags}
}
build.args          CC="${configure.cc} ${archflags}"

#use_configure       no
# "make docs" builds multimarkdown as a dependency
build.target        docs

destroot {
    xinstall ${worksrcpath}/${name} ${destroot}${prefix}/bin/

    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        README.markdown manual.txt manual.html \
        ${docdir}
}

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 port:gettext
depends_build       port:pkgconfig
