1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | name mod_security2 |
---|
6 | version 2.6.0 |
---|
7 | categories www security |
---|
8 | platforms darwin |
---|
9 | maintainers mathiesen.info:macintosh pixilla |
---|
10 | description Apache 2 intrusion detection and prevention engine for web applications |
---|
11 | long_description ModSecurity is an open source intrusion detection and \ |
---|
12 | prevention engine for web applications. It operates \ |
---|
13 | embedded into the web server, acting as a powerful \ |
---|
14 | umbrella - shielding applications from attacks. |
---|
15 | homepage http://www.modsecurity.org |
---|
16 | master_sites sourceforge:mod-security |
---|
17 | distname modsecurity-apache_${version} |
---|
18 | worksrcdir ${distname} |
---|
19 | |
---|
20 | set apachever apache2 |
---|
21 | set confFile ${prefix}/${apachever}/conf/extra/httpd-modsecurity2.conf |
---|
22 | |
---|
23 | checksums sha1 280061a6cb49c955d7371b9526193f68a12ae2ac \ |
---|
24 | rmd160 a9d34e17d80007f394087da5bd92c6047f48d343 |
---|
25 | |
---|
26 | depends_build port:libxml2 \ |
---|
27 | port:pcre \ |
---|
28 | port:curl \ |
---|
29 | port:apr \ |
---|
30 | port:apr-util \ |
---|
31 | port:lua |
---|
32 | depends_lib port:${apachever} |
---|
33 | |
---|
34 | configure.args --with-apxs=${prefix}/${apachever}/bin/apxs \ |
---|
35 | --with-pcre=${prefix}/bin/pcre-config \ |
---|
36 | --with-apr=${prefix}/bin/apr-1-config \ |
---|
37 | --with-apu=${prefix}/bin/apu-1-config \ |
---|
38 | --with-curl=${prefix}/bin/curl-config \ |
---|
39 | --with-libxml=${prefix} \ |
---|
40 | --with-lua=${prefix} |
---|
41 | |
---|
42 | destroot.violate_mtree yes |
---|
43 | |
---|
44 | post-destroot { |
---|
45 | xinstall -d -m 755 ${destroot}${prefix}/${apachever}/modules |
---|
46 | xinstall -m 644 -W ${worksrcpath}/apache2/.libs mod_security2.so \ |
---|
47 | ${destroot}${prefix}/${apachever}/modules |
---|
48 | xinstall -m 755 -W ${worksrcpath}/mlogc mlogc mlogc-batch-load.pl \ |
---|
49 | ${destroot}${prefix}/bin |
---|
50 | xinstall -m 755 -W ${worksrcpath}/tools rules-updater.pl \ |
---|
51 | ${destroot}${prefix}/bin |
---|
52 | xinstall -m 755 -W ${worksrcpath}/mlogc mlogc-default.conf \ |
---|
53 | ${destroot}${prefix}/etc |
---|
54 | |
---|
55 | xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name} |
---|
56 | xinstall -m 644 -W ${worksrcpath} CHANGES LICENSE NOTICE README.TXT \ |
---|
57 | modsecurity.conf-recommended \ |
---|
58 | ${destroot}${prefix}/share/doc/${name} |
---|
59 | xinstall -m 644 -W ${worksrcpath}/ext README \ |
---|
60 | ${destroot}${prefix}/share/doc/${name} |
---|
61 | xinstall -m 644 [glob ${worksrcpath}/doc/*] \ |
---|
62 | ${destroot}${prefix}/share/doc/${name} |
---|
63 | |
---|
64 | if { ![ file exists ${prefix}/${apachever}/conf/extra/httpd-modsecurity2.conf ] } { |
---|
65 | set xmllib [ exec find ${prefix}/lib -type f -iname "libxml2*.dylib" ] |
---|
66 | set lualib [ exec find ${prefix}/lib -type f -iname "liblua*.dylib" ] |
---|
67 | |
---|
68 | exec sed -n -E -e "1,/default rule-set/p" \ |
---|
69 | ${filespath}/httpd-modsecurity2.conf > ${confFile} |
---|
70 | exec cat ${worksrcpath}/modsecurity.conf-recommended >> ${confFile} |
---|
71 | exec sed -n -E -e "/default rule-set/,/IfDefine/p" | sed -E -e "1,1d" \ |
---|
72 | ${filespath}/httpd-modsecurity2.conf >> ${confFile} |
---|
73 | |
---|
74 | reinplace "s|XMLLIB|${xmllib}|" ${prefix}/${apachever}/conf/extra/httpd-modsecurity2.conf |
---|
75 | reinplace "s|LUALIB|${lualib}|" ${prefix}/${apachever}/conf/extra/httpd-modsecurity2.conf |
---|
76 | } |
---|
77 | } |
---|
78 | |
---|
79 | notes " |
---|
80 | To enable mod_security2 either: |
---|
81 | 1) remove the two IfDefine lines from the conf-file |
---|
82 | 2) add -D ModSecurity2 to the apachectl start item |
---|
83 | " |
---|