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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon May 21 23:23:36 2012 UTC (2 years, 3 months ago) by vapier
Branch: MAIN
Changes since 1.3: +2 -2 lines
Inherit eutils for epatch.

(Portage version: 2.2.0_alpha102/cvs/Linux x86_64)

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-2.1.3.ebuild,v 1.3 2012/02/26 04:05:50 patrick Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="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 ~sparc ~x86"
19 IUSE="ldap prelude"
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 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
34 pkg_setup() {
35 linux-info_pkg_setup
36 python_pkg_setup
37 PYTHON_DIRS="bindings/python swig"
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 # Python bindings are built/installed manually.
72 sed -e "/^SUBDIRS =/s/ python//" -i bindings/Makefile.am
73 sed -e "/^SUBDIRS =/s/ swig//" -i Makefile.am
74
75 # Regenerate autotooling
76 eautoreconf
77
78 # Disable byte-compilation of Python modules.
79 echo "#!/bin/sh" > py-compile
80
81 # Bug 352198: Avoid parallel build fail
82 cd "${S}"/src/mt
83 [[ ! -s private.h ]] && ln -s ../../lib/private.h .
84 }
85
86 src_configure() {
87 #append-flags -D'__attribute__(x)='
88 econf --sbindir=/sbin $(use_with prelude)
89 }
90
91 src_compile() {
92 default
93
94 python_copy_sources ${PYTHON_DIRS}
95
96 building() {
97 emake \
98 PYTHON_VERSION="$(python_get_version)" \
99 pyexecdir="$(python_get_sitedir)"
100 }
101 local dir
102 for dir in ${PYTHON_DIRS}; do
103 python_execute_function -s --source-dir ${dir} building
104 done
105 }
106
107 src_install() {
108 emake DESTDIR="${D}" install || die
109
110 installation() {
111 emake \
112 DESTDIR="${D}" \
113 PYTHON_VERSION="$(python_get_version)" \
114 pyexecdir="$(python_get_sitedir)" \
115 install
116 }
117 local dir
118 for dir in ${PYTHON_DIRS}; do
119 python_execute_function -s --source-dir ${dir} installation
120 done
121
122 dodoc AUTHORS ChangeLog README* THANKS TODO
123 docinto contrib
124 dodoc contrib/*
125 docinto contrib/plugin
126 dodoc contrib/plugin/*
127
128 newinitd "${FILESDIR}"/auditd-init.d-2.1.3 auditd
129 newconfd "${FILESDIR}"/auditd-conf.d-2.1.3 auditd
130
131 # things like shadow use this so we need to be in /
132 dodir /$(get_libdir)
133 mv "${D}"/usr/$(get_libdir)/lib*.so* "${D}"/$(get_libdir)/ || die
134 gen_usr_ldscript libaudit.so libauparse.so
135
136 # remove RedHat garbage
137 rm -r "${D}"/etc/{rc.d,sysconfig} || die
138
139 # Gentoo rules
140 insinto /etc/audit/
141 newins "${FILESDIR}"/audit.rules-2.1.3 audit.rules
142 doins "${FILESDIR}"/audit.rules.stop*
143
144 # audit logs go here
145 keepdir /var/log/audit/
146
147 # Security
148 lockdown_perms "${D}"
149
150 # Don't install .la files in Python directories.
151 python_clean_installation_image
152 }
153
154 pkg_postinst() {
155 lockdown_perms "${ROOT}"
156 python_mod_optimize audit.py
157 }
158
159 pkg_postrm() {
160 python_mod_cleanup audit.py
161 }
162
163 lockdown_perms() {
164 # upstream wants these to have restrictive perms
165 basedir="$1"
166 chmod 0750 "${basedir}"/sbin/au{ditctl,report,dispd,ditd,search,trace} 2>/dev/null
167 chmod 0750 "${basedir}"/var/log/audit/ 2>/dev/null
168 chmod 0640 "${basedir}"/etc/{audit/,}{auditd.conf,audit.rules*} 2>/dev/null
169 }

  ViewVC Help
Powered by ViewVC 1.1.20