summaryrefslogtreecommitdiff
path: root/libseccomp.spec
blob: 2a8beca964c061bb08a4e045b2f5e7fd03305cdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#
# Conditional build:
%bcond_without	tests		# "make check"
%bcond_without	static_libs	# static library
%bcond_without	python2		# CPython 2.x module
%bcond_without	python3		# CPython 3.x module

%ifnarch %{x8664}
# tests seem broken on x86 and x32
%undefine	with_tests
%endif

%if %{without static_libs}
%undefine	with_python2
%undefine	with_python3
%endif
Summary:	Enhanced Seccomp (mode 2) Helper library
Summary(pl.UTF-8):	Rozszerzona biblioteka pomocnicza Seccomp (trybu 2)
Name:		libseccomp
Version:	2.5.5
Release:	1
License:	LGPL v2.1
Group:		Libraries
#Source0Download: https://github.com/seccomp/libseccomp/releases
Source0:	https://github.com/seccomp/libseccomp/releases/download/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5:	c27a5e43cae1e89e6ebfedeea734c9b4
URL:		https://github.com/seccomp/libseccomp
BuildRequires:	gperf
BuildRequires:	pkgconfig
%if %{with python2}
BuildRequires:	python-Cython >= 0.29
BuildRequires:	python-devel >= 1:2.6
BuildRequires:	python-modules
%endif
%if %{with python3}
BuildRequires:	python3-Cython >= 0.29
BuildRequires:	python3-devel >= 1:3.3
%endif
%if %{with python2} || %{with python3}
BuildRequires:	rpm-pythonprov
BuildRequires:	rpmbuild(macros) >= 1.714
%endif
%if %{with tests}
BuildRequires:	glibc-debuginfo
BuildRequires:	valgrind
%endif
ExclusiveArch:	%{ix86} %{x8664} x32 %{arm} aarch64 mips mips64 parisc parisc64 ppc ppc64 riscv64 s390 s390x
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
The libseccomp library provides and easy to use, platform independent,
interface to the Linux Kernel's syscall filtering mechanism: seccomp.
The libseccomp API is designed to abstract away the underlying BPF
based syscall filter language and present a more conventional
function-call based filtering interface that should be familiar to,
and easily adopted by application developers.

%description -l pl.UTF-8
Biblioteka libseccomp udostępnia łatwy w użyciu, niezależny od
platformy interfejs do mechanizmu filtrowania wywołań systemowych
jądra Linuksa - seccomp. API libseccomp jest zaprojektowane tak, żeby
wyabstrahować język filtrowania wywołań BPF niższego poziomu i
zaprezentować bardziej konwencjonalny interfejs filtrowania w oparciu
o wywołania funkcji, który powinien być bardziej przyjazny i łatwiej
adaptowalny dla programistów aplikacji.

%package devel
Summary:	Header files for Seccomp library
Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki Seccomp
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}

%description devel
Header files for Seccomp library.

%description devel -l pl.UTF-8
Pliki nagłówkowe biblioteki Seccomp.

%package static
Summary:	Static Seccomp library
Summary(pl.UTF-8):	Statyczna biblioteka Seccomp
Group:		Development/Libraries
Requires:	%{name}-devel = %{version}-%{release}

%description static
Static Seccomp library.

%description static -l pl.UTF-8
Statyczna biblioteka Seccomp.

%package -n python-seccomp
Summary:	Python binding for seccomp library
Summary(pl.UTF-8):	Wiązanie Pythona do biblioteki seccomp
Group:		Libraries/Python
Requires:	%{name} = %{version}-%{release}

%description -n python-seccomp
Python binding for seccomp library.

%description -n python-seccomp -l pl.UTF-8
Wiązanie Pythona do biblioteki seccomp.

%package -n python3-seccomp
Summary:	Python 3 binding for seccomp library
Summary(pl.UTF-8):	Wiązanie Pythona 3 do biblioteki seccomp
Group:		Libraries/Python
Requires:	%{name} = %{version}-%{release}

%description -n python3-seccomp
Python 3 binding for seccomp library.

%description -n python3-seccomp -l pl.UTF-8
Wiązanie Pythona 3 do biblioteki seccomp.

%prep
%setup -q

%build
%configure \
	--disable-silent-rules \
	--disable-python \
	%{!?with_static_libs:--disable-static}
%{__make}

CPPFLAGS="-I$(pwd)/include"; export CPPFLAGS
cd src/python
VERSION_RELEASE="%{version}"; export VERSION_RELEASE
%if %{with python2}
%py_build
%endif

%if %{with python3}
%py3_build
%endif
cd ../../

%{?with_tests:%{__make} check}

%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT

# obsoleted by pkg-config file
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libseccomp.la

CPPFLAGS="-I$(pwd)/include"; export CPPFLAGS
cd src/python
VERSION_RELEASE="%{version}"; export VERSION_RELEASE
%if %{with python2}
%py_install

%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}

%py_postclean
%endif

%if %{with python3}
%py3_install
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post	-p /sbin/ldconfig
%postun	-p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%doc CHANGELOG CREDITS README.md SECURITY.md
%attr(755,root,root) %{_bindir}/scmp_sys_resolver
%attr(755,root,root) %{_libdir}/libseccomp.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libseccomp.so.2
%{_mandir}/man1/scmp_sys_resolver.1*

%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libseccomp.so
%{_includedir}/seccomp.h
%{_includedir}/seccomp-syscalls.h
%{_pkgconfigdir}/libseccomp.pc
%{_mandir}/man3/seccomp_*.3*

%if %{with static_libs}
%files static
%defattr(644,root,root,755)
%{_libdir}/libseccomp.a
%endif

%if %{with python2}
%files -n python-seccomp
%defattr(644,root,root,755)
%attr(755,root,root) %{py_sitedir}/seccomp.so
%{py_sitedir}/seccomp-%{version}-py*.egg-info
%endif

%if %{with python3}
%files -n python3-seccomp
%defattr(644,root,root,755)
%attr(755,root,root) %{py3_sitedir}/seccomp.*.so
%{py3_sitedir}/seccomp-%{version}-py*.egg-info
%endif