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