# -*- 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                libmcrypt
version             2.5.8
revision            2
checksums           rmd160  4dba23286aa00d88a7f6763629bb3cde7dd2fe6b \
                    sha256  bf2f1671f44af88e66477db0982d5ecb5116a5c767b0a0d68acb34499d41b793 \
                    size    875425

categories          devel security
maintainers         {ryandesign @ryandesign} openmaintainer
license             GPL-2+ LGPL-2.1+
use_bzip2           yes

description         The encryption library used by mcrypt

long_description    libmcrypt is the library which implements all the \
                    algorithms and modes found in mcrypt.

homepage            https://mcrypt.sourceforge.net
master_sites        sourceforge:project/mcrypt/Libmcrypt/${version} \
                    freebsd

depends_build       port:automake

patchfiles          Makefile.in.patch \
                    configure.patch \
                    implicit.patch \
                    tripledes.c.patch

post-patch {
    # Use newer config.guess and config.sub to support Apple Silicon.
    set automake_dirs [glob -directory ${prefix}/share automake-*]
    set automake_dir [lindex [lsort -command vercmp $automake_dirs] end]
    copy -force ${automake_dir}/config.guess ${automake_dir}/config.sub \
        ${worksrcpath}
}

configure.args      --disable-posix-threads \
                    --mandir=${prefix}/share/man \
                    --enable-static

use_parallel_build  yes

livecheck.type      sourceforge
livecheck.distname  Libmcrypt