3 %bcond_without python # Python 3 bindings
5 Summary: An interface for SELinux management
6 Summary(pl.UTF-8): Interfejs do zarządzania SELinuksem
12 #Source0Download: https://github.com/SELinuxProject/selinux/wiki/Releases
13 Source0: https://github.com/SELinuxProject/selinux/releases/download/20200710/%{name}-%{version}.tar.gz
14 # Source0-md5: d16eee8c1dc8cf43f59957d575d6bd29
15 Patch0: %{name}-libexecdir.patch
16 URL: https://github.com/SELinuxProject/selinux/wiki
17 BuildRequires: audit-libs-devel
19 BuildRequires: bzip2-devel
21 BuildRequires: libselinux-devel >= 3.1
22 BuildRequires: libsepol-devel >= 3.1
23 %{?with_python:BuildRequires: python3-devel >= 1:3.2}
24 BuildRequires: rpm-pythonprov
25 BuildRequires: rpmbuild(macros) >= 1.714
26 Requires: libselinux >= 3.1
27 Requires: libsepol >= 3.1
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 An interface for SELinux management.
33 %description -l pl.UTF-8
34 Interfejs do zarządzania SELinuksem.
37 Summary: Header files for libsemanage library
38 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libsemanage
39 Group: Development/Libraries
40 Requires: %{name} = %{version}-%{release}
43 This package contains the header files for libsemanage library.
45 %description devel -l pl.UTF-8
46 Ten pakiet zawiera pliki nagłówkowe biblioteki libsemanage.
49 Summary: Static version of libsemanage library
50 Summary(pl.UTF-8): Statyczna wersja biblioteki libsemanage
51 Group: Development/Libraries
52 Requires: %{name}-devel = %{version}-%{release}
55 Static version of libsemanage library.
57 %description static -l pl.UTF-8
58 Statyczna wersja biblioteki libsemanage.
60 %package -n python3-semanage
61 Summary: Python 3 binding for semanage library
62 Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki semanage
63 Group: Libraries/Python
64 Requires: %{name} = %{version}-%{release}
65 Requires: python3-selinux >= 3.1
67 %description -n python3-semanage
68 Python 3 binding for semanage library.
70 %description -n python3-semanage -l pl.UTF-8
71 Wiązania Pythona 3 do biblioteki semanage.
78 %{__make} -j1 all %{?with_python:pywrap} \
80 CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \
82 LIBEXECDIR=%{_libexecdir} \
87 rm -rf $RPM_BUILD_ROOT
89 %{__make} install %{?with_python:install-pywrap} \
91 LIBEXECDIR=%{_libexecdir} \
93 PYSITEDIR=%{py_sitedir} \
95 DESTDIR=$RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT/%{_lib}
99 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libsemanage.so.* $RPM_BUILD_ROOT/%{_lib}
100 # adjust .so symlink, make symlink across / absolute
101 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libsemanage.so.*) \
102 $RPM_BUILD_ROOT%{_libdir}/libsemanage.so
105 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
106 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
110 rm -rf $RPM_BUILD_ROOT
112 %post -p /sbin/ldconfig
113 %postun -p /sbin/ldconfig
116 %defattr(644,root,root,755)
117 %attr(755,root,root) /%{_lib}/libsemanage.so.1
118 %dir %{_sysconfdir}/selinux
119 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/selinux/semanage.conf
120 %dir %{_libexecdir}/selinux
121 %{_mandir}/man5/semanage.conf.5*
122 %lang(ru) %{_mandir}/ru/man5/semanage.conf.5*
125 %defattr(644,root,root,755)
126 %attr(755,root,root) %{_libdir}/libsemanage.so
127 %{_pkgconfigdir}/libsemanage.pc
128 %{_includedir}/semanage
129 %{_mandir}/man3/semanage_*.3*
132 %defattr(644,root,root,755)
133 %{_libdir}/libsemanage.a
136 %files -n python3-semanage
137 %defattr(644,root,root,755)
138 %attr(755,root,root) %{py3_sitedir}/_semanage.cpython-*.so
139 %{py3_sitedir}/semanage.py
140 %{py3_sitedir}/__pycache__/semanage.cpython-*.py[co]
141 %attr(755,root,root) %{_libexecdir}/selinux/semanage_migrate_store