# -*- 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                pcal
version             4.11.0
categories          print
license             Unknown
maintainers         {khindenburg @kurthindenburg} openmaintainer
description         PostScript calendar program
long_description    "Pcal" is a program to print PostScript calendars for any \
                    month and year.  By default, it looks for a file in the \
                    home directory named "calendar" for entries with leading \
                    dates matching dates on the calendar, and prints any \
                    following text under the appropriate day.

homepage            http://pcal.sourceforge.net/
master_sites        sourceforge
extract.suffix      .tgz

checksums           rmd160  f2c6d061ff0abbb01c33b8d7617f3e1c03e967c5 \
                    sha256  8406190e7912082719262b71b63ee31a98face49aa52297db96cc0c970f8d207

patchfiles          Makefile.patch

configure           {
    reinplace "s|BINDIR = .*|BINDIR = ${destroot}${prefix}/bin|" \
              "${worksrcpath}/Makefile"
    reinplace "s|MANDIR = .*|MANDIR = ${destroot}${prefix}/share/man/man1|" \
              "${worksrcpath}/Makefile"
    reinplace "s|CATDIR = .*|CATDIR = ${destroot}${prefix}/share/cat/cat1|" \
              "${worksrcpath}/Makefile"
}

variant universal {}

build.type          gnu
build.target
build.env           CC=${configure.cc} \
                    "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"

variant a4 description {Use A4 size paper as the default} {
    post-configure {
        reinplace "s|D_BUILD_ENV)|D_BUILD_ENV) -DA4PAPER|" \
                  "${worksrcpath}/Makefile"
    }
}

destroot.destdir    prefix=${destroot}${prefix}

livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}
