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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Dec 18 21:57:17 2012 UTC (5 years, 7 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Bug #405887: fix for newer system headers; bug #405897: bump to 1.7.18.

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

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-process/audit/audit-1.7.17.ebuild,v 1.6 2012/05/21 23:23:36 vapier Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="2"
7
8 inherit autotools eutils multilib toolchain-funcs python eutils
9
10 DESCRIPTION="Userspace utilities for storing and processing auditing records"
11 HOMEPAGE="http://people.redhat.com/sgrubb/audit/"
12 SRC_URI="http://people.redhat.com/sgrubb/audit/${P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
17 IUSE="ldap"
18 # Testcases are pretty useless as they are built for RedHat users/groups and
19 # kernels.
20 RESTRICT="test"
21
22 RDEPEND="ldap? ( net-nds/openldap )"
23 DEPEND="${RDEPEND}
24 dev-lang/swig
25 >=sys-kernel/linux-headers-2.6.23"
26 # Do not use os-headers as this is linux specific
27
28 pkg_setup() {
29 python_set_active_version 2
30 python_pkg_setup
31 }
32
33 src_prepare() {
34 # Old patch applies fine
35 #EPATCH_OPTS="-p0 -d${S}" epatch "${FILESDIR}"/${PN}-1.5.4-build.patch
36
37 # Applied by upstream
38 #EPATCH_OPTS="-p1 -d${S}" epatch "${FILESDIR}"/${PN}-1.5.4-swig-gcc-attribute.patch
39
40 # Do not build GUI tools
41 sed -i \
42 -e '/AC_CONFIG_SUBDIRS.*system-config-audit/d' \
43 "${S}"/configure.ac
44 sed -i \
45 -e 's,system-config-audit,,g' \
46 -e '/^SUBDIRS/s,\\$,,g' \
47 "${S}"/Makefile.am
48 rm -rf "${S}"/system-config-audit
49
50 # Probably goes away in 1.6.9
51 #EPATCH_OPTS="-p1 -d${S}" epatch "${FILESDIR}"/audit-1.6.8-subdirs-fix.patch
52
53 if ! use ldap; then
54 sed -i \
55 -e '/^AC_OUTPUT/s,audisp/plugins/zos-remote/Makefile,,g' \
56 "${S}"/configure.ac
57 sed -i \
58 -e '/^SUBDIRS/s,zos-remote,,g' \
59 "${S}"/audisp/plugins/Makefile.am
60 fi
61
62 # Don't build static version of Python module.
63 epatch "${FILESDIR}"/${PN}-1.7.17-python.patch
64 # bug #405887
65 epatch "${FILESDIR}"/audit-1.7.18-as-needed.patch
66 epatch "${FILESDIR}"/audit-1.7.18-missing_headers.patch
67
68 # Regenerate autotooling
69 eautoreconf
70
71 # Disable byte-compilation of Python modules.
72 echo "#!/bin/sh" > py-compile
73
74 # Bug 352198: Avoid parallel build fail
75 cd "${S}"/src/mt
76 [[ ! -s private.h ]] && ln -s ../../lib/private.h .
77 }
78
79 src_configure() {
80 #append-flags -D'__attribute__(x)='
81 econf --sbindir=/sbin --without-prelude
82 }
83
84 src_install() {
85 emake DESTDIR="${D}" install || die "emake install failed"
86 dodoc AUTHORS ChangeLog README* THANKS TODO
87 docinto contrib
88 dodoc contrib/*
89 docinto contrib/plugin
90 dodoc contrib/plugin/*
91
92 newinitd "${FILESDIR}"/auditd-init.d-1.7.17 auditd
93 newconfd "${FILESDIR}"/auditd-conf.d-1.2.3 auditd
94
95 # things like shadow use this so we need to be in /
96 dodir /$(get_libdir)
97 mv "${D}"/usr/$(get_libdir)/lib*.so* "${D}"/$(get_libdir)/ || die
98 gen_usr_ldscript libaudit.so libauparse.so
99
100 # remove RedHat garbage
101 rm -r "${D}"/etc/{rc.d,sysconfig} || die
102
103 # Gentoo rules
104 insinto /etc/audit/
105 doins "${FILESDIR}"/audit.rules*
106
107 # audit logs go here
108 keepdir /var/log/audit/
109
110 # Security
111 lockdown_perms "${D}"
112
113 # Don't install .la files in Python directories.
114 python_clean_installation_image
115 }
116
117 pkg_postinst() {
118 lockdown_perms "${ROOT}"
119 python_mod_optimize audit.py
120 }
121
122 pkg_postrm() {
123 python_mod_cleanup audit.py
124 }
125
126 lockdown_perms() {
127 # upstream wants these to have restrictive perms
128 basedir="$1"
129 chmod 0750 "${basedir}"/sbin/au{ditctl,report,dispd,ditd,search,trace} 2>/dev/null
130 chmod 0750 "${basedir}"/var/log/audit/ 2>/dev/null
131 chmod 0640 "${basedir}"/etc/{audit/,}{auditd.conf,audit.rules*} 2>/dev/null
132 }

  ViewVC Help
Powered by ViewVC 1.1.20