PortSystem      1.0

name            libcipher
version         4.7-RELEASE
revision        1
categories      devel
license         BSD
platforms       darwin
maintainers     nomaintainer
description     Cipher routines from FreeBSD
long_description    {*}${description}

homepage        https://svnweb.FreeBSD.org/base/release/4.7.0/secure/lib/libcipher/
master_sites    macports
use_bzip2       yes

checksums       md5 e322740002fc69c1e4e390ba461835d2 \
                sha1 16d5f31be00361b61f0f1b50a63cad1b31619462 \
                rmd160 5a619279536eb7258533cf477e10ce5eae1d1d7c

patchfiles      patch-Makefile.diff \
                patch-crypt.c.diff

worksrcdir      ${name}

use_configure   no

build.type      bsd
build.args      "LDADD=\"-install_name ${prefix}/lib/libcipher.1.dylib\"" \
                "CFLAGS=\"${configure.cflags}\""

destroot {
    xinstall ${worksrcpath}/libcipher.1.dylib \
        ${destroot}${prefix}/lib

    system "cd ${destroot}${prefix}/lib &&
        ln -s libcipher.1.dylib libcipher.dylib"

    xinstall -m 0444 ${worksrcpath}/cipher.3 ${destroot}${prefix}/share/man/man3

    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 ${worksrcpath}/README ${destroot}${docdir}
}

variant universal {
    build.args-append   "CFLAGS+=\"${configure.universal_cflags}\"" \
                        "LDADD+=\"${configure.universal_ldflags}\""
}