Ticket #44816: patch-yara-Portfile.diff

File patch-yara-Portfile.diff, 6.1 KB (added by jul_bsd@…, 9 years ago)
  • security/yara/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        pre-configure {
     33            if {${subport} ne "${name}1"} {
     34                system -W ${worksrcpath} "/bin/sh bootstrap.sh"
     35            }
     36        }
     37
     38        use_configure           yes
     39## Note: 2 lines, just to ensure correct build even when yara1 installed
     40##      (conflict seems to apply only on install, not build)(Not working)
     41    configure.cppflags-delete   "-I${prefix}/include"
     42    configure.cppflags-append   "-I./include -I${prefix}/include"
     43
     44        depends_build           port:automake \
     45                                port:libtool
     46       
     47        test.run                no
     48       
     49        variant cuckoo description {Add support for Cuckoo sandbox} {
     50                depends_lib-append                      port:jansson
     51                configure.args-append           --enable-cuckoo
     52        }
     53
     54        variant hash description {Add md5, sha1, and sha256 hash functions} {
     55                depends_lib-append                      port:openssl
     56                configure.args-append           --enable-hash \
     57                                                                        --with-crypto
     58        }
     59
     60        variant magic description {Add filetype detection by libmagic} {
     61                depends_lib-append                      port:libmagic
     62                configure.args-append           --enable-magic
     63        }       
     64       
     65        variant math description {Add entropy tests and other helper functions} {
     66                configure.args-append           --enable-math
     67        }
    2168
    22 checksums               rmd160  12ca8b2eb7a8b7de3fae8d97e728d4847299d99a \
    23                         sha256  fcee06a2f43ab65c88597de54d630a3beee925e7e84c890a8303f08a3fc85c91
     69    conflicts  ${name}-devel ${name}1 ${name}31
     70}
     71
     72
     73# specifics for python bindings
    2474
    25 depends_lib             port:pcre
     75set python.versions { 27 33 34}
    2676
    27 post-patch {
    28     # fix use of inline for clang compatibility
    29     reinplace "s|inline|static inline|g" ${worksrcpath}/libyara/scan.c
     77foreach v ${python.versions} {
     78        set python.version                      ${v}
     79        set python.branch                       [string range ${python.version} 0 end-1].[string index ${python.version} end]
     80        set python.bin                          ${prefix}/bin/python${python.branch}
     81    set python.prefix                   ${frameworks_dir}/Python.framework/Versions/${python.branch}
     82
     83    subport py${python.version}-${name} {
     84                categories              security python
     85                description             ${name} bindings for python ${python.branch}
     86                long_description                ${long_description}\
     87                        This subport provides bindings for python ${python.branch}.
     88               
     89                worksrcdir                              ${github.project}-${version}/yara-python
     90               
     91                depends_lib-append      port:${name} \
     92                                port:python${python.version}
     93
     94                use_configure                   no
     95                       
     96                build.cmd                               ${python.bin} setup.py --no-user-cfg
     97                build.target                    build
     98               
     99                destroot.cmd                    ${python.bin} setup.py --no-user-cfg
     100                destroot.destdir                --prefix=${python.prefix} --root=${destroot}
     101               
     102                test.run                                yes
     103                test.cmd                                ${python.bin}
     104                test.target                             tests.py
     105    }
    30106}
    31107
    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
     108#subport ${name}-devel {
     109#    conflicts  ${name} ${name}1
     110#
     111#    version             20150213
     112#    distname            4994a2cdff17e54b5e55507e494223abdca441dd
     113#       worksrcdir                      ${github.project}-${distname}
     114#
     115#    checksums           rmd160  8552997c163449e40e24ececfa33e1804536d2a4 \
     116#                        sha256  96547086306df8a793ec11e49e2c98ddbcc87cb8cf96e42a5344e1904896e56c
     117#
     118#       pre-configure {
     119#           if {${subport} ne "${name}1"} {
     120#               system -W ${worksrcpath} "/bin/sh bootstrap.sh"
     121#           }
     122#       }
     123#
     124#    livecheck.type      none
     125#}
     126
     127subport ${name}1 {
     128    conflicts  ${name} ${name}-devel
     129
     130    version             1.7
     131    license             GPL-2+
     132    master_sites        googlecode:yara-project
     133    distname            yara-${version}
     134    checksums           rmd160  12ca8b2eb7a8b7de3fae8d97e728d4847299d99a \
     135                        sha256  fcee06a2f43ab65c88597de54d630a3beee925e7e84c890a8303f08a3fc85c91
     136
     137    use_autoconf        no
     138    use_automake        no
     139    depends_lib-append  port:pcre
     140    depends_build-delete       port:libtool
     141    post-patch {
     142        # fix use of inline for clang compatibility
     143        reinplace "s|inline|static inline|g" ${worksrcpath}/libyara/scan.c
     144    }
     145
     146    variant re2 description "uses re2 library instead of pcre for regular expression parsing" {
     147        configure.args-append   --with-re2
     148        depends_lib-append      port:re2
     149        depends_lib-delete      port:pcre
     150    }
     151
     152    notes "
     153Yara 1 is End Of Life and not supported anymore. It's recommended to move to latest Yara.
     154"
     155
     156    livecheck.type          none
    36157}
     158