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