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/20170804/%{name}-%{version}.tar.gz
20 # Source0-md5: a6b5c451fbe45ff9e3e0e65f2db0ae1d
21 Patch0: %{name}-libexecdir.patch
22 URL: https://github.com/SELinuxProject/selinux/wiki
24 BuildRequires: bzip2-devel
26 BuildRequires: libselinux-devel >= 2.7
27 BuildRequires: libsepol-devel >= 2.7
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.7
33 Requires: libsepol >= 2.7
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.7
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.7
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=%{_libdir} \
106 %{__make} -j1 -C src pywrap \
108 CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \
110 LIBEXECDIR=%{_libdir} \
116 rm -rf $RPM_BUILD_ROOT
118 %{__make} install %{?with_python2:install-pywrap} \
119 LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
120 LIBEXECDIR=$RPM_BUILD_ROOT%{_libexecdir} \
121 SHLIBDIR=$RPM_BUILD_ROOT/%{_lib} \
123 PYSITEDIR=$RPM_BUILD_ROOT%{py_sitedir} \
125 DESTDIR=$RPM_BUILD_ROOT
128 install -d $RPM_BUILD_ROOT/%{_lib}
129 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libsemanage.so.* $RPM_BUILD_ROOT/%{_lib}
130 # adjust .so symlink, make symlink across / absolute
131 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libsemanage.so.*) \
132 $RPM_BUILD_ROOT%{_libdir}/libsemanage.so
135 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
136 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
141 %{__make} -C src install-pywrap \
142 LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
143 LIBEXECDIR=$RPM_BUILD_ROOT%{_libexecdir} \
145 PYSITEDIR=$RPM_BUILD_ROOT%{py3_sitedir} \
146 PYTHON=%{__python3} \
147 DESTDIR=$RPM_BUILD_ROOT
149 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
150 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
154 rm -rf $RPM_BUILD_ROOT
156 %post -p /sbin/ldconfig
157 %postun -p /sbin/ldconfig
160 %defattr(644,root,root,755)
161 %attr(755,root,root) /%{_lib}/libsemanage.so.1
162 %dir %{_sysconfdir}/selinux
163 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/selinux/semanage.conf
164 %dir %{_libexecdir}/selinux
165 %{_mandir}/man5/semanage.conf.5*
168 %defattr(644,root,root,755)
169 %attr(755,root,root) %{_libdir}/libsemanage.so
170 %{_pkgconfigdir}/libsemanage.pc
171 %{_includedir}/semanage
172 %{_mandir}/man3/semanage_*.3*
175 %defattr(644,root,root,755)
176 %{_libdir}/libsemanage.a
179 %files -n python-semanage
180 %defattr(644,root,root,755)
181 %attr(755,root,root) %{py_sitedir}/_semanage.so
182 %{py_sitedir}/semanage.py[co]
183 %attr(755,root,root) %{_libexecdir}/selinux/semanage_migrate_store
187 %files -n python3-semanage
188 %defattr(644,root,root,755)
189 %attr(755,root,root) %{py3_sitedir}/_semanage.cpython-*.so
190 %{py3_sitedir}/semanage.py
191 %{py3_sitedir}/__pycache__/semanage.cpython-*.py[co]