Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/audit/
Date: Fri, 16 Jul 2021 01:35:01
Message-Id: 1626399204.2529a0b280cb240378c849dd4dcc0f26e2fe29ad.sam@gentoo
1 commit: 2529a0b280cb240378c849dd4dcc0f26e2fe29ad
2 Author: Jonathan Davies <jpds <AT> protonmail <DOT> com>
3 AuthorDate: Thu Jul 8 20:31:29 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 16 01:33:24 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2529a0b2
7
8 sys-process/audit: Version updated to 3.0.2, with changes:
9
10 * Dropped slibtool patch, applied upstream.
11
12 Signed-off-by: Jonathan Davies <jpds <AT> protonmail.com>
13 Closes: https://github.com/gentoo/gentoo/pull/21569
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 sys-process/audit/Manifest | 1 +
17 sys-process/audit/audit-3.0.2.ebuild | 155 +++++++++++++++++++++++++++++++++++
18 2 files changed, 156 insertions(+)
19
20 diff --git a/sys-process/audit/Manifest b/sys-process/audit/Manifest
21 index b2f62466967..c44d95add0b 100644
22 --- a/sys-process/audit/Manifest
23 +++ b/sys-process/audit/Manifest
24 @@ -1,4 +1,5 @@
25 DIST audit-017e6c6ab95df55f34e339d2139def83e5dada1f.patch 852 BLAKE2B 60d8b813f57338ce267a09913e68a0726acf5cf878cd2893fe2493f80d2b0ac1e0504dc7a72e85134ae2597b268cb1772b4e7c6c2f19149fc905f6928e2db47f SHA512 78e32c05b6896d37bacf0938954fbce7486a528dabd55421f1715438fe489171f9157059050abdcb3f673258aa28b4a11f643ddb7824f3499a195dbbe634f101
26 DIST audit-2.8.5_p80866dc78b5d.tar.gz 552094 BLAKE2B adb936a314ef2f11828ee00f3513631e06e2df09e37e68be27b1b694e278116d2f486dbde7ed57c77d9ff0bcd09309ea841959c7a66caed6770f367d65dd14f4 SHA512 7ec103bf076cfac7906748162e78835f1f65dd9d68e3a7466346e0473075beb47897adf88ab9ba0eb42db1953372aafb16cc040674b9a9c887730c062b82540a
27 DIST audit-3.0.1.tar.gz 1180286 BLAKE2B f29687ebc76f4eb88184cce1a3da0b8ca4464b2f81f56d71048ac4a64a713f33d6964e46e78b73c72b6ac2495f80114866773b3b86753c1d0dead25df73f7c43 SHA512 ad2897c9f539681f0f65b08cd0e650c528957fd4799755c2bcc47f869e04272aad31684c46847124d7b42dde243a16ba2754936890189610814c7007c0381d8c
28 +DIST audit-3.0.2.tar.gz 1184356 BLAKE2B 13f76e9c40bc8ffc53b5499076b5cb75c2690d95414a0e1942fa9725b9617f10327a2ee676dc10cc46ba76d223f77509d305bcd22344b678443b7707cc6d10cd SHA512 9e831ed6f30ac7d58f028cede97adba431bde18dfd9045c19f5e03eff52cd28db3a6792e5969f555ce51aa562662b59fa5cc5265586c6acf0b3aa1feae4d720f
29 DIST audit-3.0.tar.gz 1109442 BLAKE2B f9c94f7163522068f5f37163a242cb913acc87b5465f7f8550fad27ac1dc673fd7a98e208bd5e6fb136eac1fdadd659e599e7722426937481bbf8c66d86a1617 SHA512 b82ec73c85a8ebb5108b526673d6fe08cbe0b51376788f3ea6ed5747c4612158462893e719496dffbd723f833f84383a2d1d55fd78a3ed985ecfd19545060c88
30
31 diff --git a/sys-process/audit/audit-3.0.2.ebuild b/sys-process/audit/audit-3.0.2.ebuild
32 new file mode 100644
33 index 00000000000..861a82aa1f1
34 --- /dev/null
35 +++ b/sys-process/audit/audit-3.0.2.ebuild
36 @@ -0,0 +1,155 @@
37 +# Copyright 1999-2021 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=7
41 +
42 +PYTHON_COMPAT=( python3_{7..9} )
43 +
44 +inherit autotools multilib multilib-minimal toolchain-funcs python-r1 linux-info systemd usr-ldscript
45 +
46 +DESCRIPTION="Userspace utilities for storing and processing auditing records"
47 +HOMEPAGE="https://people.redhat.com/sgrubb/audit/"
48 +SRC_URI="https://people.redhat.com/sgrubb/audit/${P}.tar.gz"
49 +
50 +LICENSE="GPL-2+ LGPL-2.1+"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
53 +IUSE="gssapi ldap python static-libs"
54 +
55 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
56 +# Testcases are pretty useless as they are built for RedHat users/groups and kernels.
57 +RESTRICT="test"
58 +
59 +RDEPEND="gssapi? ( virtual/krb5 )
60 + ldap? ( net-nds/openldap )
61 + sys-libs/libcap-ng
62 + python? ( ${PYTHON_DEPS} )"
63 +DEPEND="${RDEPEND}
64 + >=sys-kernel/linux-headers-2.6.34" # This is linux specific.
65 +BDEPEND="python? ( dev-lang/swig:0 )"
66 +
67 +CONFIG_CHECK="~AUDIT"
68 +
69 +src_prepare() {
70 + # audisp-remote moved in multilib_src_install_all
71 + sed -i \
72 + -e "s,/sbin/audisp-remote,${EPREFIX}/usr/sbin/audisp-remote," \
73 + audisp/plugins/remote/au-remote.conf || die
74 +
75 + # Disable installing sample rules so they can be installed as docs.
76 + echo -e '%:\n\t:' | tee rules/Makefile.{am,in} >/dev/null
77 +
78 + default
79 + eautoreconf
80 +}
81 +
82 +multilib_src_configure() {
83 + local -a myeconfargs=(
84 + --sbindir="${EPREFIX}/sbin"
85 + $(use_enable gssapi gssapi-krb5)
86 + $(use_enable ldap zos-remote)
87 + $(use_enable static-libs static)
88 + --enable-systemd
89 + --without-golang
90 + --without-python
91 + --without-python3
92 + )
93 + ECONF_SOURCE=${S} econf "${myeconfargs[@]}"
94 +
95 + if multilib_is_native_abi && use python; then
96 + python_configure() {
97 + mkdir -p "${BUILD_DIR}"
98 + pushd "${BUILD_DIR}" &>/dev/null || die
99 + ECONF_SOURCE=${S} econf "${myeconfargs[@]}" --with-python3
100 + popd &>/dev/null || die
101 + }
102 + python_foreach_impl python_configure
103 + fi
104 +}
105 +
106 +src_configure() {
107 + tc-export_build_env BUILD_{CC,CPP}
108 + local -x CC_FOR_BUILD="${BUILD_CC}"
109 + local -x CPP_FOR_BUILD="${BUILD_CPP}"
110 + multilib-minimal_src_configure
111 +}
112 +
113 +multilib_src_compile() {
114 + if multilib_is_native_abi; then
115 + default
116 +
117 + local native_build="${BUILD_DIR}"
118 + python_compile() {
119 + emake -C "${BUILD_DIR}"/bindings/swig top_builddir="${native_build}"
120 + emake -C "${BUILD_DIR}"/bindings/python/python3 top_builddir="${native_build}"
121 + }
122 + use python && python_foreach_impl python_compile
123 + else
124 + emake -C common
125 + emake -C lib
126 + emake -C auparse
127 + fi
128 +}
129 +
130 +multilib_src_install() {
131 + if multilib_is_native_abi; then
132 + emake DESTDIR="${D}" initdir="$(systemd_get_systemunitdir)" install
133 +
134 + local native_build="${BUILD_DIR}"
135 + python_install() {
136 + emake -C "${BUILD_DIR}"/bindings/swig DESTDIR="${D}" top_builddir="${native_build}" install
137 + emake -C "${BUILD_DIR}"/bindings/python/python3 DESTDIR="${D}" top_builddir="${native_build}" install
138 + python_optimize
139 + }
140 + use python && python_foreach_impl python_install
141 +
142 + # things like shadow use this so we need to be in /
143 + gen_usr_ldscript -a audit auparse
144 + else
145 + emake -C lib DESTDIR="${D}" install
146 + emake -C auparse DESTDIR="${D}" install
147 + fi
148 +}
149 +
150 +multilib_src_install_all() {
151 + dodoc AUTHORS ChangeLog README* THANKS
152 + docinto contrib
153 + dodoc contrib/avc_snap
154 + docinto contrib/plugin
155 + dodoc contrib/plugin/*
156 + docinto rules
157 + dodoc rules/*rules
158 +
159 + newinitd "${FILESDIR}"/auditd-init.d-2.4.3 auditd
160 + newconfd "${FILESDIR}"/auditd-conf.d-2.1.3 auditd
161 +
162 + [ -f "${ED}"/sbin/audisp-remote ] && \
163 + dodir /usr/sbin && \
164 + mv "${ED}"/{sbin,usr/sbin}/audisp-remote || die
165 +
166 + # Gentoo rules
167 + insinto /etc/audit
168 + newins "${FILESDIR}"/audit.rules-2.1.3 audit.rules
169 + doins "${FILESDIR}"/audit.rules.stop*
170 +
171 + # audit logs go here
172 + keepdir /var/log/audit
173 +
174 + find "${ED}" -type f -name '*.la' -delete || die
175 +
176 + # Security
177 + lockdown_perms "${ED}"
178 +}
179 +
180 +pkg_postinst() {
181 + lockdown_perms "${EROOT}"
182 +}
183 +
184 +lockdown_perms() {
185 + # Upstream wants these to have restrictive perms.
186 + # Should not || die as not all paths may exist.
187 + local basedir="$1"
188 + chmod 0750 "${basedir}"/sbin/au{ditctl,ditd,report,search,trace} 2>/dev/null
189 + chmod 0750 "${basedir}"/var/log/audit 2>/dev/null
190 + chmod 0640 "${basedir}"/etc/audit/{auditd.conf,audit*.rules*} 2>/dev/null
191 +}