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