Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/audit/
Date: Sun, 03 Jan 2021 08:21:05
Message-Id: 1609661995.89046b3cd88212448f0eca18efab776d4bb71938.perfinion@gentoo
1 commit: 89046b3cd88212448f0eca18efab776d4bb71938
2 Author: David Michael <fedora.dm0 <AT> gmail <DOT> com>
3 AuthorDate: Sat Jan 2 18:56:42 2021 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 3 08:19:55 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89046b3c
7
8 sys-process/audit: bump to 3.0, add python3_9, EAPI 7
9
10 Package-Manager: Portage-3.0.12, Repoman-3.0.2
11 Signed-off-by: David Michael <fedora.dm0 <AT> gmail.com>
12 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
13
14 sys-process/audit/Manifest | 1 +
15 sys-process/audit/audit-3.0.ebuild | 153 +++++++++++++++++++++++++++++++++++++
16 2 files changed, 154 insertions(+)
17
18 diff --git a/sys-process/audit/Manifest b/sys-process/audit/Manifest
19 index d5276de092b..d20d93756cb 100644
20 --- a/sys-process/audit/Manifest
21 +++ b/sys-process/audit/Manifest
22 @@ -2,3 +2,4 @@ DIST audit-017e6c6ab95df55f34e339d2139def83e5dada1f.patch 852 BLAKE2B 60d8b813f5
23 DIST audit-2.8.4.tar.gz 1123889 BLAKE2B b80272b1984942d3c38bde30d22c736a8cc8896a2e42a9bf286446129313ce57a2a117ce26a0a5f1a4a06b4a48ddde463b8837b8c98273051be0c90e5bbebd42 SHA512 5795c565effab995cee447a2dc457ef6a6f15201fb185d7104992ac373a3cb5cfc865dd661c0896a895c96f452eff392d455064d0eead55cd7364d96e0d15c4a
24 DIST audit-2.8.5.tar.gz 1140694 BLAKE2B 64fd0cd93f934e3dd11faf21fcd765894a9c4336d8322179980bb7df1ef5a06d301a665860aeb84fefa0cf278940668023675b99ba7f33cdcfb542d869034358 SHA512 7d416aaa21c1a167f8e911ca82aecbaba804424f3243f505066c43ecc4a62a34feb2c27555e99d3268608404793dccca0f828c63670e3aa816016fb493f8174a
25 DIST audit-2.8.5_p80866dc78b5d.tar.gz 552094 BLAKE2B adb936a314ef2f11828ee00f3513631e06e2df09e37e68be27b1b694e278116d2f486dbde7ed57c77d9ff0bcd09309ea841959c7a66caed6770f367d65dd14f4 SHA512 7ec103bf076cfac7906748162e78835f1f65dd9d68e3a7466346e0473075beb47897adf88ab9ba0eb42db1953372aafb16cc040674b9a9c887730c062b82540a
26 +DIST audit-3.0.tar.gz 1109442 BLAKE2B f9c94f7163522068f5f37163a242cb913acc87b5465f7f8550fad27ac1dc673fd7a98e208bd5e6fb136eac1fdadd659e599e7722426937481bbf8c66d86a1617 SHA512 b82ec73c85a8ebb5108b526673d6fe08cbe0b51376788f3ea6ed5747c4612158462893e719496dffbd723f833f84383a2d1d55fd78a3ed985ecfd19545060c88
27
28 diff --git a/sys-process/audit/audit-3.0.ebuild b/sys-process/audit/audit-3.0.ebuild
29 new file mode 100644
30 index 00000000000..a460429ec25
31 --- /dev/null
32 +++ b/sys-process/audit/audit-3.0.ebuild
33 @@ -0,0 +1,153 @@
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_{6..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 ~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 lib
121 + emake -C auparse
122 + fi
123 +}
124 +
125 +multilib_src_install() {
126 + if multilib_is_native_abi; then
127 + emake DESTDIR="${D}" initdir="$(systemd_get_systemunitdir)" install
128 +
129 + local native_build="${BUILD_DIR}"
130 + python_install() {
131 + emake -C "${BUILD_DIR}"/bindings/swig DESTDIR="${D}" top_builddir="${native_build}" install
132 + emake -C "${BUILD_DIR}"/bindings/python/python3 DESTDIR="${D}" top_builddir="${native_build}" install
133 + python_optimize
134 + }
135 + use python && python_foreach_impl python_install
136 +
137 + # things like shadow use this so we need to be in /
138 + gen_usr_ldscript -a audit auparse
139 + else
140 + emake -C lib DESTDIR="${D}" install
141 + emake -C auparse DESTDIR="${D}" install
142 + fi
143 +}
144 +
145 +multilib_src_install_all() {
146 + dodoc AUTHORS ChangeLog README* THANKS
147 + docinto contrib
148 + dodoc contrib/avc_snap
149 + docinto contrib/plugin
150 + dodoc contrib/plugin/*
151 + docinto rules
152 + dodoc rules/*rules
153 +
154 + newinitd "${FILESDIR}"/auditd-init.d-2.4.3 auditd
155 + newconfd "${FILESDIR}"/auditd-conf.d-2.1.3 auditd
156 +
157 + [ -f "${ED}"/sbin/audisp-remote ] && \
158 + dodir /usr/sbin && \
159 + mv "${ED}"/{sbin,usr/sbin}/audisp-remote || die
160 +
161 + # Gentoo rules
162 + insinto /etc/audit
163 + newins "${FILESDIR}"/audit.rules-2.1.3 audit.rules
164 + doins "${FILESDIR}"/audit.rules.stop*
165 +
166 + # audit logs go here
167 + keepdir /var/log/audit
168 +
169 + find "${ED}" -type f -name '*.la' -delete || die
170 +
171 + # Security
172 + lockdown_perms "${ED}"
173 +}
174 +
175 +pkg_postinst() {
176 + lockdown_perms "${EROOT}"
177 +}
178 +
179 +lockdown_perms() {
180 + # Upstream wants these to have restrictive perms.
181 + # Should not || die as not all paths may exist.
182 + local basedir="$1"
183 + chmod 0750 "${basedir}"/sbin/au{ditctl,ditd,report,search,trace} 2>/dev/null
184 + chmod 0750 "${basedir}"/var/log/audit 2>/dev/null
185 + chmod 0640 "${basedir}"/etc/audit/{auditd.conf,audit*.rules*} 2>/dev/null
186 +}