# $Id: Portfile 59785 2009-10-22 07:56:42Z ryandesign@macports.org $

PortSystem              1.0

name                    pdfjam
version                 1.21
categories              textproc pdf
maintainers             vcn.com:jjstickel
license                 GPLv2
platforms               darwin
homepage                http://go.warwick.ac.uk/pdfjam
master_sites            ${homepage}
distname                ${name}_${version}
worksrcdir              ${name}
use_configure           no

description             A few PDF manipulation tools.

long_description \
    PDFjam is a small collection of shell scripts which provide a  \
    simple interface to some of the functionality of the excellent \
    pdfpages package (by Andreas Matthias) for pdfLaTeX.

checksums               md5     71d2d664777d32ec4154ab4c2e5965dc \
                        sha1    10396b02bae42e1731b8a0e52dbcbdc5ec4fdae9 \
                        rmd160  5c1c14f0d2e33c9536475863e33e69869b253cf9
		    
depends_run \
    path:bin/pdflatex:texlive

post-extract {
    reinplace "s|/usr/local/etc|${prefix}/etc|" ${worksrcpath}/scripts/pdf90
    reinplace "s|/usr/local/etc|${prefix}/etc|" ${worksrcpath}/scripts/pdfjoin
    reinplace "s|/usr/local/etc|${prefix}/etc|" ${worksrcpath}/scripts/pdfnup
    reinplace "s|/usr/local/etc|${prefix}/etc|" ${worksrcpath}/man1/pdf90.1
    reinplace "s|/usr/local/etc|${prefix}/etc|" ${worksrcpath}/man1/pdfjoin.1
    reinplace "s|/usr/local/etc|${prefix}/etc|" ${worksrcpath}/man1/pdfnup.1
    reinplace "s|/usr/local/etc|${prefix}/etc|" ${worksrcpath}/PDFjam-README.html
}

build {}

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/bin
    xinstall -m 755 -W ${worksrcpath}/scripts pdf90 pdfjoin pdfnup \
       ${destroot}${prefix}/bin
    xinstall -m 755 -d ${destroot}${prefix}/share/man/man1
    xinstall -m 644 -W ${worksrcpath}/man1 pdf90.1 pdfjoin.1 pdfnup.1 \
       ${destroot}${prefix}/share/man/man1
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} COPYING PDFjam-README.html VERSION \
       ${destroot}${prefix}/share/doc/${name}
}
