PortSystem 1.0

name                cpio
version             2.12
revision            0
checksums           rmd160  156e7852db0f83e35fc02c007a1fb21e4a3393d6 \
                    sha256  70998c5816ace8407c8b101c9ba1ffd3ebbecba1f5031046893307580ec1296e

categories          archivers
platforms           darwin
maintainers         nomaintainer
license             GPL-3
description         copies files into or out of a cpio or tar archives
long_description    GNU cpio copies files into or out of a cpio or tar \
                    archive. The archive can be another file on the disk, a \
                    magnetic tape, or a pipe.

homepage            https://www.gnu.org/software/cpio/cpio.html
master_sites        gnu
use_bzip2           yes

depends_lib         port:gettext port:libiconv

patchfiles          cve-2016-2037.patch

configure.args      --program-prefix=gnu \
                    --mandir=${prefix}/share/man \
                    --infodir=${prefix}/share/info \
                    --libexecdir=${prefix}/lib/${name}

test.run            yes
test.target         check

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/libexec/gnubin
    ln -sf ${prefix}/bin/gnucpio ${destroot}${prefix}/libexec/gnubin/cpio
}

livecheck.type      regex
livecheck.url       http://ftp.gnu.org/gnu/cpio/?C=M&O=D
livecheck.regex     cpio-(\[0-9\]+\\.\[0-9\]+)