Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-process/audit: audit-2.2.2-r2.ebuild ChangeLog
Date: Thu, 29 May 2014 22:20:39
Message-Id: 20140529222035.273192004E@flycatcher.gentoo.org
1 mgorny 14/05/29 22:20:35
2
3 Modified: ChangeLog
4 Added: audit-2.2.2-r2.ebuild
5 Log:
6 Enable multilib support & switch to python-r1.
7
8 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)
9
10 Revision Changes Path
11 1.96 sys-process/audit/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/audit/ChangeLog?rev=1.96&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/audit/ChangeLog?rev=1.96&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/audit/ChangeLog?r1=1.95&r2=1.96
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-process/audit/ChangeLog,v
20 retrieving revision 1.95
21 retrieving revision 1.96
22 diff -u -r1.95 -r1.96
23 --- ChangeLog 29 May 2014 01:30:00 -0000 1.95
24 +++ ChangeLog 29 May 2014 22:20:34 -0000 1.96
25 @@ -1,6 +1,11 @@
26 # ChangeLog for sys-process/audit
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/ChangeLog,v 1.95 2014/05/29 01:30:00 floppym Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/ChangeLog,v 1.96 2014/05/29 22:20:34 mgorny Exp $
30 +
31 +*audit-2.2.2-r2 (29 May 2014)
32 +
33 + 29 May 2014; Michał Górny <mgorny@g.o> +audit-2.2.2-r2.ebuild:
34 + Enable multilib support & switch to python-r1.
35
36 29 May 2014; Mike Gilbert <floppym@g.o> audit-2.2.2-r1.ebuild:
37 Override hardcoded /usr/lib/systemd/system.
38
39
40
41 1.1 sys-process/audit/audit-2.2.2-r2.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/audit/audit-2.2.2-r2.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/audit/audit-2.2.2-r2.ebuild?rev=1.1&content-type=text/plain
45
46 Index: audit-2.2.2-r2.ebuild
47 ===================================================================
48 # Copyright 1999-2014 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/sys-process/audit/audit-2.2.2-r2.ebuild,v 1.1 2014/05/29 22:20:34 mgorny Exp $
51
52 EAPI="5"
53
54 PYTHON_COMPAT=( python2_7 )
55
56 inherit autotools multilib multilib-minimal toolchain-funcs python-r1 linux-info eutils systemd
57
58 DESCRIPTION="Userspace utilities for storing and processing auditing records"
59 HOMEPAGE="http://people.redhat.com/sgrubb/audit/"
60 SRC_URI="http://people.redhat.com/sgrubb/audit/${P}.tar.gz"
61
62 LICENSE="GPL-2"
63 SLOT="0"
64 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
65 IUSE="ldap prelude python"
66 # Testcases are pretty useless as they are built for RedHat users/groups and
67 # kernels.
68 RESTRICT="test"
69
70 RDEPEND="ldap? ( net-nds/openldap )
71 prelude? ( dev-libs/libprelude )
72 sys-libs/libcap-ng"
73 DEPEND="${RDEPEND}
74 python? ( dev-lang/swig )
75 >=sys-kernel/linux-headers-2.6.34"
76 # Do not use os-headers as this is linux specific
77
78 CONFIG_CHECK="~AUDIT"
79
80 pkg_setup() {
81 linux-info_pkg_setup
82 }
83
84 src_prepare() {
85 # Old patch applies fine
86 #EPATCH_OPTS="-p0 -d${S}" epatch "${FILESDIR}"/${PN}-1.5.4-build.patch
87
88 # Applied by upstream
89 #EPATCH_OPTS="-p1 -d${S}" epatch "${FILESDIR}"/${PN}-1.5.4-swig-gcc-attribute.patch
90
91 # Do not build GUI tools
92 sed -i \
93 -e '/AC_CONFIG_SUBDIRS.*system-config-audit/d' \
94 "${S}"/configure.ac || die
95 sed -i \
96 -e 's,system-config-audit,,g' \
97 "${S}"/Makefile.am || die
98 rm -rf "${S}"/system-config-audit
99
100 # Probably goes away in 1.6.9
101 #EPATCH_OPTS="-p1 -d${S}" epatch "${FILESDIR}"/audit-1.6.8-subdirs-fix.patch
102
103 if ! use ldap; then
104 sed -i \
105 -e '/^AC_OUTPUT/s,audisp/plugins/zos-remote/Makefile,,g' \
106 "${S}"/configure.ac || die
107 sed -i \
108 -e '/^SUBDIRS/s,zos-remote,,g' \
109 "${S}"/audisp/plugins/Makefile.am || die
110 fi
111
112 # Don't build static version of Python module.
113 epatch "${FILESDIR}"/${PN}-2.1.3-python.patch
114
115 # glibc/kernel upstreams suck with both defining ia64_fpreg
116 # This patch is a horribly workaround that is only valid as long as you
117 # don't need the OTHER definitions in fpu.h.
118 epatch "${FILESDIR}"/${PN}-2.1.3-ia64-compile-fix.patch
119
120 # Python bindings are built/installed manually.
121 sed -e "/^SUBDIRS =/s/ python//" -i bindings/Makefile.am
122 sed -e "/^SUBDIRS .*=/s/ swig//" -i Makefile.am
123
124 # Regenerate autotooling
125 eautoreconf
126
127 # Bug 352198: Avoid parallel build fail
128 cd "${S}"/src/mt
129 [[ ! -s private.h ]] && ln -s ../../lib/private.h .
130 }
131
132 multilib_src_configure() {
133 local ECONF_SOURCE=${S}
134 #append-flags -D'__attribute__(x)='
135 econf \
136 --sbindir=/sbin \
137 --enable-systemd \
138 --without-python \
139 $(multilib_native_use_with prelude)
140
141 if multilib_is_native_abi; then
142 python_configure() {
143 mkdir -p "${BUILD_DIR}" || die
144 cd "${BUILD_DIR}" || die
145 econf --with-python
146 }
147
148 use python && python_foreach_impl python_configure
149 fi
150 }
151
152 multilib_src_compile() {
153 if multilib_is_native_abi; then
154 default
155
156 python_compile() {
157 emake -C "${BUILD_DIR}"/swig \
158 VPATH="${native_build}/lib" \
159 LIBS="${native_build}/lib/libaudit.la"
160 emake -C "${BUILD_DIR}"/bindings/python \
161 VPATH="${S}/bindings/python:${native_build}/bindings/python" \
162 auparse_la_LIBADD="${native_build}/auparse/libauparse.la ${native_build}/lib/libaudit.la"
163 }
164
165 local native_build=${BUILD_DIR}
166 use python && python_foreach_impl python_compile
167 else
168 emake -C lib
169 emake -C auparse
170 fi
171 }
172
173 multilib_src_install() {
174 if multilib_is_native_abi; then
175 emake DESTDIR="${D}" initdir="$(systemd_get_unitdir)" install
176
177 python_install() {
178 emake -C "${BUILD_DIR}"/swig \
179 VPATH="${native_build}/lib" \
180 DESTDIR="${D}" install
181 emake -C "${BUILD_DIR}"/bindings/python \
182 VPATH="${S}/bindings/python:${native_build}/bindings/python" \
183 DESTDIR="${D}" install
184 }
185
186 local native_build=${BUILD_DIR}
187 use python && python_foreach_impl python_install
188
189 # things like shadow use this so we need to be in /
190 gen_usr_ldscript -a audit auparse
191 else
192 emake -C lib DESTDIR="${D}" install
193 emake -C auparse DESTDIR="${D}" install
194 fi
195 }
196
197 multilib_src_install_all() {
198 dodoc AUTHORS ChangeLog README* THANKS TODO
199 docinto contrib
200 dodoc contrib/{*.rules,avc_snap,skeleton.c}
201 docinto contrib/plugin
202 dodoc contrib/plugin/*
203
204 newinitd "${FILESDIR}"/auditd-init.d-2.1.3 auditd
205 newconfd "${FILESDIR}"/auditd-conf.d-2.1.3 auditd
206
207 [ -f "${D}"/sbin/audisp-remote ] && \
208 dodir /usr/sbin && \
209 mv "${D}"/{sbin,usr/sbin}/audisp-remote || die
210
211 # Gentoo rules
212 insinto /etc/audit/
213 newins "${FILESDIR}"/audit.rules-2.1.3 audit.rules
214 doins "${FILESDIR}"/audit.rules.stop*
215
216 # audit logs go here
217 keepdir /var/log/audit/
218
219 # Security
220 lockdown_perms "${D}"
221
222 prune_libtool_files --modules
223 }
224
225 pkg_preinst() {
226 # Preserve from the audit-1 series
227 preserve_old_lib /$(get_libdir)/libau{dit,parse}.so.0
228 }
229
230 pkg_postinst() {
231 lockdown_perms "${ROOT}"
232 # Preserve from the audit-1 series
233 preserve_old_lib_notify /$(get_libdir)/libau{dit,parse}.so.0
234 }
235
236 lockdown_perms() {
237 # upstream wants these to have restrictive perms
238 basedir="$1"
239 chmod 0750 "${basedir}"/sbin/au{ditctl,report,dispd,ditd,search,trace} 2>/dev/null
240 chmod 0750 "${basedir}"/var/log/audit/ 2>/dev/null
241 chmod 0640 "${basedir}"/etc/{audit/,}{auditd.conf,audit.rules*} 2>/dev/null
242 }