# -*- 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
set name_package modsecurity
maintainers {pixilla @pixilla} openmaintainer
description Apache 2 intrusion detection and prevention engine for web applications
long_description ModSecurity is an open source intrusion detection and \
prevention engine for web applications. It operates \
embedded into the web server, acting as a powerful \
umbrella - shielding applications from attacks.
homepage http://www.modsecurity.org
master_sites https://www.modsecurity.org/tarball/${version}/
distname ${name_package}-${version}
checksums rmd160 87c8d4f4b4c180a0e85267f18f162a01bcc99358 \
sha256 41a8f73476ec891f3a9e8736b98b64ea5c2105f1ce15ea57a1f05b4bf2ffaeb5
depends_build port:pkgconfig
depends_lib port:apache2 \
if {[variant_isset apache22]} {
set apxs ${prefix}/apache22/bin/apxs
set httpd_conf ${prefix}/apache22/conf/httpd.conf
set mdir ${destroot}${prefix}/apache22/modules/
set apxs ${prefix}/bin/apxs
set httpd_conf ${prefix}/etc/apache2/httpd.conf
set mdir ${destroot}${prefix}/lib/apache2/modules/
variant apache22 description "use apache22 instead of apache2" {
depends_lib-replace port:apache2 port:apache22
destroot.violate_mtree yes
configure.args --with-apxs=${apxs} \
--with-pcre=${prefix}/bin/pcre-config \
--with-apr=${prefix}/bin/apr-1-config \
--with-apu=${prefix}/bin/apu-1-config \
--with-curl=${prefix}/bin/curl-config \
--with-libxml=${prefix} \
xinstall -d -m 755 ${mdir}
xinstall -m 644 -W ${worksrcpath}/apache2/.libs mod_security2.so \
xinstall -m 755 -W ${worksrcpath}/mlogc mlogc mlogc-batch-load.pl \
xinstall -m 755 -W ${worksrcpath}/tools rules-updater.pl \
xinstall -m 755 -W ${worksrcpath}/mlogc mlogc-default.conf \
xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 -W ${worksrcpath} CHANGES LICENSE NOTICE README.TXT \
${destroot}${prefix}/share/doc/${name}
livecheck.url http://www.modsecurity.org/download.html
livecheck.regex "tarball/(\\d+(?:\\.\\d+)*)/modsecurity-\\1.tar.gz"
# Now edit ${httpd_conf} and add the following lines at the end of the LoadModules section:
LoadFile ${prefix}/lib/libxml2.dylib
LoadFile ${prefix}/lib/liblua.dylib
LoadModule security2_module modules/mod_security2.so
# And finally reload apache.
$ sudo apachectl graceful