# -*- 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
# $Id: Portfile 85469 2011-10-14 01:44:38Z dports@macports.org $

PortSystem              1.0

name                    epubcheck
version                 1.2
categories              textproc
platforms               darwin
license                 BSD 
maintainers             nomaintainer
supported_archs         noarch

description             ePub Validator to validate ePub documents

long_description        EpubCheck is a tool to validate IDPF  EPUB files. \
                        It can detect many types of errors in EPUB. OCF \
                        container structure, OPF and OPS mark-up, and \
                        internal reference consistency are checked.

homepage                http://code.google.com/p/epubcheck/
master_sites            googlecode

distname                ${name}-${version}

use_zip                 yes

checksums               sha1    86036eadad8408070791b3da368958239ed8a410 \
                        rmd160  a086609ba13ae36ec63759cf2f7f474b88c8ccdc

depends_run             bin:java:kaffe

extract.mkdir           yes

use_configure           no

build {}

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

    # install the template epubcheck script from files:
    
    xinstall ${filespath}/epubcheck.in ${destroot}${prefix}/bin/epubcheck
    
    # set the correct path to epubcheck.jar in the epubcheck script:
    
    reinplace "s|@@EPUBCHECK@@|${epubcheck}|g" \
        ${destroot}${prefix}/bin/epubcheck
        
    # install the epubcheck java files:
    
    xinstall -d ${destroot}${epubcheck}/lib
    
    xinstall ${worksrcpath}/${name}-${version}.jar ${destroot}${epubcheck}/${name}.jar
    eval xinstall [glob ${worksrcpath}/*.txt]  ${destroot}${epubcheck}
    eval xinstall [glob ${worksrcpath}/lib/*]  ${destroot}${epubcheck}/lib
}

