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

name                fatsort
version             1.6.5.640
revision            1
categories          sysutils
platforms           darwin freebsd linux
license             GPL-2+
maintainers         {ionic @Ionic}

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            http://fatsort.sourceforge.net/

depends_build       port:help2man
depends_lib         port:libiconv

master_sites        sourceforge:${name}
use_xz              yes
checksums           rmd160  4c41df05db01d73958598dfb0b0e6b88647152fe \
                    sha256  630ece56d9eb3a55524af0aec3aade7854360eba949172a6cfb4768cb8fbe42e \
                    size    131792

use_configure       no
variant universal   {}

patchfiles-append   sort.c.patch

# 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

build.type          gnu
build.env           "CFLAGS=${configure.cppflags} ${configure.cflags} [get_canonical_archflags cc]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"
build.args          CC=${configure.cc} \
                    LD=${configure.cc}

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

# 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\]*/
