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

PortSystem          1.0
PortGroup           github 1.0

github.setup        roland-bless ps2eps 1.70 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            2
categories          print
license             GPL-2+
maintainers         nomaintainer
homepage            http://ctan.org/pkg/ps2eps
description         PostScript to Encapsulated PostScript (EPS) conversion utility

long_description    ps2eps is a tool (written in Perl) to produce Encapsulated \
                    PostScript Files (EPS/EPSF) from usual one-paged PostScript \
                    documents. It calculates correct bounding boxes for those \
                    EPS files and filters some special PostScript command \
                    sequences that can produce erroneous results on printers. \
                    EPS files are often needed for including (scalable) graphics \
                    of high quality into TeX/LaTeX (or even Word) documents.

# not a real stealth update, but moving from CTAN to github, .zip , to .tar.gz
dist_subdir         ${name}/${version}_1

checksums           rmd160  e002a3a9241bde69acbbcace958d0f4095823f3f \
                    sha256  c5560dee6c2f5aafeb963f96bf6bee68c69e24783cb4044b0e7a9e0d48bddc11 \
                    size    100828

depends_run         port:ghostscript \
                    bin:perl:perl5

use_configure       no

variant universal   {}

build.cmd           ${configure.cc} {*}[get_canonical_archflags cc] src/C/bbox.c -o src/C/bbox

build.target

destroot {
    xinstall -m 755 ${worksrcpath}/src/C/bbox ${destroot}${prefix}/bin
    xinstall -m 755 ${worksrcpath}/src/perl/ps2eps ${destroot}${prefix}/bin
    xinstall -m 644 -W ${worksrcpath}/doc/ bbox.1 ps2eps.1 \
        ${destroot}${prefix}/share/man/man1/
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     "sion</td><td>(\[0-9.\]+)"
