Ticket #43419: Portfile

File Portfile, 5.9 KB (added by jul_bsd@…, 10 years ago)
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: Portfile 124875 2014-08-30 02:33:55Z jmr@macports.org $
3
4PortSystem        1.0
5
6name            aide
7version         0.15.1
8revision     1
9categories      security
10license         GPL-2
11maintainers     nomaintainer
12description     Advanced Intrusion Detection Environment
13long_description        AIDE (Advanced Intrusion Detection Environment) \
14        is a free replacement for Tripwire. It does the same things as \
15        the semi-free Tripwire and more. \
16        It creates a database from the regular expression rules that it \
17        finds from the config file. Once this database is initialized it \
18        can be used to verify the integrity of the files. It has several \
19        message digest algorithms (md5,sha1,rmd160,tiger,haval,etc.) that \
20        are used to check the integrity of the file. More algorithms can \
21        be added with relative ease. All of the usual file attributes can \
22        also be checked for inconsistencies. It can read databases from \
23        older or newer versions. See the manual pages within the distribution \
24        for further info. There is also a beginning of a manual.
25homepage          http://aide.sourceforge.net/
26master_sites      sourceforge:project/aide/aide/${version}
27platforms         darwin
28configure.args  --mandir=${prefix}/share/man \
29        --sysconfdir=${prefix}/etc/aide \
30                --with-mhash --with-zlib \
31                --with-locale --disable-static
32
33depends_build     port:bison port:flex
34depends_lib       port:mhash \
35                  port:gettext
36
37patchfiles        patch-Makefile.in.diff patch-src-Makefile.in.diff
38
39variant universal {}
40configure.cflags-append "${configure.cflags} [get_canonical_archflags cc]"
41
42post-patch {
43        reinplace "s|@@LOCALEDIR@@|${prefix}/share/locale|g" \
44                ${worksrcpath}/Makefile.in ${worksrcpath}/src/Makefile.in
45}
46
47post-destroot {
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    }
76}
77
78platform darwin {
79    # darwin doesn't have or need off64_t and friends
80    configure.args-append --disable-lfs
81}
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#}