Ticket #29815: Portfile

File Portfile, 2.4 KB (added by BjarneDMat, 13 years ago)

new portfile

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$
3PortSystem  1.0
4name            mod_evasive
5version         1.10.1
6categories      www
7platforms       darwin
8maintainers     mathiesen.info:macintosh
9description     apache module against DDoS
10long_description        mod_evasive is an evasive maneuvers module for \
11                        Apache to provide evasive action in the event of an \
12                        HTTP DoS or DDoS attack or brute force attack. It is \
13                        also designed to be a detection and network management \
14                        tool, and can be easily configured to talk to \
15                        ipchains, firewalls, routers, and etcetera. \
16                        mod_evasive presently reports abuses via email and \
17                        syslog facilities.
18
19homepage        http://www.zdziarski.com/blog/?page_id=442
20master_sites    http://www.zdziarski.com/blog/wp-content/uploads/2010/02/
21distname        ${name}_${version}
22checksums   sha1    7240481f9f7b0f80693787a73a2bfd9bfec6f274 \
23            rmd160  1ce741bf3f3bbc0cc81a9aa73311b08a68bd454e
24
25set worksrcdir  ${name}
26set apachedir   apache2
27set cversion    "20"
28
29use_configure   no
30
31variant apache1 conflicts apache2 {
32    depends_lib port:apache
33    set apachedir apache
34    set cversion ""
35    build.args  -c -o ${name}.so ${name}.c
36}
37
38variant apache2 conflicts apache1 {
39    depends_lib port:apache2
40    set apachedir apache2
41    set cversion "20"
42    build.args  -c -o ${name}${cversion}.so ${name}${cversion}.c
43}
44
45build.cmd       ${prefix}/${apachedir}/bin/apxs
46build.target
47
48destroot.violate_mtree  yes
49
50destroot {
51        xinstall -m 755 -d \
52            ${destroot}${prefix}/${apachedir}/modules \
53                ${destroot}${prefix}/share/doc/${name}
54        xinstall -m 644 ${worksrcpath}/.libs/${name}${cversion}.so \
55                ${destroot}${prefix}/apache2/modules
56        xinstall -m 644 -W ${worksrcpath} CHANGELOG LICENSE README \
57                ${destroot}${prefix}/share/doc/${name}
58}
59
60post-destroot {
61        exec    ${prefix}/${apachedir}/bin/apxs -e \
62            -S SYSCONFDIR=${prefix}/${apachedir}/conf/standard \
63            -S TARGET=00000-dso \
64            -n "evasive_module" \
65            -a modules/mod_evasive${cversion}.so \
66            2>@1
67    exec    sed -n -E \
68            -e "/IfModule mod_evasive${cversion}.c/,/IfModule/p" \
69            ${worksrcpath}/README \
70            > ${prefix}/${apachedir}/conf/extra/httpd-evasive.conf
71    reinplace   "s|mod_evasive${cversion}.c|evasive_module|" \
72                ${prefix}/${apachedir}/conf/extra/httpd-evasive.conf
73}
74
75if { ![variant_isset apache1] } { default_variants +apache2 }