/[gentoo-x86]/sys-process/audit/audit-2.2.2-r3.ebuild
Gentoo

Contents of /sys-process/audit/audit-2.2.2-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat May 16 05:56:03 2015 UTC (3 years, 4 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Bug 448470: adjust preserved libs.

(Portage version: 2.2.18/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-process/audit/audit-2.2.2-r2.ebuild,v 1.9 2014/09/15 08:24:25 ago Exp $
4
5 EAPI="5"
6
7 PYTHON_COMPAT=( python2_7 )
8
9 inherit autotools multilib multilib-minimal toolchain-funcs python-r1 linux-info eutils systemd
10
11 DESCRIPTION="Userspace utilities for storing and processing auditing records"
12 HOMEPAGE="http://people.redhat.com/sgrubb/audit/"
13 SRC_URI="http://people.redhat.com/sgrubb/audit/${P}.tar.gz"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
18 IUSE="ldap prelude python"
19 # Testcases are pretty useless as they are built for RedHat users/groups and
20 # kernels.
21 RESTRICT="test"
22
23 RDEPEND="ldap? ( net-nds/openldap )
24 prelude? ( dev-libs/libprelude )
25 sys-libs/libcap-ng"
26 DEPEND="${RDEPEND}
27 python? ( dev-lang/swig )
28 >=sys-kernel/linux-headers-2.6.34"
29 # Do not use os-headers as this is linux specific
30
31 CONFIG_CHECK="~AUDIT"
32
33 pkg_setup() {
34 linux-info_pkg_setup
35 }
36
37 src_prepare() {
38 # Old patch applies fine
39 #EPATCH_OPTS="-p0 -d${S}" epatch "${FILESDIR}"/${PN}-1.5.4-build.patch
40
41 # Applied by upstream
42 #EPATCH_OPTS="-p1 -d${S}" epatch "${FILESDIR}"/${PN}-1.5.4-swig-gcc-attribute.patch
43
44 # Do not build GUI tools
45 sed -i \
46 -e '/AC_CONFIG_SUBDIRS.*system-config-audit/d' \
47 "${S}"/configure.ac || die
48 sed -i \
49 -e 's,system-config-audit,,g' \
50 "${S}"/Makefile.am || die
51 rm -rf "${S}"/system-config-audit
52
53 # Probably goes away in 1.6.9
54 #EPATCH_OPTS="-p1 -d${S}" epatch "${FILESDIR}"/audit-1.6.8-subdirs-fix.patch
55
56 if ! use ldap; then
57 sed -i \
58 -e '/^AC_OUTPUT/s,audisp/plugins/zos-remote/Makefile,,g' \
59 "${S}"/configure.ac || die
60 sed -i \
61 -e '/^SUBDIRS/s,zos-remote,,g' \
62 "${S}"/audisp/plugins/Makefile.am || die
63 fi
64
65 # Don't build static version of Python module.
66 epatch "${FILESDIR}"/${PN}-2.1.3-python.patch
67
68 # glibc/kernel upstreams suck with both defining ia64_fpreg
69 # This patch is a horribly workaround that is only valid as long as you
70 # don't need the OTHER definitions in fpu.h.
71 epatch "${FILESDIR}"/${PN}-2.1.3-ia64-compile-fix.patch
72
73 # Python bindings are built/installed manually.
74 sed -e "/^SUBDIRS =/s/ python//" -i bindings/Makefile.am
75 sed -e "/^SUBDIRS .*=/s/ swig//" -i Makefile.am
76
77 # Regenerate autotooling
78 eautoreconf
79
80 # Bug 352198: Avoid parallel build fail
81 cd "${S}"/src/mt
82 [[ ! -s private.h ]] && ln -s ../../lib/private.h .
83 }
84
85 multilib_src_configure() {
86 local ECONF_SOURCE=${S}
87 #append-flags -D'__attribute__(x)='
88 econf \
89 --sbindir=/sbin \
90 --enable-systemd \
91 --without-python \
92 $(multilib_native_use_with prelude)
93
94 if multilib_is_native_abi; then
95 python_configure() {
96 mkdir -p "${BUILD_DIR}" || die
97 cd "${BUILD_DIR}" || die
98 econf --with-python
99 }
100
101 use python && python_foreach_impl python_configure
102 fi
103 }
104
105 multilib_src_compile() {
106 if multilib_is_native_abi; then
107 default
108
109 python_compile() {
110 emake -C "${BUILD_DIR}"/swig \
111 VPATH="${native_build}/lib" \
112 LIBS="${native_build}/lib/libaudit.la"
113 emake -C "${BUILD_DIR}"/bindings/python \
114 VPATH="${S}/bindings/python:${native_build}/bindings/python" \
115 auparse_la_LIBADD="${native_build}/auparse/libauparse.la ${native_build}/lib/libaudit.la"
116 }
117
118 local native_build=${BUILD_DIR}
119 use python && python_foreach_impl python_compile
120 else
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_unitdir)" install
129
130 python_install() {
131 emake -C "${BUILD_DIR}"/swig \
132 VPATH="${native_build}/lib" \
133 DESTDIR="${D}" install
134 emake -C "${BUILD_DIR}"/bindings/python \
135 VPATH="${S}/bindings/python:${native_build}/bindings/python" \
136 DESTDIR="${D}" install
137 }
138
139 local native_build=${BUILD_DIR}
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 TODO
152 docinto contrib
153 dodoc contrib/{*.rules,avc_snap,skeleton.c}
154 docinto contrib/plugin
155 dodoc contrib/plugin/*
156
157 newinitd "${FILESDIR}"/auditd-init.d-2.1.3 auditd
158 newconfd "${FILESDIR}"/auditd-conf.d-2.1.3 auditd
159
160 [ -f "${D}"/sbin/audisp-remote ] && \
161 dodir /usr/sbin && \
162 mv "${D}"/{sbin,usr/sbin}/audisp-remote || die
163
164 # Gentoo rules
165 insinto /etc/audit/
166 newins "${FILESDIR}"/audit.rules-2.1.3 audit.rules
167 doins "${FILESDIR}"/audit.rules.stop*
168
169 # audit logs go here
170 keepdir /var/log/audit/
171
172 # Security
173 lockdown_perms "${D}"
174
175 prune_libtool_files --modules
176 }
177
178 pkg_preinst() {
179 # Preserve from the audit-1 series
180 preserve_old_lib /$(get_libdir)/libaudit.so.0
181 }
182
183 pkg_postinst() {
184 lockdown_perms "${ROOT}"
185 # Preserve from the audit-1 series
186 preserve_old_lib_notify /$(get_libdir)/libaudit.so.0
187 }
188
189 lockdown_perms() {
190 # upstream wants these to have restrictive perms
191 basedir="$1"
192 chmod 0750 "${basedir}"/sbin/au{ditctl,report,dispd,ditd,search,trace} 2>/dev/null
193 chmod 0750 "${basedir}"/var/log/audit/ 2>/dev/null
194 chmod 0640 "${basedir}"/etc/{audit/,}{auditd.conf,audit.rules*} 2>/dev/null
195 }

  ViewVC Help
Powered by ViewVC 1.1.20