Ticket #44816: Portfile.2

File Portfile.2, 3.0 KB (added by a.schuster@…, 9 years ago)

complete Portfile for v3.3.0 for clarity

Line 
1# -*- 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$
3
4PortSystem              1.0
5PortGroup               github 1.0
6
7github.setup                    plusvic yara 3.3.0 v
8revision                0
9categories              security
10platforms               darwin
11license                 Apache-2.0
12maintainers             yendor.net:a.schuster \
13                        openmaintainer
14                       
15description             The pattern matching swiss knife for malware researchers
16long_description \
17    YARA is a tool aimed at helping malware researchers to identify and \
18    classify malware samples.
19
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}
62
63
64# specifics for python bindings
65
66set python.versions {26 27 31 32 33 34}
67
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    }
97}