]>
Commit | Line | Data |
---|---|---|
3fa3c5e8 | 1 | # |
1b31ba42 | 2 | # Conditional build: |
26590938 JB |
3 | %bcond_without tests # "make check" |
4 | %bcond_without static_libs # static library | |
9d204a35 JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
bc3b5c7e | 7 | |
26590938 JB |
8 | %ifnarch %{x8664} |
9 | # tests seem broken on x86 and x32 | |
10 | %undefine with_tests | |
11 | %endif | |
de4a549d JP |
12 | |
13 | %if %{without static_libs} | |
14 | %undefine with_python2 | |
15 | %undefine with_python3 | |
16 | %endif | |
98e97d35 JB |
17 | Summary: Enhanced Seccomp (mode 2) Helper library |
18 | Summary(pl.UTF-8): Rozszerzona biblioteka pomocnicza Seccomp (trybu 2) | |
19 | Name: libseccomp | |
3be6d733 | 20 | Version: 2.5.5 |
cb0bcb81 | 21 | Release: 1 |
98e97d35 JB |
22 | License: LGPL v2.1 |
23 | Group: Libraries | |
ebbe4ccc | 24 | #Source0Download: https://github.com/seccomp/libseccomp/releases |
1b31ba42 | 25 | Source0: https://github.com/seccomp/libseccomp/releases/download/v%{version}/%{name}-%{version}.tar.gz |
3be6d733 | 26 | # Source0-md5: c27a5e43cae1e89e6ebfedeea734c9b4 |
1b31ba42 | 27 | URL: https://github.com/seccomp/libseccomp |
6c9c8e6b | 28 | BuildRequires: gperf |
dc9dafa9 | 29 | BuildRequires: pkgconfig |
e4973dc4 | 30 | %if %{with python2} |
6c9c8e6b JB |
31 | BuildRequires: python-Cython >= 0.29 |
32 | BuildRequires: python-devel >= 1:2.6 | |
63d44193 | 33 | BuildRequires: python-modules |
9f228da8 | 34 | %endif |
e4973dc4 | 35 | %if %{with python3} |
6c9c8e6b JB |
36 | BuildRequires: python3-Cython >= 0.29 |
37 | BuildRequires: python3-devel >= 1:3.3 | |
9d204a35 JB |
38 | %endif |
39 | %if %{with python2} || %{with python3} | |
40 | BuildRequires: rpm-pythonprov | |
41 | BuildRequires: rpmbuild(macros) >= 1.714 | |
e4973dc4 | 42 | %endif |
41063362 | 43 | %if %{with tests} |
ecb2ff21 JP |
44 | BuildRequires: glibc-debuginfo |
45 | BuildRequires: valgrind | |
41063362 | 46 | %endif |
6c9c8e6b | 47 | ExclusiveArch: %{ix86} %{x8664} x32 %{arm} aarch64 mips mips64 parisc parisc64 ppc ppc64 riscv64 s390 s390x |
98e97d35 JB |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
50 | %description | |
51 | The libseccomp library provides and easy to use, platform independent, | |
52 | interface to the Linux Kernel's syscall filtering mechanism: seccomp. | |
53 | The libseccomp API is designed to abstract away the underlying BPF | |
54 | based syscall filter language and present a more conventional | |
55 | function-call based filtering interface that should be familiar to, | |
56 | and easily adopted by application developers. | |
57 | ||
58 | %description -l pl.UTF-8 | |
59 | Biblioteka libseccomp udostępnia łatwy w użyciu, niezależny od | |
60 | platformy interfejs do mechanizmu filtrowania wywołań systemowych | |
bc3b5c7e ER |
61 | jądra Linuksa - seccomp. API libseccomp jest zaprojektowane tak, żeby |
62 | wyabstrahować język filtrowania wywołań BPF niższego poziomu i | |
98e97d35 JB |
63 | zaprezentować bardziej konwencjonalny interfejs filtrowania w oparciu |
64 | o wywołania funkcji, który powinien być bardziej przyjazny i łatwiej | |
65 | adaptowalny dla programistów aplikacji. | |
66 | ||
67 | %package devel | |
68 | Summary: Header files for Seccomp library | |
69 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Seccomp | |
70 | Group: Development/Libraries | |
71 | Requires: %{name} = %{version}-%{release} | |
72 | ||
73 | %description devel | |
74 | Header files for Seccomp library. | |
75 | ||
76 | %description devel -l pl.UTF-8 | |
77 | Pliki nagłówkowe biblioteki Seccomp. | |
78 | ||
79 | %package static | |
80 | Summary: Static Seccomp library | |
81 | Summary(pl.UTF-8): Statyczna biblioteka Seccomp | |
82 | Group: Development/Libraries | |
83 | Requires: %{name}-devel = %{version}-%{release} | |
84 | ||
85 | %description static | |
86 | Static Seccomp library. | |
87 | ||
88 | %description static -l pl.UTF-8 | |
89 | Statyczna biblioteka Seccomp. | |
90 | ||
26590938 JB |
91 | %package -n python-seccomp |
92 | Summary: Python binding for seccomp library | |
93 | Summary(pl.UTF-8): Wiązanie Pythona do biblioteki seccomp | |
94 | Group: Libraries/Python | |
95 | Requires: %{name} = %{version}-%{release} | |
96 | ||
97 | %description -n python-seccomp | |
98 | Python binding for seccomp library. | |
99 | ||
100 | %description -n python-seccomp -l pl.UTF-8 | |
101 | Wiązanie Pythona do biblioteki seccomp. | |
102 | ||
e4973dc4 | 103 | %package -n python3-seccomp |
9d204a35 JB |
104 | Summary: Python 3 binding for seccomp library |
105 | Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki seccomp | |
106 | Group: Libraries/Python | |
107 | Requires: %{name} = %{version}-%{release} | |
e4973dc4 AM |
108 | |
109 | %description -n python3-seccomp | |
110 | Python 3 binding for seccomp library. | |
111 | ||
112 | %description -n python3-seccomp -l pl.UTF-8 | |
113 | Wiązanie Pythona 3 do biblioteki seccomp. | |
114 | ||
98e97d35 JB |
115 | %prep |
116 | %setup -q | |
98e97d35 JB |
117 | |
118 | %build | |
1b31ba42 ER |
119 | %configure \ |
120 | --disable-silent-rules \ | |
387648c9 | 121 | --disable-python \ |
1b31ba42 ER |
122 | %{!?with_static_libs:--disable-static} |
123 | %{__make} | |
98e97d35 | 124 | |
e4973dc4 AM |
125 | CPPFLAGS="-I$(pwd)/include"; export CPPFLAGS |
126 | cd src/python | |
127 | VERSION_RELEASE="%{version}"; export VERSION_RELEASE | |
128 | %if %{with python2} | |
129 | %py_build | |
e4973dc4 AM |
130 | %endif |
131 | ||
132 | %if %{with python3} | |
133 | %py3_build | |
e4973dc4 AM |
134 | %endif |
135 | cd ../../ | |
136 | ||
1b31ba42 | 137 | %{?with_tests:%{__make} check} |
3fa3c5e8 | 138 | |
98e97d35 JB |
139 | %install |
140 | rm -rf $RPM_BUILD_ROOT | |
98e97d35 JB |
141 | %{__make} install \ |
142 | DESTDIR=$RPM_BUILD_ROOT | |
143 | ||
1b31ba42 ER |
144 | # obsoleted by pkg-config file |
145 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libseccomp.la | |
98e97d35 | 146 | |
e4973dc4 AM |
147 | CPPFLAGS="-I$(pwd)/include"; export CPPFLAGS |
148 | cd src/python | |
149 | VERSION_RELEASE="%{version}"; export VERSION_RELEASE | |
150 | %if %{with python2} | |
151 | %py_install | |
152 | ||
153 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
154 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
155 | ||
156 | %py_postclean | |
157 | %endif | |
158 | ||
159 | %if %{with python3} | |
160 | %py3_install | |
161 | %endif | |
162 | ||
98e97d35 JB |
163 | %clean |
164 | rm -rf $RPM_BUILD_ROOT | |
165 | ||
166 | %post -p /sbin/ldconfig | |
167 | %postun -p /sbin/ldconfig | |
168 | ||
169 | %files | |
170 | %defattr(644,root,root,755) | |
6c9c8e6b | 171 | %doc CHANGELOG CREDITS README.md SECURITY.md |
d24f42eb | 172 | %attr(755,root,root) %{_bindir}/scmp_sys_resolver |
98e97d35 | 173 | %attr(755,root,root) %{_libdir}/libseccomp.so.*.*.* |
c86f6298 | 174 | %attr(755,root,root) %ghost %{_libdir}/libseccomp.so.2 |
d24f42eb | 175 | %{_mandir}/man1/scmp_sys_resolver.1* |
98e97d35 JB |
176 | |
177 | %files devel | |
178 | %defattr(644,root,root,755) | |
179 | %attr(755,root,root) %{_libdir}/libseccomp.so | |
180 | %{_includedir}/seccomp.h | |
f5680587 | 181 | %{_includedir}/seccomp-syscalls.h |
98e97d35 JB |
182 | %{_pkgconfigdir}/libseccomp.pc |
183 | %{_mandir}/man3/seccomp_*.3* | |
184 | ||
1b31ba42 | 185 | %if %{with static_libs} |
98e97d35 JB |
186 | %files static |
187 | %defattr(644,root,root,755) | |
188 | %{_libdir}/libseccomp.a | |
1b31ba42 | 189 | %endif |
26590938 | 190 | |
e4973dc4 | 191 | %if %{with python2} |
26590938 JB |
192 | %files -n python-seccomp |
193 | %defattr(644,root,root,755) | |
194 | %attr(755,root,root) %{py_sitedir}/seccomp.so | |
195 | %{py_sitedir}/seccomp-%{version}-py*.egg-info | |
196 | %endif | |
e4973dc4 AM |
197 | |
198 | %if %{with python3} | |
199 | %files -n python3-seccomp | |
200 | %defattr(644,root,root,755) | |
201 | %attr(755,root,root) %{py3_sitedir}/seccomp.*.so | |
202 | %{py3_sitedir}/seccomp-%{version}-py*.egg-info | |
203 | %endif |