checkpolicy-2.5.ebuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit toolchain-funcs eutils
  5. MY_P="${P//_/-}"
  6. MY_RELEASEDATE="20160223"
  7. SEPOL_VER="${PV}"
  8. SEMNG_VER="${PV}"
  9. DESCRIPTION="SELinux policy compiler"
  10. HOMEPAGE="http://userspace.selinuxproject.org"
  11. if [[ ${PV} == 9999 ]] ; then
  12. inherit git-r3
  13. EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
  14. S="${WORKDIR}/${MY_P}/${PN}"
  15. else
  16. SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
  17. KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
  18. S="${WORKDIR}/${MY_P}"
  19. fi
  20. LICENSE="GPL-2"
  21. SLOT="0"
  22. IUSE="debug"
  23. DEPEND=">=sys-libs/libsepol-${SEPOL_VER}
  24. >=sys-libs/libsemanage-${SEMNG_VER}
  25. sys-devel/flex
  26. sys-devel/bison"
  27. RDEPEND=">=sys-libs/libsemanage-${SEMNG_VER}"
  28. src_prepare() {
  29. epatch_user
  30. }
  31. src_compile() {
  32. emake CC="$(tc-getCC)" YACC="bison -y" LIBDIR="\$(PREFIX)/$(get_libdir)"
  33. }
  34. src_install() {
  35. emake DESTDIR="${D}" install
  36. if use debug; then
  37. dobin "${S}/test/dismod"
  38. dobin "${S}/test/dispol"
  39. fi
  40. }
  41. pkg_postinst() {
  42. einfo "This checkpolicy can compile version `checkpolicy -V |cut -f 1 -d ' '` policy."
  43. }