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

PortSystem          1.0

name                bibutils
version             4.12
revision            1
categories          tex
maintainers         openmaintainer jochen
license             GPL
description         bibliography conversion utilities
long_description    The bibutils program set interconverts between various \
                    bibliography formats using a common MODS-format XML \
                    intermediate. For example, one can convert RIS-format files \
                    to Bibtex by doing two transformations: RIS->MODS->Bibtex. \
                    By using a common intermediate for N formats, only 2N \
                    programs are required and not N²-N. These programs operate \
                    on the command line and are styled after standard UNIX-like \
                    filters.

platforms           darwin
master_sites        http://www.scripps.edu/~cdputnam/software/bibutils/
homepage            ${master_sites}bibutils.html
distname            bibutils_${version}
extract.suffix      _src.tgz
checksums           md5     395f46393eca8e184652c5e8e1ae83b6 \
                    sha1    027be11cbad8261d0a6fc1056010480b23385ba2 \
                    rmd160  fdd162cdea2f6ea88f317dd246208e8e770f13f2

configure {
    file delete ${worksrcpath}/Makefile ${worksrcpath}/lib/Makefile ${worksrcpath}/bin/Makefile
    file copy ${worksrcpath}/bin/Makefile.static ${worksrcpath}/bin/Makefile
    file copy ${worksrcpath}/lib/Makefile.static ${worksrcpath}/lib/Makefile
    file copy ${worksrcpath}/Makefile_start ${worksrcpath}/Makefile
    if {[variant_isset "universal"]} {
        set CFLAGS "${configure.cflags} ${configure.universal_cflags}"
    } else {
        set CFLAGS "${configure.cflags} ${configure.cc_archflags}"
    }
    reinplace "s|REPLACE_CC|CC=\"${configure.cc} ${CFLAGS}\"|" ${worksrcpath}/Makefile
    reinplace "s|REPLACE_RANLIB|RANLIB=\"ranlib -s\"|" ${worksrcpath}/Makefile
    reinplace "s|REPLACE_INSTALLDIR|${destroot}${prefix}/bin|" ${worksrcpath}/Makefile
    reinplace "s|REPLACE_LIBINSTALLDIR|${destroot}${prefix}/lib|" ${worksrcpath}/Makefile
    reinplace "s|REPLACE_POSTFIX|_osx|" ${worksrcpath}/Makefile
}