# -*- 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                usbutils
version             007
revision            1
categories          sysutils
platforms           darwin
license             GPL-2+
maintainers         nomaintainer

description         USB Device Utilities from Linux
long_description    Provides the famous 'lsusb' from Linux
homepage            http://linux-usb.sourceforge.net

master_sites        https://www.kernel.org/pub/linux/utils/usb/usbutils/
use_xz              yes
checksums           rmd160  b3b509ec7f9153402da4519aaedc141ecf064adf \
                    sha256  7593a01724bbc0fd9fe48e62bc721ceb61c76654f1d7b231b3c65f6dfbbaefa4 \
                    size    418264

depends_build       port:pkgconfig

depends_lib         path:lib/pkgconfig/libusb-1.0.pc:libusb \
                    port:zlib

depends_run         port:usbids

# Darwin linker has no "--as-needed"
build.args          AM_LDFLAGS=""

# since many usbutils programs only work on Linux, install the one we need
# ("lsusb" and the hardware database) manually
destroot {
    xinstall -m 0755 ${worksrcpath}/lsusb ${destroot}${prefix}/bin/lsusb
    xinstall -d ${destroot}${prefix}/share/man/man8
    xinstall -m 0644 ${worksrcpath}/lsusb.8 ${destroot}${prefix}/share/man/man8

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

# newer versions are Linux-specific
livecheck.type      none
