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