dev-python/zipp: keyworded 0.5.2 for ppc, bug #690956
[gentoo.git] / app-forensics / aide / aide-0.16-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools readme.gentoo-r1
7
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"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 x86"
15 IUSE="acl audit curl e2fs mhash postgres prelink selinux static xattr zlib"
16
17 COMMON_DEPEND="
18         !mhash? (
19                 dev-libs/libgcrypt:0=
20                 dev-libs/libgpg-error
21         )
22         mhash? ( app-crypt/mhash )
23         dev-libs/libpcre
24         acl? ( virtual/acl )
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 )
33 "
34 RDEPEND="
35         !static? ( ${COMMON_DEPEND} )
36         prelink? ( sys-devel/prelink )
37         selinux? ( sec-policy/selinux-aide )
38 "
39 DEPEND="${COMMON_DEPEND}
40         sys-devel/bison
41         sys-devel/flex
42         virtual/pkgconfig
43         static? (
44                 !mhash? (
45                         dev-libs/libgcrypt:0[static-libs]
46                         dev-libs/libgpg-error[static-libs]
47                 )
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] )
56         )
57 "
58
59 REQUIRED_USE="
60         postgres? ( !mhash )
61         static? ( !audit !curl !postgres )
62 "
63
64 HTML_DOCS=( doc/manual.html )
65
66 DISABLE_AUTOFORMATTING=1
67 DOC_CONTENTS="
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
70 for more information.
71
72 A helper script, aideinit, was installed and can be used to make AIDE
73 management easier. Please run 'aideinit --help' for more information.
74 "
75
76 PATCHES=(
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"
81 )
82
83 src_prepare() {
84         default_src_prepare
85         sed -i -e 's| -Werror||g' configure.ac || die
86         eautoreconf
87 }
88
89 src_configure() {
90         local myeconfargs=(
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.
96                 --without-locale
97                 $(use_enable static)
98                 $(use_with zlib)
99                 $(use_with curl)
100                 $(use_with acl posix-acl)
101                 $(use_with selinux)
102                 $(use_with prelink prelink "${EPREFIX}/usr/sbin/prelink")
103                 $(use_with xattr)
104                 $(use_with e2fs e2fsattrs)
105                 $(use_with mhash mhash)
106                 $(use_with !mhash gcrypt)
107                 $(use_with postgres psql)
108                 $(use_with audit)
109         )
110         econf "${myeconfargs[@]}"
111 }
112
113 src_install() {
114         default_src_install
115         readme.gentoo_create_doc
116
117         insinto /etc/${PN}
118         doins "${FILESDIR}"/aide.conf
119
120         dosbin "${FILESDIR}"/aideinit
121         dodoc "${FILESDIR}"/aide.cron
122
123         keepdir /var/{lib,log}/${PN}
124 }
125
126 pkg_postinst() {
127         readme.gentoo_print_elog
128
129         if use postgres; then
130                 elog
131                 elog "Due to a bad assumption by aide, you must issue the following"
132                 elog "command after the database initialization (aide --init ...):"
133                 elog
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'
137                 elog
138                 elog "where TABLE, HOSTNAME, PORT, DBASE, and USER are the same as"
139                 elog "in your aide.conf."
140                 elog
141         fi
142 }