sys-block/btrace: Merge GitHub PR #1716
[gentoo.git] / sys-apps / checkpolicy / checkpolicy-2.5.ebuild
1 # Copyright 1999-2016 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 MY_P="${P//_/-}"
10 MY_RELEASEDATE="20160223"
11
12 SEPOL_VER="${PV}"
13 SEMNG_VER="${PV}"
14
15 DESCRIPTION="SELinux policy compiler"
16 HOMEPAGE="http://userspace.selinuxproject.org"
17
18 if [[ ${PV} == 9999 ]] ; then
19         inherit git-r3
20         EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
21         S="${WORKDIR}/${MY_P}/${PN}"
22 else
23         SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
24         KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
25         S="${WORKDIR}/${MY_P}"
26 fi
27
28 LICENSE="GPL-2"
29 SLOT="0"
30 IUSE="debug"
31
32 DEPEND=">=sys-libs/libsepol-${SEPOL_VER}
33         >=sys-libs/libsemanage-${SEMNG_VER}
34         sys-devel/flex
35         sys-devel/bison"
36
37 RDEPEND=">=sys-libs/libsemanage-${SEMNG_VER}"
38
39 src_prepare() {
40         epatch_user
41 }
42
43 src_compile() {
44         emake CC="$(tc-getCC)" YACC="bison -y" LIBDIR="\$(PREFIX)/$(get_libdir)"
45 }
46
47 src_install() {
48         emake DESTDIR="${D}" install
49
50         if use debug; then
51                 dobin "${S}/test/dismod"
52                 dobin "${S}/test/dispol"
53         fi
54 }
55
56 pkg_postinst() {
57         einfo "This checkpolicy can compile version `checkpolicy -V |cut -f 1 -d ' '` policy."
58 }