# -*- 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 71033 2010-08-30 08:28:04Z ryandesign@macports.org $

PortSystem          1.0

name                libinchi-1
version             1.03
set major           [lindex [split ${version} .] 0]
categories          devel science
platforms           darwin
maintainers         netatonce.net:petri openmaintainer

description         IUPAC InChI identifier generation library

long_description    IUPAC library for standard and non-standard \
                    International Chemical Identifier (InChI) non-proprietary \
                    identifiers for chemical substances.

homepage            http://www.iupac.org/inchi/
master_sites        ${homepage}download/version${version}/
dist_subdir         inchi-1

use_zip             yes
distname            INCHI-1-API
distfiles-append    INCHI-1-DOC.zip

checksums           INCHI-1-API.zip \
                    md5     7dd26285418528172326aa32f9a19ba3 \
                    sha1    9a9ac4b2f0a03638a97ffcd325b52c9992c777af \
                    rmd160  5a808be29e751c706b3ace7dfd8c1c7a0cdfb022 \
                    INCHI-1-DOC.zip \
                    md5     6a380e9b1ac8b963b66304e1c16a31bb \
                    sha1    4f2d2453573dd2ef22a70e190e9e2e90562959a7 \
                    rmd160  1390a48cd691a5b4d00cc74152ac4df6fb4e836b

use_configure       no

build.args          -CINCHI_API/gcc_so_makefile/ -f makefile
build.target        result/libinchi.so.${version}.00

patchfiles          patch-INCHI-1-API_INCHI_API_gcc_so_makefile-makefile.diff

destroot {
    xinstall -m 644 -W ${worksrcpath}/INCHI_API/gcc_so_makefile/result libinchi.so.${version}.00 libinchi.so.${major} ${destroot}${prefix}/lib/
    xinstall -m 644 ${worksrcpath}/INCHI_API/inchi_dll/inchi_api.h ${destroot}${prefix}/include/

    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${workpath}/INCHI-1-DOC \
        InChI_API_Reference.pdf \
        InChI_TechMan.pdf \
        InChI_UserGuide.pdf \
        RelNotes.pdf \
        readme.txt \
        ${docdir}
}
