checkpolicy-9999.ebuild 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. inherit toolchain-funcs
  5. MY_P="${P//_/-}"
  6. MY_RELEASEDATE="20161014"
  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_compile() {
  29. emake \
  30. CC="$(tc-getCC)" \
  31. YACC="bison -y" \
  32. LIBDIR="\$(PREFIX)/$(get_libdir)"
  33. }
  34. src_install() {
  35. emake DESTDIR="${D}" \
  36. LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \
  37. install
  38. if use debug; then
  39. dobin "${S}/test/dismod"
  40. dobin "${S}/test/dispol"
  41. fi
  42. }
  43. pkg_postinst() {
  44. einfo "This checkpolicy can compile version `checkpolicy -V |cut -f 1 -d ' '` policy."
  45. }