# -*- 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 # $Id$ PortSystem 1.0 PortGroup github 1.0 github.setup plusvic yara 3.4.0 v revision 1 categories security license GPL-2+ platforms darwin maintainers yendor.net:a.schuster \ openmaintainer description Malware identification and classification tool long_description \ YARA is a tool aimed at helping malware researchers to identify and \ classify malware samples. checksums rmd160 7453926c9deee005bda62dc252f37fe4bf769cd6 \ sha256 43a597a48b1a5b39ea43de016db697c8d77d652e21e12848f166d9afaec1c5b6 if {${subport} eq ${name}} { # https://github.com/plusvic/yara/pull/261 patchfiles patch-261.diff patch.pre_args -p1 depends_build port:autoconf \ port:automake \ port:libtool depends_lib port:libmagic \ port:jansson \ path:lib/libssl.dylib:openssl \ port:pcre pre-configure { system -W ${worksrcpath} "./bootstrap.sh" } # If yara 1.7 is installed, this build will fail since # /opt/local/include is before ./libyara/include # so swap CPPFLAGS and CFLAGS # Remove this upon the next release after verifying it is not needed. post-configure { reinplace "s|\$(CPPFLAGS) \$(AM_CFLAGS) \$(CFLAGS)|\$(CFLAGS) \$(AM_CFLAGS) \$(CPPFLAGS)|" ${worksrcpath}/Makefile reinplace "s|\$(DEFAULT_INCLUDES) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CPPFLAGS)|\$(DEFAULT_INCLUDES) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CFLAGS)|" ${worksrcpath}/Makefile reinplace "s|\t\$(AM_CFLAGS) \$(CFLAGS)|\t\$(AM_CFLAGS) \$(CPPFLAGS)|" ${worksrcpath}/Makefile } configure.cflags-append -std=gnu89 configure.args-append --with-crypto \ --enable-cuckoo \ --enable-magic \ } set python.versions {27 34 35} foreach v ${python.versions} { set python.version ${v} set python.branch [string range ${python.version} 0 end-1].[string index ${python.version} end] set python.bin ${prefix}/bin/python${python.branch} set python.prefix ${frameworks_dir}/Python.framework/Versions/${python.branch} subport py${python.version}-${name} { categories security python description ${name} bindings for python ${python.branch} long_description Malware identification and classification tool. \ This subport provides bindings for python ${python.branch} worksrcdir ${github.project}-${version}/yara-python depends_lib-append port:${name} \ port:python${python.version} use_configure no build.cmd ${python.bin} setup.py --no-user-cfg build.target build destroot.cmd ${python.bin} setup.py --no-user-cfg destroot.destdir --prefix=${python.prefix} --root=${destroot} test.run yes test.cmd ${python.bin} tests.py test.env PYTHONPATH=[glob -nocomplain ${worksrcpath}/build/lib*] test.target livecheck.type none } }