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

Contents of /sys-process/audit/audit-2.1.3-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (show annotations) (download)
Sun Mar 3 10:25:39 2013 UTC (5 years, 3 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.17: +3 -3 lines
Add s390 lovin.

(Portage version: 2.2.0_alpha164/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)

1 # Copyright 1999-2013 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.1.3-r1.ebuild,v 1.17 2012/12/31 21:44:31 ago Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="python? 2"
7 SUPPORT_PYTHON_ABIS="1"
8 RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*"
9
10 inherit autotools multilib toolchain-funcs python linux-info eutils
11
12 DESCRIPTION="Userspace utilities for storing and processing auditing records"
13 HOMEPAGE="http://people.redhat.com/sgrubb/audit/"
14 SRC_URI="http://people.redhat.com/sgrubb/audit/${P}.tar.gz"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 s390 sparc x86"
19 IUSE="ldap prelude python"
20 # Testcases are pretty useless as they are built for RedHat users/groups and
21 # kernels.
22 RESTRICT="test"
23
24 RDEPEND="ldap? ( net-nds/openldap )
25 prelude? ( dev-libs/libprelude )
26 sys-libs/libcap-ng"
27 DEPEND="${RDEPEND}
28 python? ( dev-lang/swig )
29 >=sys-kernel/linux-headers-2.6.34"
30 # Do not use os-headers as this is linux specific
31
32 CONFIG_CHECK="~AUDIT"
33 PYTHON_DIRS="bindings/python swig"
34
35 pkg_setup() {
36 linux-info_pkg_setup
37 use python && python_pkg_setup
38 }
39
40 src_prepare() {
41 # Old patch applies fine
42 #EPATCH_OPTS="-p0 -d${S}" epatch "${FILESDIR}"/${PN}-1.5.4-build.patch
43
44 # Applied by upstream
45 #EPATCH_OPTS="-p1 -d${S}" epatch "${FILESDIR}"/${PN}-1.5.4-swig-gcc-attribute.patch
46
47 # Do not build GUI tools
48 sed -i \
49 -e '/AC_CONFIG_SUBDIRS.*system-config-audit/d' \
50 "${S}"/configure.ac || die
51 sed -i \
52 -e 's,system-config-audit,,g' \
53 "${S}"/Makefile.am || die
54 rm -rf "${S}"/system-config-audit
55
56 # Probably goes away in 1.6.9
57 #EPATCH_OPTS="-p1 -d${S}" epatch "${FILESDIR}"/audit-1.6.8-subdirs-fix.patch
58
59 if ! use ldap; then
60 sed -i \
61 -e '/^AC_OUTPUT/s,audisp/plugins/zos-remote/Makefile,,g' \
62 "${S}"/configure.ac || die
63 sed -i \
64 -e '/^SUBDIRS/s,zos-remote,,g' \
65 "${S}"/audisp/plugins/Makefile.am || die
66 fi
67
68 # Don't build static version of Python module.
69 epatch "${FILESDIR}"/${PN}-2.1.3-python.patch
70
71 # glibc/kernel upstreams suck with both defining ia64_fpreg
72 # This patch is a horribly workaround that is only valid as long as you
73 # don't need the OTHER definitions in fpu.h.
74 epatch "${FILESDIR}"/${PN}-2.1.3-ia64-compile-fix.patch
75
76 # Python bindings are built/installed manually.
77 sed -e "/^SUBDIRS =/s/ python//" -i bindings/Makefile.am
78 sed -e "/^SUBDIRS .*=/s/ swig//" -i Makefile.am
79
80 # Regenerate autotooling
81 eautoreconf
82
83 # Disable byte-compilation of Python modules.
84 echo "#!/bin/sh" > py-compile
85
86 # Bug 352198: Avoid parallel build fail
87 cd "${S}"/src/mt
88 [[ ! -s private.h ]] && ln -s ../../lib/private.h .
89 }
90
91 src_configure() {
92 #append-flags -D'__attribute__(x)='
93 econf --sbindir=/sbin $(use_with prelude)
94 }
95
96 src_compile_python() {
97 python_copy_sources ${PYTHON_DIRS}
98
99 building() {
100 emake \
101 PYTHON_VERSION="$(python_get_version)" \
102 pyexecdir="$(python_get_sitedir)"
103 }
104 local dir
105 for dir in ${PYTHON_DIRS}; do
106 python_execute_function -s --source-dir ${dir} building
107 done
108 }
109
110 src_compile() {
111 default
112 use python && src_compile_python
113 }
114
115 src_install_python() {
116 installation() {
117 emake \
118 DESTDIR="${D}" \
119 PYTHON_VERSION="$(python_get_version)" \
120 pyexecdir="$(python_get_sitedir)" \
121 install
122 }
123 local dir
124 for dir in ${PYTHON_DIRS}; do
125 python_execute_function -s --source-dir ${dir} installation
126 done
127 }
128
129 src_install() {
130 emake DESTDIR="${D}" install || die
131 use python && src_install_python
132
133 dodoc AUTHORS ChangeLog README* THANKS TODO
134 docinto contrib
135 dodoc contrib/{*.rules,avc_snap,skeleton.c}
136 docinto contrib/plugin
137 dodoc contrib/plugin/*
138
139 newinitd "${FILESDIR}"/auditd-init.d-2.1.3 auditd
140 newconfd "${FILESDIR}"/auditd-conf.d-2.1.3 auditd
141
142 # things like shadow use this so we need to be in /
143 gen_usr_ldscript -a audit auparse
144
145 [ -f "${D}"/sbin/audisp-remote ] && \
146 dodir /usr/sbin && \
147 mv "${D}"/{sbin,usr/sbin}/audisp-remote || die
148
149 # remove RedHat garbage
150 rm -r "${D}"/etc/{rc.d,sysconfig} || die
151
152 # Gentoo rules
153 insinto /etc/audit/
154 newins "${FILESDIR}"/audit.rules-2.1.3 audit.rules
155 doins "${FILESDIR}"/audit.rules.stop*
156
157 # audit logs go here
158 keepdir /var/log/audit/
159
160 # Security
161 lockdown_perms "${D}"
162
163 # Don't install .la files in Python directories.
164 use python && python_clean_installation_image
165 }
166
167 pkg_preinst() {
168 # Preserve from the audit-1 series
169 preserve_old_lib /$(get_libdir)/libau{dit,parse}.so.0
170 }
171
172 pkg_postinst() {
173 lockdown_perms "${ROOT}"
174 use python && python_mod_optimize audit.py
175 # Preserve from the audit-1 series
176 preserve_old_lib_notify /$(get_libdir)/libau{dit,parse}.so.0
177 }
178
179 pkg_postrm() {
180 use python && python_mod_cleanup audit.py
181 }
182
183 lockdown_perms() {
184 # upstream wants these to have restrictive perms
185 basedir="$1"
186 chmod 0750 "${basedir}"/sbin/au{ditctl,report,dispd,ditd,search,trace} 2>/dev/null
187 chmod 0750 "${basedir}"/var/log/audit/ 2>/dev/null
188 chmod 0640 "${basedir}"/etc/{audit/,}{auditd.conf,audit.rules*} 2>/dev/null
189 }

  ViewVC Help
Powered by ViewVC 1.1.20