# -*- coding: utf-8; mode: tcl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 117208 2014-02-19 11:22:40Z devans@macports.org $

PortSystem              1.0

name                    auto-multiple-choice
version                 1.2.1
revision                1
categories              x11 tex education
platforms               darwin
license                 GPL-2+
maintainers             laposte.fr:joel.brogniart openmaintainer

description             Auto Multiple Choice - Multiple Choice Papers Management
long_description        Utility to manage multiple choice questionnaires, \
                        with optionally mixed questions and answers. \
                        AMC provides automatic marking from papers' scans. \
                        Annotated papers are produced. Marks can be exported \
                        as an OpenOffice.org sheet file. \
                        \
                        This version can't print directly with CUPS. User should set \
                        "Printing method" to "file" or "command" in preferences. \
                        "file" method produce PDF files that could be printed from OS X.
                    
homepage                http://home.gna.org/auto-qcm
master_sites            http://download.gna.org/auto-qcm/macports/
distfiles               ${name}_${version}_precomp${extract.suffix}

checksums               sha256 534b1a9cd855532bd6c065a29e09dec2ba07c8ee155317e416260a9d5942420a \
                        rmd160 760b64682e583147b9a774233b10de68513353e3

depends_build-append    port:dblatex \
                        port:p5.16-xml-libxml
depends_lib             port:opencv
depends_run             port:p5.16-gtk2 \
                        port:p5.16-xml-simple \
                        port:p5.16-xml-writer \
                        port:p5.16-archive-zip \
                        port:p5.16-locale-gettext \
                        port:p5.16-digest-md5 \
                        port:p5.16-module-load-conditional \
                        port:p5.16-perlmagick \
                        port:p5.16-openoffice-oodoc \
                        port:p5.16-file-mimeinfo \
                        port:p5.16-dbd-sqlite \
                        port:p5.16-text-csv \
                        port:p5.16-file-basedir \
                        port:p5.16-email-mime \
                        port:p5.16-email-sender \
                        port:sqlite3 \
                        port:poppler \
                        port:netpbm \
                        port:librsvg \
                        port:gdk-pixbuf2

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 \
                        port:texlive-fonts-recommended \
                        port:texlive-xetex \
                        port:texlive-lang-french

  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

livecheck.type          regex
livecheck.url           [lindex ${master_sites} 0]
livecheck.regex         ${name}_(\[0-9.\]+)_
