1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools readme.gentoo-r1
8 DESCRIPTION="AIDE (Advanced Intrusion Detection Environment) is a file integrity checker"
9 HOMEPAGE="http://aide.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/aide/${P}.tar.gz"
15 IUSE="acl audit curl e2fs mhash postgres prelink selinux static xattr zlib"
22 mhash? ( app-crypt/mhash )
25 audit? ( sys-process/audit )
26 curl? ( net-misc/curl )
27 e2fs? ( sys-fs/e2fsprogs )
28 postgres? ( dev-db/postgresql:= )
29 prelink? ( dev-libs/elfutils )
30 selinux? ( sys-libs/libselinux )
31 xattr? ( sys-apps/attr )
32 zlib? ( sys-libs/zlib )
35 !static? ( ${COMMON_DEPEND} )
36 prelink? ( sys-devel/prelink )
37 selinux? ( sec-policy/selinux-aide )
39 DEPEND="${COMMON_DEPEND}
45 dev-libs/libgcrypt:0[static-libs]
46 dev-libs/libgpg-error[static-libs]
48 mhash? ( app-crypt/mhash[static-libs] )
49 dev-libs/libpcre[static-libs]
50 acl? ( virtual/acl[static-libs] )
51 e2fs? ( sys-fs/e2fsprogs[static-libs] )
52 prelink? ( dev-libs/elfutils[static-libs] )
53 selinux? ( sys-libs/libselinux[static-libs] )
54 xattr? ( sys-apps/attr[static-libs] )
55 zlib? ( sys-libs/zlib[static-libs] )
61 static? ( !audit !curl !postgres )
64 HTML_DOCS=( doc/manual.html )
66 DISABLE_AUTOFORMATTING=1
68 Example configuration file was installed at '${EPREFIX}/etc/aide/aide.conf'.
69 Please edit it to meet your needs. Refer to aide.conf(5) manual page
72 A helper script, aideinit, was installed and can be used to make AIDE
73 management easier. Please run 'aideinit --help' for more information.
77 "${FILESDIR}/${P}-add-missing-include.patch"
78 "${FILESDIR}/${P}-fix-LIBS-LDFLAGS-mixing.patch"
79 "${FILESDIR}/${P}-fix-acl-configure-option.patch"
80 "${FILESDIR}/${P}-support-attr-2.4.48.patch"
85 sed -i -e 's| -Werror||g' configure.ac || die
91 --sysconfdir="${EPREFIX}/etc/${PN}"
92 --with-confighmactype="sha512" # Override default weak MD5 hash.
93 --with-dbhmackey="sha512" # Override default weak MD5 hash.
94 # Disable broken l10n support: https://sourceforge.net/p/aide/bugs/98/
95 # This doesn't affect anything because there are no localizations yet.
100 $(use_with acl posix-acl)
102 $(use_with prelink prelink "${EPREFIX}/usr/sbin/prelink")
104 $(use_with e2fs e2fsattrs)
105 $(use_with mhash mhash)
106 $(use_with !mhash gcrypt)
107 $(use_with postgres psql)
110 econf "${myeconfargs[@]}"
115 readme.gentoo_create_doc
118 doins "${FILESDIR}"/aide.conf
120 dosbin "${FILESDIR}"/aideinit
121 dodoc "${FILESDIR}"/aide.cron
123 keepdir /var/{lib,log}/${PN}
127 readme.gentoo_print_elog
129 if use postgres; then
131 elog "Due to a bad assumption by aide, you must issue the following"
132 elog "command after the database initialization (aide --init ...):"
134 elog 'psql -c "update pg_index set indisunique=false from pg_class \\ '
135 elog " where pg_class.relname='TABLE_pkey' and \ "
136 elog ' pg_class.oid=pg_index.indexrelid" -h HOSTNAME -p PORT DBASE USER'
138 elog "where TABLE, HOSTNAME, PORT, DBASE, and USER are the same as"
139 elog "in your aide.conf."