]> git.pld-linux.org Git - packages/sysdig.git/blob - sysdig.spec
- patch name fix
[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
22 %define         rel     1
23 %define         pname   sysdig
24 Summary:        sysdig, a system-level exploration and troubleshooting tool
25 Summary(pl.UTF-8):      sysdig - narzędzie do przeglądu i rozwiązywania problemów na poziomie systemowym
26 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
27 Version:        0.13.0
28 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
29 License:        GPL v2
30 Group:          Applications/System
31 #Source0Download: https://github.com/draios/sysdig/releases
32 Source0:        https://github.com/draios/sysdig/archive/%{version}/%{pname}-%{version}.tar.gz
33 # Source0-md5:  a8658daee5277d2a3a0bbb8381fb020f
34 Patch0:         buildflags.patch
35 Patch1:         %{pname}-linux4.patch
36 URL:            http://www.sysdig.org/
37 BuildRequires:  rpmbuild(macros) >= 1.701
38 BuildRequires:  cmake >= 2.8.2
39 BuildRequires:  curl-devel >= 7.45.0
40 BuildRequires:  jq-devel >= 1.5
41 BuildRequires:  jsoncpp-devel
42 BuildRequires:  libb64-devel >= 1.2.1
43 BuildRequires:  libstdc++-devel >= 6:4.4
44 %{!?with_luajit:BuildRequires:  lua5.1-devel >= 5.1}
45 %{?with_luajit:BuildRequires:   luajit-devel >= 2.0.3}
46 BuildRequires:  ncurses-devel >= 5.9
47 BuildRequires:  openssl-devel >= 1.0.2
48 BuildRequires:  zlib-devel >= 1.2.8
49 %{!?with_luajit:BuildConflicts: luajit-devel}
50 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
51 %if %{with userspace}
52 ExclusiveArch:  %{ix86} %{x8664}
53 %else
54 ExclusiveArch:  %{ix86} %{x8664} x32
55 %endif
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_B64=OFF \
176         -DUSE_BUNDLED_CURL=OFF \
177         -DUSE_BUNDLED_JQ=OFF \
178         -DUSE_BUNDLED_JSONCPP=OFF \
179         -DUSE_BUNDLED_LUAJIT=OFF \
180         -DUSE_BUNDLED_NCURSES=OFF \
181         -DUSE_BUNDLED_OPENSSL=OFF \
182         -DUSE_BUNDLED_ZLIB=OFF
183 cd ..
184
185 %if %{with kernel}
186 cp -f build/driver/Makefile.dkms driver/Makefile
187 %{expand:%build_kernel_packages}
188 %endif
189
190 %if %{with userspace}
191 %{__make} -C build
192 %endif
193
194 %install
195 rm -rf $RPM_BUILD_ROOT
196
197 %if %{with userspace}
198 %{__make} -C build install \
199         DESTDIR=$RPM_BUILD_ROOT
200
201 # already installed as %{zshdir}/_sysdig
202 %{__rm} $RPM_BUILD_ROOT%{_datadir}/zsh/vendor-completions/_sysdig
203 %endif
204
205 %if %{with kernel}
206 install -d $RPM_BUILD_ROOT
207 cp -a installed/* $RPM_BUILD_ROOT
208 %endif
209
210 %clean
211 rm -rf $RPM_BUILD_ROOT
212
213 %post -n dkms-%{name}
214 %{_sbindir}/dkms add -m %{name} -v %{version}-%{rel} --rpm_safe_upgrade && \
215 %{_sbindir}/dkms build -m %{name} -v %{version}-%{rel} --rpm_safe_upgrade && \
216 %{_sbindir}/dkms install -m %{name} -v %{version}-%{rel} --rpm_safe_upgrade || :
217
218 %preun -n dkms-%{name}
219 %{_sbindir}/dkms remove -m %{name} -v %{version}-%{rel} --rpm_safe_upgrade --all || :
220
221 %if %{with userspace}
222 %files
223 %defattr(644,root,root,755)
224 %doc README.md
225 %attr(755,root,root) %{_bindir}/csysdig
226 %attr(755,root,root) %{_bindir}/sysdig
227 %attr(755,root,root) %{_bindir}/sysdig-probe-loader
228 %{_mandir}/man8/csysdig.8*
229 %{_mandir}/man8/sysdig.8*
230 %{_datadir}/%{name}
231
232 %files -n bash-completion-%{name}
233 %defattr(644,root,root,755)
234 /etc/bash_completion.d/sysdig
235
236 %files -n zsh-completion-%{name}
237 %defattr(644,root,root,755)
238 %{zshdir}/_sysdig
239 %endif
240
241 %if %{with dkms}
242 %files -n dkms-%{name}
243 %defattr(644,root,root,755)
244 %{_usrsrc}/%{name}-%{version}-%{rel}
245 %endif
This page took 0.140288 seconds and 3 git commands to generate.