Ticket #47101: Portfile

File Portfile, 3.6 KB (added by jul_bsd@…, 9 years ago)
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
5
6PortGroup           github 1.0
7
8PortGroup           python 1.0
9
10github.setup        cuckoobox cuckoo 1.2
11categories          security
12maintainers         yahoo.fr:jul_bsd openmaintainer
13description         automated dynamic malware analysis system
14long_description    ${description}
15license             GPL-3
16platforms           darwin
17homepage            http://www.cuckoosandbox.org/
18
19checksums           rmd160  3f9445e4b9a17de04715965d6d0d1e67596f0976 \
20                    sha256  c60820bf50deddbba1f3ac1b1397689240a526cf6d35013bd045e3f7a05d785a
21
22## Note: requires ?
23#python.versions     27
24python.default_version     27
25
26add_users cuckoo group=cuckoo home=${prefix}/var/cuckoo shell=/sbin/nologin realname=cuckoo\ user
27
28
29depends_build        port:yara port:volatility port:libvirt-python
30
31## FIXME! need to do options: pefile, maec python bindings; note py-bson is integrated in py-pymongo
32if {${python.version} != ""} {
33    depends_build-append port:py${python.version}-sqlalchemy \
34                         port:py${python.version}-pymongo \
35                         port:py${python.version}-dpkt port:py${python.version}-jinja2 \
36                         \
37                         port:py${python.version}-magic port:py${python.version}-bottle \
38                         port:py${python.version}-chardet port:py${python.version}-deep \
39                         port:py${python.version}-pefile port:py${python.version}-maec
40}
41
42use_configure      no
43build {}
44
45destroot {
46    set rootdir ${prefix}/var/cuckoo
47   
48    xinstall -d -m 755 ${destroot}${rootdir}
49    xinstall -m 755 ${worksrcpath}/cuckoo.py ${destroot}${rootdir}/
50    foreach f { agent analyzer conf data docs lib modules tests utils web } {
51        copy ${worksrcpath}/${f} ${destroot}${rootdir}/
52    }
53
54    ## No install setup, doing our own tree
55    reinplace "s|/usr/bin/env python|${prefix}/bin/python2.7|g" ${destroot}${rootdir}/cuckoo.py
56}
57
58if {${subport} eq ${name}} {
59
60
61    conflicts ${name}-devel
62}
63
64notes "
65
66By default, Cuckoo will rely on Virtualbox as guest virtualization software.
67You will have to install separately through macports or manually.
68
69Cuckoo use tcpdump which needs root privilege.
70(???) Only option on MacOS is to put tcpdump binary as setuid
71    $ sudo chmod +s /usr/sbin/tcpdump
72
73
74To finish configuration,
75http://docs.cuckoosandbox.org/en/latest/
76
771) Setup Database: MongoDB (default) or Mysql
78      $ sudo port load mongodb
792) Check configuration files
803) Create a guest VM: WinXPsp3 is recommended, but Win7 with UAC
81disabled is supported too.
82Follow documentation how to prepare guest. It shout at least
83contains Python 2.7.
84Network should be host-only with some proper forwarding and
85filtering configuration.
86
87
88http://advancedmalwareprotection.blogspot.ca/2012/03/installing-cuckoo-on-max-os-x-lion.html
89http://blog.spiderlabs.com/2012/01/cuckoo-for-cuckoo-box.html
90"
91
92#subport ${name}-devel {
93#    master_sites        https://github.com/cuckoobox/cuckoo/archive/
94#    version             20150305
95#    distname            d34f13b06cc8f362e0cb76edccf8dafd2033f8f9
96#    checksums           rmd160  7bcc1267d1fb5fc11f679a282606bc088b438a05 \
97#                        sha256  ca4f7bea748340fc9ab092575de6c340ed75b159a49088b2cdafd4e531e6f9e1
98#
99#    conflicts ${name}
100#}
101
102default_variants  +django
103variant django description { use django + mongodb backend } {
104    #depends_run-append   port:mongodb port:py${python.version}-pymongo port:py${python.version}-django
105    depends_run-append   port:mongodb port:py${python.version}-django
106}
107