# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem              1.0

name                    daisydiff
version                 1.2
categories              textproc
platforms               darwin
license                 Apache-2
maintainers             nomaintainer
supported_archs         noarch

description             Daisy Diff compares HTML files.

long_description        Daisy Diff is a Java library that diffs (compares) \
                        HTML files. It highlights added and removed words \
                        and annotates changes to the styling.

homepage                https://code.google.com/p/daisydiff/
master_sites            googlecode

use_zip                 yes

checksums               rmd160  feb04a4bfd85a05a801c77753855c2bedaa4ed2e \
                        sha256  4eb8be8c4132560c97629d106194ae99cf191df0055ff5e35954b1b3bde6b432 \
                        size    1447051

depends_run             bin:java:kaffe

use_configure           no

build {}

destroot {

    # path to the daisydiff java files (without ${destroot}):
    
    set daisydiff ${prefix}/share/java/daisydiff

    # install the template daisydiff script from files:
    
    xinstall ${filespath}/daisydiff.in ${destroot}${prefix}/bin/daisydiff
    
    # set the correct path to daisydiff.jar in the daisydiff script:
    
    reinplace "s|@@DAISYDIFF@@|${daisydiff}|g" ${destroot}${prefix}/bin/daisydiff
    
    # install the daisydiff java files:
    
    xinstall -d ${destroot}${daisydiff}
    
    xinstall ${worksrcpath}/${name}.jar ${destroot}${daisydiff}
    copy ${worksrcpath}/css ${worksrcpath}/images ${destroot}${daisydiff}
    
    # install documentation files:
    
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        LICENSE.txt \
        NOTICE.txt \
        README.txt \
        ${docdir}
}

notes "\
Daisy Diff generates an HTML file as a report. The differences are highlighted\
by styling specified in a CSS file. Use the command line argument --css to\
specify this file. For example:

    daisydiff file1 file2 --css=${prefix}/share/java/daisydiff/css/diff.css
"
