Ticket #43231: patch-syslog-ng-Portfile.diff

File patch-syslog-ng-Portfile.diff, 10.8 KB (added by jul_bsd@…, 9 years ago)
  • sysutils/syslog-ng/Portfile

    old new  
    1 # $Id: Portfile 125738 2014-09-25 14:43:03Z mf2k@macports.org $
     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 104019 2013-03-13 01:05:06Z jmr@macports.org $
    23
    34PortSystem 1.0
    45
    5 name                    syslog-ng
    6 version                 3.0.8
    7 revision                2
    8 categories              sysutils
    9 license                 {GPL-2 OpenSSLException}
    10 platforms               darwin
    11 maintainers             nomaintainer
    12 description             Highly configurable syslog replacement.
    13 long_description        syslog-ng is the world's most flexible and scalable audit \
    14                                         trail processing tool for organizations of any size. It \
    15                                         provides a centralised, securely stored log of all devices \
    16                                         on your network, whatever platform they run on. And \
    17                                         syslog-ng also incorporates a host of powerful features, \
    18                                         including filtering based on message content, as well as \
    19                                         customisable data mining and analysis capabilities.
    20 
    21 homepage                        http://www.balabit.com/products/syslog_ng/
    22 master_sites                    http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/${version}/source/
    23 checksums                       md5 7107f5758dec4b774136f0f827b35258
    24 distfiles                       ${name}_${version}${extract.suffix}
    25 patchfiles                      patch-src-Makefile.in.diff
    26 
    27 depends_build                   path:bin/pkg-config:pkgconfig
    28 depends_lib                     port:eventlog \
    29                                 port:libnet11 \
    30                                 path:lib/pkgconfig/glib-2.0.pc:glib2
     6PortGroup           github 1.0
    317
    32 startupitem.create      yes
    33 startupitem.executable  ${prefix}/sbin/syslog-ng
     8github.setup        balabit syslog-ng 3.6.2
     9categories          sysutils
     10license             {LGPL+GPL-2 OpenSSLException}
     11platforms           darwin
     12maintainers             nomaintainer
     13description         Highly configurable syslog replacement.
     14long_description    syslog-ng is the world's most flexible and scalable audit \
     15                    trail processing tool for organizations of any size. It \
     16                    provides a centralised, securely stored log of all devices \
     17                    on your network, whatever platform they run on. And \
     18                    syslog-ng also incorporates a host of powerful features, \
     19                    including filtering based on message content, as well as \
     20                    customisable data mining and analysis capabilities.
     21homepage            http://www.balabit.com/products/syslog_ng/
     22#master_sites        http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/${version}/source/
     23
     24distname            ${name}_${version}
     25#patchfiles           patch-src-Makefile.in.diff
     26## FIXME! https://bugzilla.balabit.com/show_bug.cgi?id=155
     27## https://github.com/Homebrew/homebrew/issues/22030
     28## https://github.com/balabit/syslog-ng/issues/173
     29patchfiles           patch-configure.ac.diff
     30
     31depends_build        path:bin/pkg-config:pkgconfig port:gmake port:bison
     32depends_lib          port:eventlog port:libnet11 port:pcre \
     33                     path:lib/pkgconfig/glib-2.0.pc:glib2
     34
     35startupitem.create   yes
     36startupitem.executable ${prefix}/sbin/syslog-ng
    3437startupitem.pidfile clean ${prefix}/var/syslog-ng.pid
    3538
    36 configure.args          --mandir=${prefix}/share/man \
    37                         --enable-dynamic-linking \
    38                         --sysconfdir=${prefix}/etc
     39configure.args       --mandir=${prefix}/share/man \
     40                     --enable-dynamic-linking \
     41                     --sysconfdir=${prefix}/etc \
     42                     --enable-tcp-wrapper --enable-spoof-source \
     43                     --enable-pcre \
     44                     --disable-mongodb --disable-json
     45
     46## "ld: unknown option: --whole-archive" => same w clang or mp-gcc49 :(
     47#configure.compiler  macports-gcc-4.9
     48build.env            MAKE=${prefix}/bin/gmake
     49
     50if {${subport} eq ${name}} {
     51
     52    checksums           rmd160  8562f1494d384125113c6ad6777f7e68edd345f1 \
     53                        sha256  ef47fada52981e09af570457a5af30f815f5d5b6c2e33754cedd4ca9780d8261
     54#    livecheck.type     regex
     55#    livecheck.url       http://www.balabit.com/downloads/files/syslog-ng/open-source-edition
     56#    livecheck.regex     "/downloads/files/syslog-ng/open-source-edition/(\\d+(?:\\.\\d+)*)\""
     57}
     58
     59subport ${name}30 {
     60    version             3.0.8
     61    distname            ${name}_${version}
     62    master_sites        http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/${version}/source/
     63    checksums           rmd160  5eceefb35c8afbda82605d742cbdf4ba2a22cd3a \
     64                        sha256  ba93e53768f53d1fa2f753327e4b7f7aae46cc48274a9475effe14c722e314b2
     65
     66    livecheck.type      none
     67}
     68
     69## Test latest work in progress
     70subport ${name}-devel {
     71    version             20150405
     72    distname            950f046c592395efde94c4de8ed30fdd30d479de
     73    master_sites        https://github.com/${github.author}/${github.project}/archive/
     74    checksums           rmd160  b48ef66920326f8f6374ea932b9338960a129df8 \
     75                        sha256  6fb8875009a62314351736afb7f4d1245c06e1c38d97e6420127a31902a0f8ed
     76    worksrcdir          ${github.project}-${distname}
     77
     78    depends_build-append port:libtool
     79## configure: error: Building with system librabbitmq is not supported yet.
     80#                        port:rabbitmq-c
     81    depends_lib-append  port:libivykis \
     82                        port:json-c \
     83                        port:libmongo-client
     84
     85    patchfiles-delete           patch-configure.ac.diff
     86
     87    pre-configure {
     88        reinplace "s|^SUBMODULES=.*$|SUBMODULES=''|" ${worksrcpath}/autogen.sh
     89        reinplace "s|^libtoolize|${prefix}/bin/glibtoolize|" ${worksrcpath}/autogen.sh
     90        system -W ${worksrcpath} "./autogen.sh"
     91    }
     92
     93    configure.cflags        -D__sun
     94    configure.args-append   --with-ivykis=system \
     95                            --with-libmongo-client=system \
     96                            --with-jsonc=system \
     97                            --with-python=2.7 \
     98                            --disable-java
     99#                            --with-librabbitmq-client=system
     100
     101    livecheck.type      none
     102}
     103
     104subport ${name}-develgreg {
     105    github.setup        gregory094 syslog-ng 3.6.2
     106    version             20150224
     107    distname            3e5f42b1d638063ed8a8e8699182935f8be4167e
     108    checksums           rmd160  5e839dfb916b6202606b04683ad31d2ed2a43fdf \
     109                        sha256  622d22c829518b03961a560d4935f7d3d98fdd14a298e88c16fa8217b58e886c
     110    master_sites        https://github.com/${github.author}/${github.project}/archive/
     111    worksrcdir          ${github.project}-${distname}
     112
     113    depends_build-append port:libtool
     114## configure: error: Building with system librabbitmq is not supported yet.
     115#                        port:rabbitmq-c
     116    depends_lib-append  port:libivykis \
     117                        port:json-c \
     118                        port:libmongo-client
     119
     120    patchfiles-delete           patch-configure.ac.diff
     121
     122    pre-configure {
     123        reinplace "s|^SUBMODULES=.*$|SUBMODULES=''|" ${worksrcpath}/autogen.sh
     124        reinplace "s|^libtoolize|${prefix}/bin/glibtoolize|" ${worksrcpath}/autogen.sh
     125        system -W ${worksrcpath} "./autogen.sh"
     126    }
     127
     128    configure.cflags        -D__sun
     129    configure.args-append   --with-ivykis=system \
     130                            --with-libmongo-client=system \
     131                            --with-jsonc=system \
     132                            --with-python=2.7 \
     133                            --disable-java
     134#                            --with-librabbitmq-client=system
     135
     136    livecheck.type      none
     137}
    39138
    40 platform powerpc        {
    41         configure.args-append           --host=powerpc
     139platform powerpc    {
     140    configure.args-append        --host=powerpc
    42141}
    43142
    44143pre-destroot {
    45144# Append the major.minor version number to the top of the sample config
    46         set major_minor [join [lrange [split ${version} .] 0 1] .]
    47         system "echo version $major_minor >> ${worksrcpath}/doc/examples/header"
    48         system "cat ${worksrcpath}/doc/examples/header ${worksrcpath}/doc/examples/syslog-ng.conf.sample \
    49                 > ${worksrcpath}/doc/examples/syslog-ng.conf-dist"
     145    set major_minor [join [lrange [split ${version} .] 0 1] .]
     146    system "echo version $major_minor >> ${worksrcpath}/doc/examples/header"
     147    system "cat ${worksrcpath}/doc/examples/header ${worksrcpath}/doc/examples/syslog-ng.conf.sample \
     148        > ${worksrcpath}/doc/examples/syslog-ng.conf-dist"
    50149}
    51150
    52 post-destroot   {
    53         xinstall -m 644 ${worksrcpath}/doc/examples/syslog-ng.conf-dist \
    54                 ${destroot}${prefix}/etc
    55         xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    56         xinstall -m 644 -W ${worksrcpath} ChangeLog README AUTHORS COPYING NEWS \
    57                 ${destroot}${prefix}/share/doc/${name}
    58         reinplace "s|/dev/log|/var/run/syslog|g" \
    59                 ${destroot}${prefix}/etc/syslog-ng.conf-dist
     151post-destroot    {
     152    xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name}
     153    xinstall -m 644 ${worksrcpath}/doc/examples/syslog-ng.conf-dist \
     154        ${destroot}${prefix}/share/examples/${name}/
     155    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
     156    xinstall -m 644 -W ${worksrcpath} ChangeLog README AUTHORS COPYING NEWS \
     157        ${destroot}${prefix}/share/doc/${name}
     158    reinplace "s|/dev/log|/var/run/syslog|g" \
     159        ${destroot}${prefix}/etc/syslog-ng.conf-dist
     160}
     161
     162post-activate {
     163    if ![file exists ${prefix}/etc/syslog-ng.conf ] {
     164        copy ${prefix}/share/examples/${name}/syslog-ng.conf.dist ${prefix}/etc/
     165    }
    60166}
    61167
    62168notes \
    63 "To use syslog-ng, first unload OS X's built-in syslog daemon:
     169"
     170*** Latest 3.6.x not compiling on MacOS X, use subport for 3.0.8 ***
     171
     172To use syslog-ng, first unload OS X's built-in syslog daemon:
    64173
    65         sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.syslogd.plist
     174    sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.syslogd.plist
    66175
    67176Then copy ${prefix}/etc/syslog-ng.conf-dist to ${prefix}/etc/syslog-ng.conf,
    68177customize, and load syslog-ng:
    69178
    70         sudo launchctl load -w /Library/LaunchDaemons/org.macports.syslog-ng.plist"
     179    sudo launchctl load -w /Library/LaunchDaemons/org.macports.syslog-ng.plist
     180"
     181
     182default_variants +ssl +ipv6 +sql +geoip
     183
     184variant ssl description { ssl support } {
     185    depends_lib-append  port:openssl
     186    configure.args-append --enable-ssl
     187}
     188
     189variant geoip description { geoip support } {
     190    depends_lib-append  port:libgeoip
     191    configure.args-append --enable-geoip
     192}
     193
     194variant ipv6 description { ipv6 support } {
     195    configure.args-append --enable-ipv6
     196}
     197
     198variant sql description { sql support } {
     199    depends_lib-append  port:libdbi
     200    configure.args-append --enable-sql
     201}
     202
     203variant mongodb description { mongodb support } {
     204    configure.args-delete --disable-mongodb
     205    configure.args-append --enable-mongodb
     206}
     207
     208variant json description { json-c support } {
     209    depends_lib-append  port:json-c
     210    configure.args-delete --disable-json
     211    configure.args-append --enable-json
     212}
     213