# -*- 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 87084 2011-11-10 01:54:40Z ryandesign@macports.org $

PortSystem          1.0

name                auto-multiple-choice
version             0.491
revision            2
categories          x11 tex education
platforms           darwin
license             GPL-2+
maintainers         univ-lyon1.fr:clot

description         Auto Multiple Choice - Multiple Choice Papers Management
long_description    Utility to manage multiple choice questionnaires, \
                    with optionnaly mixed questions and answers. \
                    AMC provides automatic marking from papers' scans. \
                    Annotated papers are produced. Marks can be exported \
                    as a OpenOffice.org sheet file.
homepage            http://home.gna.org/auto-qcm
master_sites        http://download.gna.org/auto-qcm/macports/
distfiles           ${name}_${version}_precomp${extract.suffix}

checksums           sha1    a2b31967407c04fc3d58c32ae364ee24abe08c93 \
                    rmd160  98aabf7a70823f1d2bb586d82803fe3bd40850e5

depends_lib         port:opencv
depends_run         port:p5.12-gtk2-gladexml \
                    port:p5.12-xml-simple \
                    port:p5.12-xml-writer \
                    port:p5.12-archive-zip \
                    port:p5.12-locale-gettext \
                    port:p5.12-digest-md5 \
                    port:p5.12-module-load-conditional \
                    port:GraphicsMagick \
                    port:p5.12-openoffice-oodoc \
                    port:p5.12-net-cups \
                    port:poppler \
                    port:netpbm \
                    port:librsvg

use_configure       no

build.args          AMCCONF=macports \
                    BASEPATH=${prefix} \
                    LATEX_FREE=1 \
                    GCC_PP="${configure.cc} ${configure.cc_archflags}"

destroot.args       AMCCONF=macports \
                    BASEPATH=${prefix}

variant latex description "Add LaTeX support" {
    depends_run-append  port:texlive-latex-extra \
                        port:texlive-latex-recommended

    build.args-delete   LATEX_FREE=1

    post-activate {
        system "${prefix}/bin/mktexlsr 2>&1"
    }

    post-deactivate {
        system "${prefix}/bin/mktexlsr 2>&1"
    }
}

default_variants    +latex
