3 %bcond_without python # Python (any) bindings
4 %bcond_without python2 # Python 2 binding
5 %bcond_without python3 # Python 3 binding
11 Summary: An interface for SELinux management
12 Summary(pl.UTF-8): Interfejs do zarządzania SELinuksem
18 #Source0Download: https://github.com/SELinuxProject/selinux/wiki/Releases
19 Source0: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/%{name}-%{version}.tar.gz
20 # Source0-md5: 62ed7bb2ede677a735f2750751677a4f
21 Patch0: %{name}-libexecdir.patch
22 URL: https://github.com/SELinuxProject/selinux/wiki
24 BuildRequires: bzip2-devel
26 BuildRequires: libselinux-devel >= 2.8
27 BuildRequires: libsepol-devel >= 2.8
28 %{?with_python2:BuildRequires: python-devel >= 2}
29 %{?with_python3:BuildRequires: python3-devel >= 1:3.2}
30 BuildRequires: rpm-pythonprov
31 BuildRequires: rpmbuild(macros) >= 1.714
32 Requires: libselinux >= 2.8
33 Requires: libsepol >= 2.8
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 An interface for SELinux management.
39 %description -l pl.UTF-8
40 Interfejs do zarządzania SELinuksem.
43 Summary: Header files for libsemanage library
44 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libsemanage
45 Group: Development/Libraries
46 Requires: %{name} = %{version}-%{release}
49 This package contains the header files for libsemanage library.
51 %description devel -l pl.UTF-8
52 Ten pakiet zawiera pliki nagłówkowe biblioteki libsemanage.
55 Summary: Static version of libsemanage library
56 Summary(pl.UTF-8): Statyczna wersja biblioteki libsemanage
57 Group: Development/Libraries
58 Requires: %{name}-devel = %{version}-%{release}
61 Static version of libsemanage library.
63 %description static -l pl.UTF-8
64 Statyczna wersja biblioteki libsemanage.
66 %package -n python-semanage
67 Summary: Python 2 binding for semanage library
68 Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki semanage
69 Group: Libraries/Python
70 Requires: %{name} = %{version}-%{release}
71 Requires: python-selinux >= 2.8
73 %description -n python-semanage
74 Python 2 binding for semanage library.
76 %description -n python-semanage -l pl.UTF-8
77 Wiązania Pythona 2 do biblioteki semanage.
79 %package -n python3-semanage
80 Summary: Python 3 binding for semanage library
81 Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki semanage
82 Group: Libraries/Python
83 Requires: %{name} = %{version}-%{release}
84 Requires: python3-selinux >= 2.8
86 %description -n python3-semanage
87 Python 3 binding for semanage library.
89 %description -n python3-semanage -l pl.UTF-8
90 Wiązania Pythona 3 do biblioteki semanage.
97 %{__make} -j1 all %{?with_python2:pywrap} \
99 CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \
101 LIBEXECDIR=%{_libexecdir} \
106 %{__make} -j1 -C src pywrap \
108 CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \
110 LIBEXECDIR=%{_libexecdir} \
116 rm -rf $RPM_BUILD_ROOT
118 %{__make} install %{?with_python2:install-pywrap} \
120 LIBEXECDIR=%{_libexecdir} \
122 PYSITEDIR=%{py_sitedir} \
124 DESTDIR=$RPM_BUILD_ROOT
127 install -d $RPM_BUILD_ROOT/%{_lib}
128 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libsemanage.so.* $RPM_BUILD_ROOT/%{_lib}
129 # adjust .so symlink, make symlink across / absolute
130 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libsemanage.so.*) \
131 $RPM_BUILD_ROOT%{_libdir}/libsemanage.so
134 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
135 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
140 %{__make} -C src install-pywrap \
142 LIBEXECDIR=%{_libexecdir} \
144 PYSITEDIR=%{py3_sitedir} \
145 PYTHON=%{__python3} \
146 DESTDIR=$RPM_BUILD_ROOT
148 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
149 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
153 rm -rf $RPM_BUILD_ROOT
155 %post -p /sbin/ldconfig
156 %postun -p /sbin/ldconfig
159 %defattr(644,root,root,755)
160 %attr(755,root,root) /%{_lib}/libsemanage.so.1
161 %dir %{_sysconfdir}/selinux
162 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/selinux/semanage.conf
163 %dir %{_libexecdir}/selinux
164 %{_mandir}/man5/semanage.conf.5*
167 %defattr(644,root,root,755)
168 %attr(755,root,root) %{_libdir}/libsemanage.so
169 %{_pkgconfigdir}/libsemanage.pc
170 %{_includedir}/semanage
171 %{_mandir}/man3/semanage_*.3*
174 %defattr(644,root,root,755)
175 %{_libdir}/libsemanage.a
178 %files -n python-semanage
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{py_sitedir}/_semanage.so
181 %{py_sitedir}/semanage.py[co]
182 %attr(755,root,root) %{_libexecdir}/selinux/semanage_migrate_store
186 %files -n python3-semanage
187 %defattr(644,root,root,755)
188 %attr(755,root,root) %{py3_sitedir}/_semanage.cpython-*.so
189 %{py3_sitedir}/semanage.py
190 %{py3_sitedir}/__pycache__/semanage.cpython-*.py[co]