Gentoo Archives: gentoo-commits

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