Ticket #42678: Portfile

File Portfile, 3.7 KB (added by jul_bsd@…, 10 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: Portfile 111353 2013-09-19 07:21:56Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6PortGroup           github 1.0
7
8github.setup        ossec ossec-wui 0.8 v
9categories          security
10platforms           darwin
11maintainers         nomaintainer
12license             GPL-3
13description         host-based intrusion detection system Web user interface
14long_description    OSSEC is an Open Source Host-based Intrusion \
15                    Detection System that performs log analysis, \
16                    file integrity checking, policy monitoring, \
17                    rootkit detection, real-time alerting and \
18                    active response.
19homepage            http://www.ossec.net/
20
21depends_run-append port:ossec
22use_configure       no
23build {}
24set webroot         ${prefix}/www/ossec
25set ossecroot       ${prefix}/var/ossec
26
27destroot {
28
29    xinstall -d -m 755 ${destroot}${webroot}
30    foreach f [glob -directory ${worksrcpath} *] {
31        copy $f ${destroot}${webroot}
32    }
33    reinplace "s|/var/ossec|${ossecroot}|" ${destroot}${webroot}/ossec_conf.php
34
35    xinstall -d -m 755 ${destroot}${prefix}/share/examples/${name}/
36    copy ${filespath}/nginx-ossec.conf ${destroot}${prefix}/share/examples/${name}/nginx-ossec.conf.sample
37    reinplace "s|>/var/ossec|>${prefix}/var/ossec|g" \
38        ${destroot}${prefix}/share/examples/${name}/nginx-ossec.conf.sample
39   
40}
41post-activate {
42    if ![file exists ${prefix}/etc/nginx/nginx-ossec.conf] {
43        copy ${prefix}/share/examples/${name}/nginx-ossec.conf.sample ${prefix}/etc/nginx/nginx-ossec.conf
44    }
45}
46
47if {${subport} eq ${name}} {
48
49    checksums           rmd160  b6c4716c16f6520ecde478e0117715fe6502ee60 \
50                        sha256  1d578e780116e9d1c1931555a6cd1b4cb07de4546003671f05915a63eeffbdd3
51
52    conflicts           ${name}-devel
53
54    livecheck.type      regex
55    livecheck.url       ${homepage}/?page_id=19
56    livecheck.regex     "Web UI (\\d+\\.\\d+)"
57
58}
59
60subport ${name}-devel {
61
62    #fetch.type git
63    #git.url    https://github.com/ossec/ossec-wui
64    #git.branch 3d3b626875cbe239588b57f4b6e16cf3d08b64d7
65    ## 2014-02-19
66    version     20140219
67    distname    3d3b626875cbe239588b57f4b6e16cf3d08b64d7
68    checksums           rmd160  b6c4716c16f6520ecde478e0117715fe6502ee60 \
69                        sha256  1d578e780116e9d1c1931555a6cd1b4cb07de4546003671f05915a63eeffbdd3
70
71    conflicts  ${name}
72    livecheck.type      none
73
74}
75
76notes "
77Project is currently little maintained. So be prepared if you use in production.
78http://ossec-docs.readthedocs.org/en/latest/faq/ossec-wui.html
79OR ?OSSIM, ...
80http://ddpbsd.blogspot.ca/2011/10/3woo-you-got-your-ossec-in-my-logstash.html
81
82To finish install:
831) You will need a web server and PHP (not covered)
842) Do setup (equivalent of setup.sh which is Linux based)
85    w apache
86    # echo \"AuthUserFile ${webroot}/.htpasswd\" > ${webroot}/.htaccess
87    # cat ${webroot}/htaccess_def.txt >> ${webroot}/.htaccess
88    w nginx, add to ${prefix}/etc/nginx/nginx.conf and restart it
89    include nginx-ossec.conf
90    (in your server part)
91    w apache/nginx or other
92    # htpasswd -c ${webroot}/.htaccess youruser
93    # install -d -m 1777 ${webroot}/tmp
943) Add your web server user (apache, www-data or nobody) to the ossec group
95    # dseditgroup -o edit -a nobody -t user ossec
964) If you have a large ossec install, you may want to
97     re-configure PHP to support longer lasting scripts
98     and higher memory utilization. The following entries
99     on php.ini can be increased:
100
101     max_execution_time = 180
102     max_input_time = 180
103     memory_limit = 30M
104
105
1066) Try to access the UI.
107
108     http ://localhost/ossec/
109
110"