]> git.pld-linux.org Git - packages/sysdig.git/blob - sysdig.spec
f45629009608c63541a450b7bc4df464e540c541
[packages/sysdig.git] / sysdig.spec
1 #
2 # NOTES:
3 # - https://github.com/draios/sysdig/wiki/How-to-Install-Sysdig-from-the-Source-Code
4 #
5 # Conditional build:
6 %bcond_without  kernel          # kernel modules
7 %bcond_without  userspace       # userspace packages
8 %bcond_without  dkms            # DKMS package
9 %bcond_without  luajit          # use plain lua5.1 instead of luajit
10
11 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
12 %{error:kernel and userspace cannot be built at the same time on PLD builders}
13 exit 1
14 %endif
15
16 %if %{without userspace}
17 %undefine       with_dkms
18 # nothing to be placed to debuginfo package
19 %define         _enable_debug_packages  0
20 %endif
21 %ifnarch %{ix86} %{x8664} %{arm} mips ppc
22 %undefine       with_luajit
23 %endif
24
25 %define         rel     2
26 %define         pname   sysdig
27 Summary:        sysdig, a system-level exploration and troubleshooting tool
28 Summary(pl.UTF-8):      sysdig - narzędzie do przeglądu i rozwiązywania problemów na poziomie systemowym
29 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
30 Version:        0.24.2
31 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
32 License:        GPL v2
33 Group:          Applications/System
34 #Source0Download: https://github.com/draios/sysdig/releases
35 Source0:        https://github.com/draios/sysdig/archive/%{version}/%{pname}-%{version}.tar.gz
36 # Source0-md5:  ea98fc19fea18f02651a7955d069dcf1
37 Patch0:         kernel-5.0.patch
38 Patch1:         kernel-5.1.patch
39 URL:            http://www.sysdig.org/
40 BuildRequires:  rpmbuild(macros) >= 1.701
41 BuildRequires:  cmake >= 2.8.2
42 BuildRequires:  curl-devel >= 7.45.0
43 BuildRequires:  jq-devel >= 1.5
44 BuildRequires:  jsoncpp-devel
45 BuildRequires:  libb64-devel >= 1.2.1
46 BuildRequires:  libstdc++-devel >= 6:4.4
47 %{!?with_luajit:BuildRequires:  lua51-devel >= 5.1}
48 %{?with_luajit:BuildRequires:   luajit-devel >= 2.0.3}
49 BuildRequires:  ncurses-devel >= 5.9
50 BuildRequires:  openssl-devel >= 1.0.2
51 BuildRequires:  tbb-devel
52 BuildRequires:  zlib-devel >= 1.2.8
53 %{!?with_luajit:BuildConflicts: luajit-devel}
54 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
55 ExclusiveArch:  %{ix86} %{x8664} x32
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 # constify %{name}
59 %{expand:%%global name %{pname}}
60
61 %define         zshdir %{_datadir}/zsh/site-functions
62
63 %description
64 Sysdig instruments your physical and virtual machines at the OS level
65 by installing into the Linux kernel and capturing system calls and
66 other OS events. Then, using sysdig's command line interface, you can
67 filter and decode these events in order to extract useful information.
68 Sysdig can be used to inspect systems live in real-time, or to
69 generate trace files that can be analyzed at a later stage.
70
71 %description -l pl.UTF-8
72 Sysdig obsługuje maszyny fizyczne i wirtualne na poziomie systemu
73 operacyjnego, instalując się w jądrze Linuksa i przechwytując
74 wywołania systemowe oraz inne zdarzenia systemu. Następnie, przy
75 użyciu interfejsu linii poleceń sysdiga można odfiltrować i zdekodować
76 te zdarzenia, aby wydobyć z nich przydatne informacje. Sysdiga można
77 używać do dozorowania systemów w czasie rzeczywistym albo generowania
78 plików śladów do późniejszej analizy.
79
80 %package -n dkms-%{name}
81 Summary:        DKMS-ready driver for sysdig
82 Summary(pl.UTF-8):      Sterownik sysdiga zgodny z DKMS
83 License:        GPL v2+
84 Group:          Base/Kernel
85 Requires(pre,post):     dkms >= 2.1.0.0
86 %if "%{_rpmversion}" >= "5"
87 BuildArch:      noarch
88 %endif
89
90 %description -n dkms-%{name}
91 This package contains a DKMS-ready driver for sysdig.
92
93 %description -n dkms-%{name} -l pl.UTF-8
94 Ten pakiet zawiera sterownik sysdiga w postaci zgodnej z DKMS.
95
96 %package -n bash-completion-%{name}
97 Summary:        bash-completion for sysdig command
98 Summary(pl.UTF-8):      Bashowe dopełnianie składni polecenia sysdig
99 Group:          Applications/Shells
100 Requires:       %{name} = %{version}-%{rel}
101 Requires:       bash-completion
102 %if "%{_rpmversion}" >= "5"
103 BuildArch:      noarch
104 %endif
105
106 %description -n bash-completion-%{name}
107 bash-completion for sysdig command.
108
109 %description -n bash-completion-%{name} -l pl.UTF-8
110 Bashowe dopełnianie składni polecenia sysdig.
111
112 %package -n zsh-completion-%{name}
113 Summary:        zsh-completion for sysdig command
114 Summary(pl.UTF-8):      Dopełnianie składni polecenia sysdig w powłoce zsh
115 Group:          Applications/Shells
116 Requires:       %{name} = %{version}-%{rel}
117 %if "%{_rpmversion}" >= "5"
118 BuildArch:      noarch
119 %endif
120
121 %description -n zsh-completion-%{name}
122 zsh-completion for sysdig command.
123
124 %description -n zsh-completion-%{name} -l pl.UTF-8
125 Dopełnianie składni polecenia sysdig w powłoce zsh.
126
127 %define kernel_pkg()\
128 %package -n kernel%{_alt_kernel}-misc-%{pname}\
129 Summary:        Linux driver for sysdig\
130 Summary(pl.UTF-8):      Sterownik jądra Linuksa dla sysdiga\
131 Release:        %{rel}@%{_kernel_ver_str}\
132 Group:          Base/Kernel\
133 Requires(post,postun):  /sbin/depmod\
134 %requires_releq_kernel\
135 Requires(postun):       %releq_kernel\
136 \
137 %description -n kernel%{_alt_kernel}-misc-%{pname}\
138 This is sysdig-probe module for Linux.\
139 \
140 %description -n kernel%{_alt_kernel}-misc-%{pname} -l pl.UTF-8\
141 Ten pakiet zawiera moduł sysdig-probe for jądra Linuksa.\
142 \
143 %if %{with kernel}\
144 %files -n kernel%{_alt_kernel}-misc-%{pname}\
145 %defattr(644,root,root,755)\
146 /lib/modules/%{_kernel_ver}/misc/*.ko*\
147 %endif\
148 \
149 %post   -n kernel%{_alt_kernel}-misc-%{pname}\
150 %depmod %{_kernel_ver}\
151 \
152 %postun -n kernel%{_alt_kernel}-misc-%{pname}\
153 %depmod %{_kernel_ver}\
154 %{nil}
155
156 %define build_kernel_pkg()\
157 %build_kernel_modules -C driver -m sysdig-probe\
158 %install_kernel_modules -D installed -m driver/sysdig-probe -d misc\
159 %{nil}
160
161 %{?with_kernel:%{expand:%create_kernel_packages}}
162
163 %prep
164 %setup -q -n %{pname}-%{version}
165 %patch0 -p1
166 %patch1 -p1
167
168 %build
169 install -d build
170 cd build
171 %cmake .. \
172         -DDIR_ETC=%{_sysconfdir} \
173         -DSYSDIG_VERSION=%{version}-%{rel} \
174         -DBUILD_DRIVER=OFF \
175         -DUSE_BUNDLED_DEPS=OFF \
176         -DUSE_BUNDLED_B64=OFF \
177         -DUSE_BUNDLED_CURL=OFF \
178         -DUSE_BUNDLED_JQ=OFF \
179         -DUSE_BUNDLED_JSONCPP=OFF \
180         -DUSE_BUNDLED_LUAJIT=OFF \
181         -DUSE_BUNDLED_NCURSES=OFF \
182         -DUSE_BUNDLED_OPENSSL=OFF \
183         -DUSE_BUNDLED_TBB=OFF \
184         -DUSE_BUNDLED_ZLIB=OFF
185 cd ..
186
187 %if %{with kernel}
188 cp -f build/driver/Makefile.dkms driver/Makefile
189 %{expand:%build_kernel_packages}
190 %endif
191
192 %if %{with userspace}
193 %{__make} -C build
194 %endif
195
196 %install
197 rm -rf $RPM_BUILD_ROOT
198
199 %if %{with userspace}
200 %{__make} -C build install \
201         DESTDIR=$RPM_BUILD_ROOT
202
203 # already installed as %{zshdir}/_sysdig
204 %{__rm} $RPM_BUILD_ROOT%{_datadir}/zsh/vendor-completions/_sysdig
205 %endif
206
207 %if %{with kernel}
208 install -d $RPM_BUILD_ROOT
209 cp -a installed/* $RPM_BUILD_ROOT
210 %endif
211
212 %clean
213 rm -rf $RPM_BUILD_ROOT
214
215 %post -n dkms-%{name}
216 %{_sbindir}/dkms add -m %{name} -v %{version}-%{rel} --rpm_safe_upgrade && \
217 %{_sbindir}/dkms build -m %{name} -v %{version}-%{rel} --rpm_safe_upgrade && \
218 %{_sbindir}/dkms install -m %{name} -v %{version}-%{rel} --rpm_safe_upgrade || :
219
220 %preun -n dkms-%{name}
221 %{_sbindir}/dkms remove -m %{name} -v %{version}-%{rel} --rpm_safe_upgrade --all || :
222
223 %if %{with userspace}
224 %files
225 %defattr(644,root,root,755)
226 %doc README.md
227 %attr(755,root,root) %{_bindir}/csysdig
228 %attr(755,root,root) %{_bindir}/sysdig
229 %attr(755,root,root) %{_bindir}/sysdig-probe-loader
230 %{_mandir}/man8/csysdig.8*
231 %{_mandir}/man8/sysdig.8*
232 %{_datadir}/%{name}
233
234 %files -n bash-completion-%{name}
235 %defattr(644,root,root,755)
236 /etc/bash_completion.d/sysdig
237
238 %files -n zsh-completion-%{name}
239 %defattr(644,root,root,755)
240 %{zshdir}/_sysdig
241 %endif
242
243 %if %{with dkms}
244 %files -n dkms-%{name}
245 %defattr(644,root,root,755)
246 %{_usrsrc}/%{name}-%{version}-%{rel}
247 %endif
This page took 0.41876 seconds and 2 git commands to generate.