ply-0_pre20160313.ebuild 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools linux-info
  5. DESCRIPTION="Dynamic instrumentation of the Linux kernel with BPF and kprobes"
  6. HOMEPAGE="https://github.com/iovisor/ply"
  7. EGIT_COMMIT="cfc56c789ad1eff1080ecb0dad18d009b91ae8ea"
  8. SRC_URI="https://github.com/iovisor/ply/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE=""
  13. S=${WORKDIR}/${PN}-${EGIT_COMMIT}
  14. pkg_pretend() {
  15. local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
  16. ~BPF_JIT ~HAVE_BPF_JIT ~BPF_EVENTS"
  17. check_extra_config
  18. }
  19. src_prepare() {
  20. eapply_user
  21. eautoreconf
  22. default
  23. }
  24. src_configure() {
  25. local econf_args=() kerneldir_orig
  26. if [[ -d ${KERNEL_DIR} ]]; then
  27. # Using KBUILD_OUTPUT can fail, depending on the source tree
  28. # state (it might demand that we make mrproper). Therefore,
  29. # create a symlink copy of the source tree so that we are free
  30. # to clean things up as needed.
  31. kerneldir_orig=${KERNEL_DIR}
  32. cp -sR "$(realpath "${kerneldir_orig}")" "${T}/kerneldir" || die
  33. export KERNEL_DIR="${T}/kerneldir"
  34. pushd "${KERNEL_DIR}" || die
  35. # avoid sandbox violation for scripts/kconfig/.conf.cmd
  36. find . -name '\.*' -delete
  37. cp "${kerneldir_orig}/.config" ./.config || die
  38. set_arch_to_kernel
  39. make mrproper oldconfig prepare || die
  40. popd || die
  41. econf_args+=(--with-kerneldir="${KERNEL_DIR}")
  42. fi
  43. econf "${econf_args[@]}"
  44. }
  45. src_install() {
  46. default
  47. rm -f "${ED}/usr/share/doc/${P}/COPYING"
  48. }