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