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

Contents of /sys-process/audit/audit-2.4.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Mar 21 13:19:16 2015 UTC (3 years, 5 months ago) by polynomial-c
Branch: MAIN
CVS Tags: HEAD
Version bump. Removed old

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)

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 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 sys-libs/libcap-ng"
25 DEPEND="${RDEPEND}
26 python? ( ${PYTHON_DEPS}
27 dev-lang/swig )
28 >=sys-kernel/linux-headers-2.6.34"
29 # Do not use os-headers as this is linux specific
30
31 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
32
33 CONFIG_CHECK="~AUDIT"
34
35 pkg_setup() {
36 linux-info_pkg_setup
37 }
38
39 src_prepare() {
40 # Do not build GUI tools
41 sed -i \
42 -e '/AC_CONFIG_SUBDIRS.*system-config-audit/d' \
43 "${S}"/configure.ac || die
44 sed -i \
45 -e 's,system-config-audit,,g' \
46 "${S}"/Makefile.am || die
47 rm -rf "${S}"/system-config-audit
48
49 if ! use ldap; then
50 sed -i \
51 -e '/^AC_OUTPUT/s,audisp/plugins/zos-remote/Makefile,,g' \
52 "${S}"/configure.ac || die
53 sed -i \
54 -e '/^SUBDIRS/s,zos-remote,,g' \
55 "${S}"/audisp/plugins/Makefile.am || die
56 fi
57
58 # Don't build static version of Python module.
59 epatch "${FILESDIR}"/${PN}-2.4.1-python.patch
60
61 # glibc/kernel upstreams suck with both defining ia64_fpreg
62 # This patch is a horribly workaround that is only valid as long as you
63 # don't need the OTHER definitions in fpu.h.
64 epatch "${FILESDIR}"/${PN}-2.1.3-ia64-compile-fix.patch
65
66 # Python bindings are built/installed manually.
67 sed -e "/^SUBDIRS =/s/ python//" -i bindings/Makefile.am
68 sed -e "/^SUBDIRS .*=/s/ swig//" -i Makefile.am
69
70 # Regenerate autotooling
71 eautoreconf
72
73 # Bug 352198: Avoid parallel build fail
74 cd "${S}"/src/mt
75 [[ ! -s private.h ]] && ln -s ../../lib/private.h .
76 }
77
78 multilib_src_configure() {
79 local ECONF_SOURCE=${S}
80 #append-flags -D'__attribute__(x)='
81 econf \
82 --sbindir=/sbin \
83 --enable-systemd \
84 --without-python
85
86 if multilib_is_native_abi; then
87 python_configure() {
88 mkdir -p "${BUILD_DIR}" || die
89 cd "${BUILD_DIR}" || die
90 econf --with-python
91 }
92
93 use python && python_foreach_impl python_configure
94 fi
95 }
96
97 multilib_src_compile() {
98 if multilib_is_native_abi; then
99 default
100
101 python_compile() {
102 emake -C "${BUILD_DIR}"/swig \
103 VPATH="${native_build}/lib" \
104 LIBS="${native_build}/lib/libaudit.la"
105 emake -C "${BUILD_DIR}"/bindings/python \
106 VPATH="${S}/bindings/python:${native_build}/bindings/python" \
107 auparse_la_LIBADD="${native_build}/auparse/libauparse.la ${native_build}/lib/libaudit.la"
108 }
109
110 local native_build=${BUILD_DIR}
111 use python && python_foreach_impl python_compile
112 else
113 emake -C lib
114 emake -C auparse
115 fi
116 }
117
118 multilib_src_install() {
119 if multilib_is_native_abi; then
120 emake DESTDIR="${D}" initdir="$(systemd_get_unitdir)" install
121
122 python_install() {
123 emake -C "${BUILD_DIR}"/swig \
124 VPATH="${native_build}/lib" \
125 DESTDIR="${D}" install
126 emake -C "${BUILD_DIR}"/bindings/python \
127 VPATH="${S}/bindings/python:${native_build}/bindings/python" \
128 DESTDIR="${D}" install
129 }
130
131 local native_build=${BUILD_DIR}
132 use python && python_foreach_impl python_install
133
134 # things like shadow use this so we need to be in /
135 gen_usr_ldscript -a audit auparse
136 else
137 emake -C lib DESTDIR="${D}" install
138 emake -C auparse DESTDIR="${D}" install
139 fi
140 }
141
142 multilib_src_install_all() {
143 dodoc AUTHORS ChangeLog README* THANKS TODO
144 docinto contrib
145 dodoc contrib/{*.rules,avc_snap,skeleton.c}
146 docinto contrib/plugin
147 dodoc contrib/plugin/*
148
149 newinitd "${FILESDIR}"/auditd-init.d-2.1.3 auditd
150 newconfd "${FILESDIR}"/auditd-conf.d-2.1.3 auditd
151
152 [ -f "${D}"/sbin/audisp-remote ] && \
153 dodir /usr/sbin && \
154 mv "${D}"/{sbin,usr/sbin}/audisp-remote || die
155
156 # Gentoo rules
157 insinto /etc/audit/
158 newins "${FILESDIR}"/audit.rules-2.1.3 audit.rules
159 doins "${FILESDIR}"/audit.rules.stop*
160
161 # audit logs go here
162 keepdir /var/log/audit/
163
164 # Security
165 lockdown_perms "${D}"
166
167 prune_libtool_files --modules
168 }
169
170 pkg_preinst() {
171 # Preserve from the audit-1 series
172 preserve_old_lib /$(get_libdir)/libau{dit,parse}.so.0
173 }
174
175 pkg_postinst() {
176 lockdown_perms "${ROOT}"
177 # Preserve from the audit-1 series
178 preserve_old_lib_notify /$(get_libdir)/libau{dit,parse}.so.0
179 }
180
181 lockdown_perms() {
182 # upstream wants these to have restrictive perms
183 basedir="$1"
184 chmod 0750 "${basedir}"/sbin/au{ditctl,report,dispd,ditd,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 }

  ViewVC Help
Powered by ViewVC 1.1.20