Ticket #44816: Portfile-yara.diff

File Portfile-yara.diff, 4.1 KB (added by a.schuster@…, 9 years ago)

diff of Portfile for v3.3.0 against v1.7

  • Portfile

    old new  
    11# -*- 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
    2 # $Id: Portfile 105138 2013-04-11 21:29:42Z ryandesign@macports.org $
     2# $Id$
    33
    44PortSystem              1.0
     5PortGroup               github 1.0
    56
    6 name                    yara
    7 version                 1.7
     7github.setup                    plusvic yara 3.3.0 v
     8revision                0
    89categories              security
    9 license                 GPL-2+
    1010platforms               darwin
     11license                 Apache-2.0
    1112maintainers             yendor.net:a.schuster \
    1213                        openmaintainer
    1314                       
    14 description             Malware identification and classification tool
     15description             The pattern matching swiss knife for malware researchers
    1516long_description \
    1617    YARA is a tool aimed at helping malware researchers to identify and \
    1718    classify malware samples.
    1819
    19 homepage                http://code.google.com/p/yara-project/
    20 master_sites            googlecode:yara-project
     20homepage                http://${github.author}.github.io/${github.project}/
     21master_sites            https://github.com/${github.author}/${github.project}/archive/
     22distname                v${version}
     23checksums                               rmd160  330de9de9294953a3a42032ccc5ae849f065ab5e \
     24                        sha256  e5f4359082e35ff00ee94af9ee897bb0ab18abf49a2c4fe45968d7a848e5bd83
     25
     26# specifics for yara library and tools
     27
     28if {${subport} eq ${name}} {
     29
     30        worksrcdir                              ${github.project}-${version}
     31       
     32        use_configure           yes
     33        pre-configure {
     34                system -W ${worksrcpath} "/bin/sh bootstrap.sh"
     35        }
     36
     37        depends_build           port:automake \
     38                                port:libtool
     39       
     40        test.run                no
     41       
     42        variant cuckoo description {Add support for Cuckoo sandbox} {
     43                depends_lib-append                      port:jansson
     44                configure.args-append           --enable-cuckoo
     45        }
     46
     47        variant hash description {Add md5, sha1, and sha256 hash functions} {
     48                depends_lib-append                      port:openssl
     49                configure.args-append           --enable-hash \
     50                                                                        --with-crypto
     51        }
     52
     53        variant magic description {Add filetype detection by libmagic} {
     54                depends_lib-append                      port:libmagic
     55                configure.args-append           --enable-magic
     56        }       
     57       
     58        variant math description {Add entropy tests and other helper functions} {
     59                configure.args-append           --enable-math
     60        }
     61}
    2162
    22 checksums               rmd160  12ca8b2eb7a8b7de3fae8d97e728d4847299d99a \
    23                         sha256  fcee06a2f43ab65c88597de54d630a3beee925e7e84c890a8303f08a3fc85c91
    2463
    25 depends_lib             port:pcre
     64# specifics for python bindings
    2665
    27 post-patch {
    28     # fix use of inline for clang compatibility
    29     reinplace "s|inline|static inline|g" ${worksrcpath}/libyara/scan.c
    30 }
     66set python.versions {26 27 31 32 33 34}
    3167
    32 variant re2 description "uses re2 library instead of pcre for regular expression parsing" {
    33     configure.args-append   --with-re2
    34     depends_lib-append      port:re2
    35     depends_lib-delete      port:pcre
     68foreach v ${python.versions} {
     69        set python.version                      ${v}
     70        set python.branch                       [string range ${python.version} 0 end-1].[string index ${python.version} end]
     71        set python.bin                          ${prefix}/bin/python${python.branch}
     72    set python.prefix                   ${frameworks_dir}/Python.framework/Versions/${python.branch}
     73
     74    subport py${python.version}-${name} {
     75                categories              security python
     76                description             ${name} bindings for python ${python.branch}
     77                long_description                ${long_description}\
     78                        This subport provides bindings for python ${python.branch}.
     79               
     80                worksrcdir                              ${github.project}-${version}/yara-python
     81               
     82                depends_lib-append      port:${name} \
     83                                port:python${python.version}
     84
     85                use_configure                   no
     86                       
     87                build.cmd                               ${python.bin} setup.py --no-user-cfg
     88                build.target                    build
     89               
     90                destroot.cmd                    ${python.bin} setup.py --no-user-cfg
     91                destroot.destdir                --prefix=${python.prefix} --root=${destroot}
     92               
     93                test.run                                yes
     94                test.cmd                                ${python.bin}
     95                test.target                             tests.py
     96    }
    3697}