Use https by default
[gentoo.git] / dev-util / sysdig / sysdig-0.1.92.ebuild
1 # Copyright 1999-2014 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 # mirrored from https://github.com/draios/sysdig/archive/${PV}.tar.gz
12 SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="+modules"
18
19 RDEPEND="dev-lang/luajit:2=
20         dev-libs/jsoncpp:0=
21         sys-libs/zlib:0="
22 DEPEND="${RDEPEND}
23         app-arch/xz-utils
24         virtual/os-headers"
25
26 # needed for the kernel module
27 CONFIG_CHECK="HAVE_SYSCALL_TRACEPOINTS TRACEPOINTS"
28
29 pkg_pretend() {
30         use modules && linux-mod_pkg_setup
31 }
32
33 pkg_setup() {
34         use modules && linux-mod_pkg_setup
35 }
36
37 src_prepare() {
38         sed -i -e 's:-ggdb::' CMakeLists.txt || die
39
40         cmake-utils_src_prepare
41 }
42
43 src_configure() {
44         local mycmakeargs=(
45                 # we will use linux-mod for that
46                 -DBUILD_DRIVER=OFF
47                 # libscap examples are not installed or really useful
48                 -DBUILD_LIBSCAP_EXAMPLES=OFF
49
50                 # unbundle the deps
51                 -DUSE_BUNDLED_LUAJIT=OFF
52                 -DLUAJIT_PREFIX="${EPREFIX}"/usr
53                 -DLUAJIT_INCLUDE="${EPREFIX}"/usr/include/luajit-2.0
54                 -DUSE_BUNDLED_JSONCPP=OFF
55                 -DJSONCPP_PREFIX="${EPREFIX}"/usr
56                 -DJSONCPP_INCLUDE="${EPREFIX}"/usr/include/jsoncpp
57                 -DUSE_BUNDLED_ZLIB=OFF
58                 -DZLIB_PREFIX="${EPREFIX}"/usr
59         )
60
61         cmake-utils_src_configure
62
63         # setup linux-mod ugliness
64         MODULE_NAMES="sysdig-probe(extra:${BUILD_DIR}/driver:)"
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 }