summaryrefslogtreecommitdiff
path: root/macports/Portfile.in
blob: af7fada3e0fee27038fad5bb6773ccee88edfdcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# $Id$

PortSystem          1.0

name                pandoc
version             @VERSION@
categories          textproc
maintainers         jgm@berkeley.edu
description         General markup converter
long_description    \
    Pandoc is a command-line tool for converting from one markup format \
    to another.  It can read markdown and (subsets of) reStructuredText, \
    HTML, and LaTeX, and it can write markdown, reStructuredText, HTML, \
    LaTeX, ConTeXt, PDF, DocBook XML, OpenDocument XML, ODT, RTF, Texinfo, \
    MediaWiki markup, groff man, and S5 HTML slide shows.

homepage            http://johnmacfarlane.net/pandoc/
platforms           darwin
master_sites        http://pandoc.googlecode.com/files/
checksums           md5 @TARBALLMD5SUM@
depends_build       port:ghc port:haddock
depends_lib         port:gmp

use_configure       no
build.args          PREFIX=${prefix}
build.target        build-all

destroot            {
  # install pandoc executable, libraries, and library documentation:
  system "(cd ${worksrcpath}; ./setup copy --destdir=${destroot})"
  # strip the pandoc binary:
  system "strip ${destroot}${prefix}/bin/pandoc"
  # create scripts to register libraries in post-activate phase:
  system "(cd ${worksrcpath}; ./setup register --gen-script)"
  system "(cd ${worksrcpath}; ./setup unregister --gen-script)"
  # install register/unregister scripts:
  xinstall -d ${destroot}${prefix}/libexec/${name}-${version}
  xinstall -m 755 ${worksrcpath}/register.sh \
    ${destroot}${prefix}/libexec/${name}-${version}
  xinstall -m 755 ${worksrcpath}/unregister.sh \
    ${destroot}${prefix}/libexec/${name}-${version}
  # install shell scripts:
  xinstall -m 755 -W ${worksrcpath} html2markdown hsmarkdown \
    ${destroot}${prefix}/bin
  # install data file:
  xinstall -d ${destroot}${prefix}/share/${name}
  xinstall -m 644 -W ${worksrcpath} odt-styles/reference.odt \
    ${destroot}${prefix}/share/${name}
  # install user documentation and man pages:
  xinstall -d ${destroot}${prefix}/share/doc/${name}
  xinstall -m 644 -W ${worksrcpath} README README.html COPYRIGHT BUGS \
    ${destroot}${prefix}/share/doc/${name}
  xinstall -m 644 -W ${worksrcpath}/man/man1 pandoc.1 hsmarkdown.1 \
    html2markdown.1 \
    ${destroot}${prefix}/share/man/man1
}

post-activate       {
  # Register the library with the ghc package database:
  system "${prefix}/libexec/${name}-${version}/register.sh"
}

#pre-deactivate     {
#  system "${prefix}/libexec/${name}-${version}/unregister.sh"
#}