Ticket #43419: patch-aide-Portfile.diff

File patch-aide-Portfile.diff, 6.5 KB (added by jul_bsd@…, 10 years ago)
  • security/aide//Portfile

    old new  
     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
    12# $Id: Portfile 124875 2014-08-30 02:33:55Z jmr@macports.org $
    23
    34PortSystem        1.0
    45
    56name            aide
    67version         0.15.1
     8revision     1
    79categories      security
    8 license         GPL-2+
     10license         GPL-2
    911maintainers     nomaintainer
    1012description     Advanced Intrusion Detection Environment
    1113long_description        AIDE (Advanced Intrusion Detection Environment) \
     
    2325homepage          http://aide.sourceforge.net/
    2426master_sites      sourceforge:project/aide/aide/${version}
    2527platforms         darwin
    26 checksums         md5 d0b72535ff68b93a648e4d08b0ed7f07 \
    27                   sha1 c5998c04a223416142323fa1bd18db0936099827 \
    28                   rmd160 80ea88b1c1496bcca57d2d1cdeecdcdfca0fa5cf
    2928configure.args  --mandir=${prefix}/share/man \
     29        --sysconfdir=${prefix}/etc/aide \
    3030                --with-mhash --with-zlib \
    3131                --with-locale --disable-static
    3232
    33 depends_build     port:bison
     33depends_build     port:bison port:flex
    3434depends_lib       port:mhash \
    3535                  port:gettext
    3636
    37 patchfiles        patch-Makefile.in.diff patch-src-Makefile.in.diff \
    38                         patch-doc-aide.conf.diff patch-doc-aide-check.cron.diff
     37patchfiles        patch-Makefile.in.diff patch-src-Makefile.in.diff
     38
     39variant universal {}
     40configure.cflags-append "${configure.cflags} [get_canonical_archflags cc]"
     41
    3942post-patch {
    4043        reinplace "s|@@LOCALEDIR@@|${prefix}/share/locale|g" \
    4144                ${worksrcpath}/Makefile.in ${worksrcpath}/src/Makefile.in
    42         reinplace "s|%%PREFIX%%|${prefix}|g" \
    43                 ${worksrcpath}/doc/aide-check.cron ${worksrcpath}/doc/aide.conf
    4445}
    4546
    4647post-destroot {
    47         file mkdir ${destroot}${prefix}/share/doc/${name}-${version}
    48         file mkdir ${destroot}${prefix}/etc/${name}
    49         file mkdir ${destroot}${prefix}/libexec/${name}
    50 
    51         system "install -bC ${worksrcpath}/doc/aide.conf \
    52                 ${destroot}${prefix}/share/doc/${name}-${version}/"
    53         system "install -bC ${worksrcpath}/doc/manual.html \
    54                 ${destroot}${prefix}/share/doc/${name}-${version}/"
    55         system "install -bC ${worksrcpath}/doc/aide.conf \
    56                 ${destroot}${prefix}/etc/${name}/"
    57         system "install -bC ${worksrcpath}/doc/aide-check.cron \
    58                 ${destroot}${prefix}/libexec/${name}/"
     48    xinstall -d ${destroot}${prefix}/share/doc/${name}
     49    xinstall -d ${destroot}${prefix}/share/examples/${name}
     50    xinstall -d ${destroot}${prefix}/etc/${name}
     51    xinstall -d ${destroot}${prefix}/libexec/${name}
     52    xinstall -d ${destroot}${prefix}/Library/LaunchDaemons
     53    xinstall -d ${destroot}${prefix}/var/lib/aide
     54    xinstall -d ${destroot}${prefix}/var/log/aide
     55
     56    copy ${filespath}/aide.conf ${destroot}${prefix}/share/examples/${name}/
     57    reinplace "s|%%PREFIX%%|${prefix}|g" ${destroot}${prefix}/share/examples/${name}/aide.conf
     58    copy ${worksrcpath}/contrib ${destroot}${prefix}/share/examples/${name}/
     59    copy ${worksrcpath}/doc/manual.html ${destroot}${prefix}/share/doc/${name}/
     60    copy ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name}/
     61    xinstall -m 755 ${filespath}/aide-check.cron ${destroot}${prefix}/libexec/${name}/
     62    reinplace "s|%%PREFIX%%|${prefix}|g" ${destroot}${prefix}/libexec/${name}/aide-check.cron
     63    copy ${filespath}/org.macports.aide.plist ${destroot}${prefix}/Library/LaunchDaemons/
     64    reinplace "s|%%PREFIX%%|${prefix}|g" ${destroot}${prefix}/Library/LaunchDaemons/org.macports.aide.plist
     65    copy ${filespath}/mp-aide.conf ${destroot}${prefix}/share/examples/${name}/
     66    reinplace "s|%%PREFIX%%|${prefix}|g" ${destroot}${prefix}/share/examples/${name}/mp-aide.conf
     67
     68    destroot.keepdirs  ${destroot}${prefix}/var/lib/aide \
     69        ${destroot}${prefix}/var/log/aide ${destroot}${prefix}/etc/${name}
     70}
     71
     72post-activate {
     73    if ![file exists ${prefix}/etc/aide/aide.conf ] {
     74        copy ${prefix}/share/examples/${name}/aide.conf ${prefix}/etc/aide/aide.conf
     75    }
    5976}
    6077
    6178platform darwin {
    6279    # darwin doesn't have or need off64_t and friends
    6380    configure.args-append --disable-lfs
    6481}
     82
     83notes "
     84If not existing, a default config has been copied to
     85  ${prefix}/etc/aide/aide.conf
     86Review it, especially adjust <myuser> to your environment.
     87It seems wildcard or @@var are not working there, at least on stable.
     88
     89To initialize database
     90  # aide --init
     91
     92A default scheduled task has been set up once a day in
     93  ${prefix}/Library/LaunchDaemons/org.macports.aide.plist
     94Check if it fit you and start it like
     95  # ln -s ${prefix}/Library/LaunchDaemons/org.macports.aide.plist /Library/LaunchDaemons/
     96and either one of those commands
     97  # launchctl load -w /Library/LaunchDaemons/org.macports.aide.plist
     98  # port load aide
     99An example config for rotating logs with system newsyslog is
     100    ${prefix}/share/examples/${name}/mp-aide.conf
     101You can install it with
     102  # cp ${prefix}/share/examples/${name}/mp-aide.conf /private/etc/newsyslog.d/
     103
     104You may need to enable permanently postfix so the scheduled task can send email:
     105  Edit /System/Library/LaunchDaemons/org.postfix.master.plist
     106  Remove the two strings lines with '-e' '60'.
     107  Add a '<key>KeepAlive</key><true/>'
     108Also, default MacOS configuration have /var/root/.forward redirecting email to
     109/dev/null. Either change aide.conf or .forward to get mail report.
     110
     111BUG: cron: only check mode, choice update
     112"
     113
     114if {${subport} eq ${name}} {
     115
     116    version           0.15.1
     117    master_sites      sourceforge:project/aide/aide/${version}
     118    checksums           rmd160  80ea88b1c1496bcca57d2d1cdeecdcdfca0fa5cf \
     119                        sha256  303e5c186257df8c86e418193199f4ea2183fc37d3d4a9098a614f61346059ef
     120
     121    livecheck.type      regex
     122    livecheck.url       ${homepage}
     123    livecheck.regex     "The current <em>stable</em> version of AIDE is <strong>(\\d+\\.\\d+\\.\\d+)</strong>"
     124}
     125
     126#subport ${name}-devel {
     127## http://sourceforge.net/p/aide/code/ci/master/tree/NEWS
     128## 0.16a2 (2013-05-04) vs last commit 2013-05-20
     129#    version           0.16a2
     130#    master_sites      sourceforge:project/aide/devel/${version}
     131#    checksums         rmd160  92c7d29da4a224b505702a5b624d6dffe54a3aea \
     132#                      sha256  b52451816bc85409ea09dc612e32823336f78438afd28248c252912ea8b91b87
     133#
     134#    ## FIXME! build fails on "compare_db.c:114:32: error: initializer element is not a compile-time constant"
     135#
     136#    livecheck.type    regex
     137#    livecheck.url     ${homepage}
     138#    livecheck.regex   "The current <em>development</em> version of AIDE is <strong>(\\d+\\.\\w+)</strong>"
     139#}