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

name                bsdiff
version             4.3
revision            2
categories          devel
license             BSD
maintainers         nomaintainer

description         Generates and applies patches to binary files
long_description    This is a pair of tools for building (bsdiff) and applying \
                    (bspatch) binary patches. When applied to two versions of \
                    the same executable the patches produced are significantly \
                    smaller than those generated by other binary diff tools \
                    (e.g. xdelta).

homepage            https://www.daemonology.net/bsdiff/
master_sites        debian:b/${name}
distname            ${name}_${version}.orig
worksrcdir          ${name}-${version}

checksums           rmd160  27bb255b5dd5aa56d3a076dac9ca76d238a79a04 \
                    sha256  18821588b2dc5bf159aa37d3bcb7b885d85ffd1e19f23a0c57a58723fea85f48 \
                    size    5740

depends_lib-append  port:bzip2

patch.pre_args-replace  -p0 -p1
patchfiles          20-CVE-2014-9862.patch \
                    30-bug-632585-mmap-src-file-instead-of-malloc-read-it.patch \
                    31-bug-632585-mmap-dst-file-instead-of-malloc-read-it.patch \
                    32-bug-632585-use-int32_t-instead-off_t-for-file-size.patch \
                    33-CVE-2020-14315.patch \
                    patch-bsdiff-map-populate.diff \
                    patch-bspatch.c.diff \
                    patch-Makefile.diff

makefile.has_destdir \
                    no

livecheck.type      regex
livecheck.regex     ${name}-(\[0-9.\]+)\\.tar
