Ticket #52376: usbutils.5.patch

File usbutils.5.patch, 3.8 KB (added by larryv (Lawrence Velázquez), 8 years ago)
  • net/usbutils/Portfile

    From 46c1e32cd9b99fe4b3e43cae4b49753cd0c98f25 Mon Sep 17 00:00:00 2001
    From: Leonardo Brondani Schenkel <leonardo@schenkel.net>
    Date: Sat, 26 Nov 2016 23:11:24 -0500
    Subject: [PATCH] usbutils: Move USB ID database into "usbids" port
    
    Also, update it to 2016.11.14.
    
    The database is updated frequently, but the one shipped in the usbutils
    tarball is from 2013. Splitting it out into its own port will let us
    keep it up to date independently of usbutils.
    
    Closes https://trac.macports.org/ticket/52376.
    ---
     net/usbutils/Portfile    |  3 ++-
     sysutils/usbids/Portfile | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
     2 files changed, 53 insertions(+), 1 deletion(-)
     create mode 100644 sysutils/usbids/Portfile
    
    diff --git a/net/usbutils/Portfile b/net/usbutils/Portfile
    index df8ad91..9165a65 100644
    a b PortSystem 1.0 
    55
    66name                usbutils
    77version             007
     8revision            1
    89categories          net
    910platforms           darwin
    1011maintainers         bwalle.de:bernhard
    checksums rmd160 b3b509ec7f9153402da4519aaedc141ecf064adf \ 
    2122depends_build       port:pkgconfig
    2223
    2324depends_lib         port:libusb \
     25                    port:usbids \
    2426                    port:zlib
    2527
    2628# Darwin linker has no "--as-needed"
    build.args AM_LDFLAGS="" 
    3032# ("lsusb" and the hardware database) manually
    3133destroot {
    3234    xinstall -m 0755 ${worksrcpath}/lsusb ${destroot}${prefix}/bin/lsusb
    33     xinstall -m 0644 ${worksrcpath}/usb.ids.gz ${destroot}${prefix}/share
    3435    xinstall -d ${destroot}${prefix}/share/man/man8
    3536    xinstall -m 0644 ${worksrcpath}/lsusb.8 ${destroot}${prefix}/share/man/man8
    3637
  • new file sysutils/usbids/Portfile

    diff --git a/sysutils/usbids/Portfile b/sysutils/usbids/Portfile
    new file mode 100644
    index 0000000..506d254
    - +  
     1# -*- 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
     2
     3PortSystem          1.0
     4
     5name                usbids
     6version             2016.11.14
     7categories          sysutils
     8platforms           darwin
     9license             {GPL-2+ BSD}
     10maintainers         schenkel.net:leonardo openmaintainer
     11
     12description         The USB ID Repository
     13long_description    This is a public repository of all known ID's used \
     14                    in USB devices: ID's of vendors, devices, \
     15                    subsystems and device classes. It is used in \
     16                    various programs (e.g., The USB Utilities) to \
     17                    display full human-readable names instead of \
     18                    cryptic numeric codes.
     19homepage            http://www.linux-usb.org/usb-ids.html
     20
     21master_sites        http://www.linux-usb.org
     22dist_subdir         ${name}/${version}
     23distname            usb.ids
     24extract.suffix      .gz
     25checksums           rmd160  78323e491c373ca7a8cfcc265588fcf80b44ec0f \
     26                    sha256  371d2bd09d34c1d36ab4b276a92c23686c29f38d67c6cdde31b6b1053b6cb10d
     27
     28# Just download and install the database.
     29extract.only
     30use_configure       no
     31build {}
     32destroot {
     33    xinstall -m 644 ${distpath}/[lindex ${distfiles} 0] \
     34        ${destroot}${prefix}/share
     35}
     36
     37# Remove after 2017-11-26.
     38pre-activate {
     39    if {![catch {lindex [registry_active usbutils] 0} installed]} {
     40        set _version [lindex $installed 1]
     41        set _revision [lindex $installed 2]
     42        if {[vercmp $_version 007] < 0
     43                || ([vercmp $_version 007] == 0 && $_revision < 1)} {
     44            registry_deactivate_composite usbutils {} {ports_nodepcheck true}
     45        }
     46    }
     47}
     48
     49livecheck.type      regex
     50livecheck.url       [lindex ${master_sites} 0]/usb.ids
     51livecheck.regex     {Version: (\d{4}\.\d{2}\.\d{2})}