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

github.setup            samtools samtools 0.1.20
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
name                    samtools-0.1
categories              science
maintainers             {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
license                 MIT

description             compatibility version of Samtools
long_description        {*}${description}

checksums               rmd160  08e8bc2c21f6da50c22356d5cce07738d04a632e \
                        sha256  5fd7f8efad62bf73373c4634109e9570e6e2ddfbab5b885e4b636be4992ce2c5 \
                        size    566475

homepage                https://www.htslib.org/

patchfiles              patch-Makefile.diff

depends_lib             port:ncurses \
                        port:zlib

configure.cmd           printenv
configure.pre_args
configure.universal_args
configure.post_args     {>> Makefile.macports.inc}

configure.env-append    PREFIX=${prefix}

build.target-append     libbam.1.dylib-local

destroot {
    xinstall -m 0755 ${worksrcpath}/samtools       ${destroot}${prefix}/bin/samtools_0.1
    xinstall -m 0644 ${worksrcpath}/libbam.a       ${destroot}${prefix}/lib/libbam.1.a
    xinstall -m 0755 ${worksrcpath}/libbam.1.dylib ${destroot}${prefix}/lib/libbam.1.dylib
    xinstall -d      ${destroot}${prefix}/include/bam-0.1
    xinstall -m 0644 {*}[glob ${worksrcpath}/*.h]  ${destroot}${prefix}/include/bam-0.1

    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS COPYING NEWS \
        ${destroot}${prefix}/share/doc/${name}
}

livecheck.type          none
