autotools.eclass: Merge "support AM_GNU_GETTEXT_REQUIRE_VERSION"
[gentoo.git] / dev-util / sysdig / sysdig-0.1.104.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 inherit linux-mod bash-completion-r1 cmake-utils
8
9 DESCRIPTION="A system exploration and troubleshooting tool"
10 HOMEPAGE="http://www.sysdig.org/"
11 SRC_URI="https://github.com/draios/sysdig/archive/${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="+modules"
17
18 RDEPEND="
19         dev-lang/luajit:2=
20         >=dev-libs/jsoncpp-0.6_pre:0=
21         sys-libs/ncurses:0=
22         sys-libs/zlib:0="
23 DEPEND="${RDEPEND}
24         app-arch/xz-utils
25         virtual/os-headers"
26
27 # needed for the kernel module
28 CONFIG_CHECK="HAVE_SYSCALL_TRACEPOINTS ~TRACEPOINTS"
29
30 pkg_pretend() {
31         use modules && linux-mod_pkg_setup
32 }
33
34 pkg_setup() {
35         use modules && linux-mod_pkg_setup
36 }
37
38 src_prepare() {
39         sed -i -e 's:-ggdb::' CMakeLists.txt || die
40
41         cmake-utils_src_prepare
42 }
43
44 src_configure() {
45         local mycmakeargs=(
46                 # we will use linux-mod for that
47                 -DBUILD_DRIVER=OFF
48                 # libscap examples are not installed or really useful
49                 -DBUILD_LIBSCAP_EXAMPLES=OFF
50
51                 # unbundle the deps
52                 -DUSE_BUNDLED_LUAJIT=OFF
53                 -DLUAJIT_PREFIX="${EPREFIX}"/usr
54                 -DLUAJIT_INCLUDE="${EPREFIX}"/usr/include/luajit-2.0
55                 -DUSE_BUNDLED_JSONCPP=OFF
56                 -DJSONCPP_PREFIX="${EPREFIX}"/usr
57                 -DJSONCPP_INCLUDE="${EPREFIX}"/usr/include/jsoncpp
58                 -DUSE_BUNDLED_ZLIB=OFF
59                 -DUSE_BUNDLED_NCURSES=OFF
60                 -DZLIB_PREFIX="${EPREFIX}"/usr
61         )
62
63         cmake-utils_src_configure
64
65         # setup linux-mod ugliness
66         MODULE_NAMES="sysdig-probe(extra:${BUILD_DIR}/driver:)"
67         BUILD_TARGETS="driver"
68 }
69
70 src_compile() {
71         cmake-utils_src_compile
72
73         use modules && linux-mod_src_compile
74 }
75
76 src_install() {
77         cmake-utils_src_install
78
79         use modules && linux-mod_src_install
80
81         # remove sources
82         rm -r "${ED%/}"/usr/src || die
83
84         # move bashcomp to the proper location
85         dobashcomp "${ED%/}"/usr/etc/bash_completion.d/sysdig || die
86         rm -r "${ED%/}"/usr/etc || die
87 }