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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Fri Oct 15 21:15:49 2010 UTC (3 years, 11 months ago) by arfrever
Branch: MAIN
Changes since 1.3: +23 -11 lines
Update EAPI, fix dependencies, use Python 2, don't install .a, .la and .pyc files in Python site-packages directories, fix calls to python_mod_optimize() and python_mod_cleanup() (bug #316965).

(Portage version: 2.2_rc96_p20/cvs/Linux x86_64)

1 armin76 1.2 # Copyright 1999-2010 Gentoo Foundation
2 robbat2 1.1 # Distributed under the terms of the GNU General Public License v2
3 arfrever 1.4 # $Header: /var/cvsroot/gentoo-x86/sys-process/audit/audit-1.7.4.ebuild,v 1.3 2010/08/24 13:56:22 ssuominen Exp $
4    
5     EAPI="3"
6     PYTHON_DEPEND="2"
7 robbat2 1.1
8     inherit autotools multilib toolchain-funcs python
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 armin76 1.2 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
17 robbat2 1.1 IUSE="ldap"
18     # Testcases are pretty useless as they are built for RedHat users/groups and
19     # kernels.
20     RESTRICT="test"
21    
22 arfrever 1.4 RDEPEND="ldap? ( net-nds/openldap )"
23 robbat2 1.1 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 arfrever 1.4 pkg_setup() {
29     python_set_active_version 2
30     python_pkg_setup
31     }
32 robbat2 1.1
33 arfrever 1.4 src_prepare() {
34 robbat2 1.1 # 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 ssuominen 1.3 epatch "${FILESDIR}"/${P}-glibc212.patch
63    
64 arfrever 1.4 # Don't build static version of Python module.
65     epatch "${FILESDIR}"/${P}-python.patch
66    
67 robbat2 1.1 # Regenerate autotooling
68     eautoreconf
69 arfrever 1.4
70     # Disable byte-compilation of Python modules.
71     echo "#!/bin/sh" > py-compile
72 robbat2 1.1 }
73    
74 arfrever 1.4 src_configure() {
75 robbat2 1.1 #append-flags -D'__attribute__(x)='
76 arfrever 1.4 econf --sbindir=/sbin --without-prelude
77 robbat2 1.1 }
78    
79     src_install() {
80     emake DESTDIR="${D}" install || die "emake install failed"
81     dodoc AUTHORS ChangeLog README* THANKS TODO
82     docinto contrib
83     dodoc contrib/*
84     docinto contrib/plugin
85     dodoc contrib/plugin/*
86    
87     newinitd "${FILESDIR}"/auditd-init.d-1.2.3 auditd
88     newconfd "${FILESDIR}"/auditd-conf.d-1.2.3 auditd
89    
90     # things like shadow use this so we need to be in /
91     dodir /$(get_libdir)
92     mv "${D}"/usr/$(get_libdir)/lib*.so* "${D}"/$(get_libdir)/ || die
93     gen_usr_ldscript libaudit.so libauparse.so
94    
95     # remove RedHat garbage
96     rm -r "${D}"/etc/{rc.d,sysconfig} || die
97    
98     # Gentoo rules
99     insinto /etc/audit/
100     doins "${FILESDIR}"/audit.rules*
101    
102     # audit logs go here
103     keepdir /var/log/audit/
104    
105     # Security
106     lockdown_perms "${D}"
107 arfrever 1.4
108     # Don't install .la files in Python directories.
109     python_clean_installation_image
110 robbat2 1.1 }
111    
112     pkg_postinst() {
113     lockdown_perms "${ROOT}"
114 arfrever 1.4 python_mod_optimize audit.py
115 robbat2 1.1 }
116    
117     pkg_postrm() {
118 arfrever 1.4 python_mod_cleanup audit.py
119 robbat2 1.1 }
120    
121     lockdown_perms() {
122     # upstream wants these to have restrictive perms
123     basedir="$1"
124     chmod 0750 "${basedir}"/sbin/au{ditctl,report,dispd,ditd,search,trace} 2>/dev/null
125     chmod 0750 "${basedir}"/var/log/audit/ 2>/dev/null
126     chmod 0640 "${basedir}"/etc/{audit/,}{auditd.conf,audit.rules*} 2>/dev/null
127     }

  ViewVC Help
Powered by ViewVC 1.1.20