# -*- 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

PortSystem          1.0
PortGroup           github 1.0

set uname           spydr
github.setup        frigaut yorick-${uname} 0.8.7 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
license             GPL-3+
categories          science yorick
platforms           any
maintainers         {thibaut @paumard} openmaintainer
supported_archs     noarch
description         FITS image display and simple analysis
long_description    Spydr (pronounced like spider) basically is an FITS \
                    image viewer. It can work as a stand-alone \
                    application but is best integrated in a \
                    Yorick-based data-analysis work-flow (Yorick is an \
                    interpreted language specialized in numerical \
                    computations and scientific graphics). It includes \
                    tools to zoom, produce cuts, histograms, \
                    Gaussian/Moffat fits, PSF fits (inc. FWHM and \
                    Strehl). Can work on single images, sequences of \
                    images or data cubes.
homepage            http://maumae.net/yorick/doc/plugins.php

checksums           rmd160  d5743d0576e9493f47951f26a190adee03991d92 \
                    sha256  1f4d662c35966d87916a238bb66d4f13319f39e109d72a879055a044fa32c087

depends_lib         path:bin/yorick:yorick

depends_run         port:yorick-yao \
                    port:py27-pygtk \
                    port:zenity

post-patch {
    reinplace "s|#!/usr/bin/env python2|#!${prefix}/bin/python2.7|" \
        ${worksrcpath}/${uname}.py
}

configure.cmd       ${prefix}/bin/yorick
configure.pre_args
configure.args      -batch make.i

build               {}

post-destroot {
    xinstall -d ${destroot}${prefix}/lib/yorick/packages/installed/
    xinstall -m 644 ${worksrcpath}/${uname}.info \
        ${destroot}${prefix}/lib/yorick/packages/installed/
    xinstall -m 644 ${worksrcpath}/${uname}.1 \
        ${destroot}${prefix}/share/man/man1/
    ln -s ${prefix}/lib/yorick/bin/${uname} ${destroot}${prefix}/bin/
}
