sysdig-0.12.1.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
  5. MODULES_OPTIONAL_USE=modules
  6. inherit linux-mod bash-completion-r1 cmake-utils
  7. DESCRIPTION="A system exploration and troubleshooting tool"
  8. HOMEPAGE="http://www.sysdig.org/"
  9. SRC_URI="https://github.com/draios/sysdig/archive/${PV}.tar.gz -> ${P}.tar.gz"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE="+modules"
  14. RDEPEND="
  15. app-misc/jq:0=
  16. dev-lang/luajit:2=
  17. >=dev-libs/jsoncpp-0.6_pre:0=
  18. dev-libs/libb64:0=
  19. sys-libs/ncurses:0=
  20. sys-libs/zlib:0=
  21. dev-libs/openssl:0=
  22. net-misc/curl:0="
  23. DEPEND="${RDEPEND}
  24. app-arch/xz-utils
  25. virtual/os-headers"
  26. # needed for the kernel module
  27. CONFIG_CHECK="HAVE_SYSCALL_TRACEPOINTS ~TRACEPOINTS"
  28. pkg_pretend() {
  29. linux-mod_pkg_setup
  30. }
  31. pkg_setup() {
  32. linux-mod_pkg_setup
  33. }
  34. src_prepare() {
  35. sed -i -e 's:-ggdb::' CMakeLists.txt || die
  36. cmake-utils_src_prepare
  37. }
  38. src_configure() {
  39. local mycmakeargs=(
  40. # we will use linux-mod for that
  41. -DBUILD_DRIVER=OFF
  42. # libscap examples are not installed or really useful
  43. -DBUILD_LIBSCAP_EXAMPLES=OFF
  44. # unbundle the deps
  45. -DUSE_BUNDLED_DEPS=OFF
  46. )
  47. cmake-utils_src_configure
  48. # setup linux-mod ugliness
  49. MODULE_NAMES="sysdig-probe(extra:${S}/driver:)"
  50. BUILD_PARAMS='KERNELDIR="${KERNEL_DIR}"'
  51. BUILD_TARGETS="all"
  52. if use modules; then
  53. cmake-utils_src_make configure_driver
  54. cp "${BUILD_DIR}"/driver/Makefile.dkms driver/Makefile || die
  55. fi
  56. }
  57. src_compile() {
  58. cmake-utils_src_compile
  59. linux-mod_src_compile
  60. }
  61. src_install() {
  62. cmake-utils_src_install
  63. linux-mod_src_install
  64. # remove sources
  65. rm -r "${ED%/}"/usr/src || die
  66. # move bashcomp to the proper location
  67. dobashcomp "${ED%/}"/usr/etc/bash_completion.d/sysdig || die
  68. rm -r "${ED%/}"/usr/etc || die
  69. }