Merge remote-tracking branch 'remotes/github/pr/975'
[gentoo.git] / sys-apps / checkpolicy / checkpolicy-2.2.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit toolchain-funcs eutils
8
9 SEPOL_VER="2.2"
10 SEMNG_VER="2.2"
11
12 DESCRIPTION="SELinux policy compiler"
13 HOMEPAGE="http://userspace.selinuxproject.org"
14 SRC_URI="http://userspace.selinuxproject.org/releases/20131030/${P}.tar.gz"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="amd64 x86"
19 IUSE="debug"
20
21 DEPEND=">=sys-libs/libsepol-${SEPOL_VER}
22         >=sys-libs/libsemanage-${SEMNG_VER}
23         sys-devel/flex
24         sys-devel/bison"
25
26 RDEPEND=">=sys-libs/libsemanage-${SEMNG_VER}"
27
28 src_compile() {
29         emake CC="$(tc-getCC)" YACC="bison -y" || die
30 }
31
32 src_prepare() {
33         epatch_user
34 }
35
36 src_install() {
37         emake DESTDIR="${D}" install || die
38
39         if use debug; then
40                 dobin "${S}/test/dismod"
41                 dobin "${S}/test/dispol"
42         fi
43 }
44
45 pkg_postinst() {
46         einfo "This checkpolicy can compile version `checkpolicy -V |cut -f 1 -d ' '` policy."
47 }