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

name                fatsort
version             1.7.679
revision            0
categories          sysutils
license             GPL-2+
maintainers         {ionic @Ionic} openmaintainer

installs_libs       no

description         Utility to sort FAT12, FAT16 and FAT32 partitions
long_description    FATSort is a C utility that sorts FAT12, FAT16 and \
                    FAT32 partitions. It even can handle long file \
                    name entries. FATSort reads the boot sector and \
                    sorts the directory structure recursively.
homepage            https://fatsort.sourceforge.net/

depends_build-append \
                    port:help2man
depends_lib-append  port:libiconv

master_sites        sourceforge:${name}
use_xz              yes
checksums           rmd160  8c472c4819350e3b8457b0a1ec8c617d479ac0a3 \
                    sha256  1012f551382639d69e194eabfbe99342ede7c856b1cd6788287f9dfd4bd8d122 \
                    size    139700

# endianness.c:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘value’
# Old Xcode gcc does not understand these endianness macros.
compiler.blacklist-append \
                    *gcc-4.0 *gcc-4.2

destroot.args-append \
                    MANDIR=${prefix}/share/man/man1 \
                    SBINDIR=${prefix}/sbin

makefile.has_destdir \
                    no

post-destroot {
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 ${worksrcpath}/LICENSE.txt ${destroot}${prefix}/share/doc/${name}/
}

# OS X can't run the tests, but they could hypothetically run on
# any system with bbe, mkfs.vfat, and fsck.vfat.
test.run            yes
test.target         tests

livecheck.type      regex
livecheck.url       http://sourceforge.net/api/file/index/project-name/${name}/rss
livecheck.regex     /${name}/files/${name}-(\[a-zA-Z0-9.\]+\\.\[a-zA-Z0-9.\]+)\\.tar\\.?\[a-zA-Z\]*/
