# -*- 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$
PortSystem      1.0

set instrument  iiinstrument
name            esopipe-${instrument}-recipes
conflicts       esopipe-${instrument}-recipes-devel
version         0.1.15
revision        2
categories      science
license         GPL-2+
platforms       darwin
maintainers     eso.org:usd-help
homepage        http://www.eso.org/sci/software/pipelines/
description     ESO example template instrument pipeline (recipe plugins)
long_description ESO data reduction pipeline recipe plugins for the example template instrument. \
                 See www.eso.org/pipelines for a description of the ESO pipeline systems. \
                 To execute these one needs to install a front-end such as esorex or Reflex.
master_sites    https://ftp.eso.org/pub/dfs/pipelines/instruments/${instrument}
distname        ${instrument}-kit-${version}-5
checksums       sha256 c38c91c1d0ee2ace0082c9d97ae9b47f5b3a03f4ada0b7272a9adb1bc7d9fbc9

worksrcdir          ${instrument}-${version}
extract.post_args   "| tar -xf - ${distname}/${instrument}-${version}.tar.gz"

post-extract {
    system "tar -xzf ${workpath}/${distname}/${instrument}-${version}.tar.gz -C ${workpath}"
    system "rm -rf ${workpath}/${distname}"
}

depends_build   port:pkgconfig
depends_lib     port:cpl port:curl port:erfa port:gsl

configure.args  --with-cpl=${prefix} --with-erfa=${prefix} --with-gsl=${prefix}

post-destroot {
    system "cd ${worksrcpath}/reflex && make DESTDIR=${destroot} uninstall"
    system "cd ${worksrcpath}/reports && make DESTDIR=${destroot} uninstall"
    system "cd ${worksrcpath}/workflows && make DESTDIR=${destroot} uninstall"
}

use_parallel_build  no

test.run            yes
test.target         installcheck
