summaryrefslogtreecommitdiff
path: root/sysdig.spec
blob: ced435ad727312600ff74568e0358e9c850aba4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
# Conditional build:
%bcond_without	dkms		# build dkms package

Summary:	sysdig
Name:		sysdig
Version:	0.1.101
Release:	0.1
License:	GPL v2
Group:		Applications/System
Source0:	https://github.com/draios/sysdig/archive/%{version}/%{name}-%{version}.tar.gz
# Source0-md5:	5fe96a3a0fd98b2157a40cb29af41afc
URL:		http://www.sysdig.org/
BuildRequires:	cmake >= 2.8.2
BuildRequires:	jsoncpp-devel
BuildRequires:	libstdc++-devel >= 6:4.4
BuildRequires:	luajit-devel >= 2.0.3
BuildRequires:	ncurses-devel >= 5.9
BuildRequires:	zlib-devel >= 1.2.8
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%define		zshdir %{_datadir}/zsh/site-functions

%description
Sysdig instruments your physical and virtual machines at the OS level
by installing into the Linux kernel and capturing system calls and
other OS events. Then, using sysdig's command line interface, you can
filter and decode these events in order to extract useful information.
Sysdig can be used to inspect systems live in real-time, or to
generate trace files that can be analyzed at a later stage.

%package -n dkms-%{name}
Summary:	DKMS-ready driver for sysdig
License:	GPL v2+
Group:		Base/Kernel
Requires(pre,post):	dkms >= 2.1.0.0
%if "%{_rpmversion}" >= "5"
BuildArch:	noarch
%endif

%description -n dkms-%{name}
This package contains a DKMS-ready driver for sysdig.

%package -n bash-completion-%{name}
Summary:	bash-completion for sysdig
Summary(pl.UTF-8):	Bashowe dopełnianie składni dla sysdig
Group:		Applications/Shells
Requires:	%{name} = %{version}-%{release}
Requires:	bash-completion
%if "%{_rpmversion}" >= "5"
BuildArch:	noarch
%endif

%description -n bash-completion-%{name}
bash-completion for sysdig.

%package -n zsh-completion-%{name}
Summary:	zsh-completion for sysdig
Group:		Applications/Shells
Requires:	%{name} = %{version}-%{release}
%if "%{_rpmversion}" >= "5"
BuildArch:	noarch
%endif

%description -n zsh-completion-%{name}
zsh-completion for sysdig.

%prep
%setup -q

%build
install -d build
cd build
%cmake \
	-DDIR_ETC=%{_sysconfdir} \
	-DSYSDIG_VERSION=%{version}-%{release} \
	-DBUILD_DRIVER=OFF \
	-DUSE_BUNDLED_JSONCPP=OFF \
	-DUSE_BUNDLED_LUAJIT=OFF \
	-DUSE_BUNDLED_NCURSES=OFF \
	-DUSE_BUNDLED_ZLIB=OFF \
	..
%{__make}

%install
rm -rf $RPM_BUILD_ROOT
%{__make} -C build install \
	DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%post -n dkms-%{name}
%{_sbindir}/dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade && \
%{_sbindir}/dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade && \
%{_sbindir}/dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade || :

%preun -n dkms-%{name}
%{_sbindir}/dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all || :

%files
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/csysdig
%attr(755,root,root) %{_bindir}/sysdig
%attr(755,root,root) %{_bindir}/sysdig-probe-loader
%{_mandir}/man8/csysdig.8*
%{_mandir}/man8/sysdig.8*
%{_datadir}/%{name}

%files -n bash-completion-%{name}
%defattr(644,root,root,755)
/etc/bash_completion.d/sysdig

%files -n zsh-completion-%{name}
%defattr(644,root,root,755)
%{zshdir}/_sysdig
%{_datadir}/zsh/vendor-completions/_sysdig

%if %{with dkms}
%files -n dkms-%{name}
%defattr(644,root,root,755)
%{_usrsrc}/%{name}-%{version}-%{release}
%endif