]>
Commit | Line | Data |
---|---|---|
69350c54 JB |
1 | # |
2 | # Conditional build: | |
dced15db | 3 | %bcond_without python # Python 3 bindings |
69350c54 | 4 | # |
999c2098 | 5 | Summary: An interface for SELinux management |
9b912e4c | 6 | Summary(pl.UTF-8): Interfejs do zarządzania SELinuksem |
999c2098 | 7 | Name: libsemanage |
dced15db JB |
8 | Version: 3.1 |
9 | Release: 1 | |
999c2098 AM |
10 | License: LGPL v2.1+ |
11 | Group: Libraries | |
be126f80 | 12 | #Source0Download: https://github.com/SELinuxProject/selinux/wiki/Releases |
dced15db JB |
13 | Source0: https://github.com/SELinuxProject/selinux/releases/download/20200710/%{name}-%{version}.tar.gz |
14 | # Source0-md5: d16eee8c1dc8cf43f59957d575d6bd29 | |
be126f80 JB |
15 | Patch0: %{name}-libexecdir.patch |
16 | URL: https://github.com/SELinuxProject/selinux/wiki | |
c8ac5d00 | 17 | BuildRequires: audit-libs-devel |
fe16c4f5 | 18 | BuildRequires: bison |
2206d4e6 | 19 | BuildRequires: bzip2-devel |
fe16c4f5 | 20 | BuildRequires: flex |
dced15db JB |
21 | BuildRequires: libselinux-devel >= 3.1 |
22 | BuildRequires: libsepol-devel >= 3.1 | |
23 | %{?with_python:BuildRequires: python3-devel >= 1:3.2} | |
48cfd300 | 24 | BuildRequires: rpm-pythonprov |
69350c54 | 25 | BuildRequires: rpmbuild(macros) >= 1.714 |
dced15db JB |
26 | Requires: libselinux >= 3.1 |
27 | Requires: libsepol >= 3.1 | |
999c2098 AM |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
31 | An interface for SELinux management. | |
32 | ||
28e7fd3d JR |
33 | %description -l pl.UTF-8 |
34 | Interfejs do zarządzania SELinuksem. | |
9d002d9c | 35 | |
999c2098 | 36 | %package devel |
9d002d9c | 37 | Summary: Header files for libsemanage library |
9b912e4c | 38 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libsemanage |
999c2098 AM |
39 | Group: Development/Libraries |
40 | Requires: %{name} = %{version}-%{release} | |
41 | ||
42 | %description devel | |
9d002d9c JB |
43 | This package contains the header files for libsemanage library. |
44 | ||
28e7fd3d JR |
45 | %description devel -l pl.UTF-8 |
46 | Ten pakiet zawiera pliki nagłówkowe biblioteki libsemanage. | |
999c2098 AM |
47 | |
48 | %package static | |
49 | Summary: Static version of libsemanage library | |
9b912e4c | 50 | Summary(pl.UTF-8): Statyczna wersja biblioteki libsemanage |
999c2098 AM |
51 | Group: Development/Libraries |
52 | Requires: %{name}-devel = %{version}-%{release} | |
53 | ||
54 | %description static | |
55 | Static version of libsemanage library. | |
56 | ||
28e7fd3d | 57 | %description static -l pl.UTF-8 |
999c2098 AM |
58 | Statyczna wersja biblioteki libsemanage. |
59 | ||
69350c54 JB |
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} | |
dced15db | 65 | Requires: python3-selinux >= 3.1 |
69350c54 JB |
66 | |
67 | %description -n python3-semanage | |
68 | Python 3 binding for semanage library. | |
69 | ||
70 | %description -n python3-semanage -l pl.UTF-8 | |
71 | Wiązania Pythona 3 do biblioteki semanage. | |
48cfd300 | 72 | |
999c2098 AM |
73 | %prep |
74 | %setup -q | |
be126f80 | 75 | %patch0 -p1 |
999c2098 AM |
76 | |
77 | %build | |
dced15db | 78 | %{__make} -j1 all %{?with_python:pywrap} \ |
999c2098 | 79 | CC="%{__cc}" \ |
be126f80 | 80 | CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \ |
69350c54 | 81 | LIBDIR=%{_libdir} \ |
a90263ff | 82 | LIBEXECDIR=%{_libexecdir} \ |
69350c54 JB |
83 | PYPREFIX=python3 \ |
84 | PYTHON=%{__python3} | |
999c2098 AM |
85 | |
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
dced15db | 89 | %{__make} install %{?with_python:install-pywrap} \ |
a90263ff JB |
90 | LIBDIR=%{_libdir} \ |
91 | LIBEXECDIR=%{_libexecdir} \ | |
dced15db | 92 | PYPREFIX=python3 \ |
a90263ff | 93 | PYSITEDIR=%{py_sitedir} \ |
dced15db | 94 | PYTHON=%{__python3} \ |
999c2098 | 95 | DESTDIR=$RPM_BUILD_ROOT |
8927f05f | 96 | |
be126f80 JB |
97 | # changed in 2.4 |
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 | |
828d2a6c | 101 | ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libsemanage.so.*) \ |
48cfd300 JB |
102 | $RPM_BUILD_ROOT%{_libdir}/libsemanage.so |
103 | ||
dced15db | 104 | %if %{with python} |
69350c54 JB |
105 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} |
106 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
107 | %endif | |
828d2a6c | 108 | |
999c2098 AM |
109 | %clean |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
48cfd300 JB |
112 | %post -p /sbin/ldconfig |
113 | %postun -p /sbin/ldconfig | |
999c2098 AM |
114 | |
115 | %files | |
116 | %defattr(644,root,root,755) | |
5aadb0da | 117 | %attr(755,root,root) /%{_lib}/libsemanage.so.1 |
f752a62e | 118 | %dir %{_sysconfdir}/selinux |
48cfd300 | 119 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/selinux/semanage.conf |
a888ae4f | 120 | %dir %{_libexecdir}/selinux |
a38bd406 | 121 | %{_mandir}/man5/semanage.conf.5* |
003ab440 | 122 | %lang(ru) %{_mandir}/ru/man5/semanage.conf.5* |
999c2098 AM |
123 | |
124 | %files devel | |
125 | %defattr(644,root,root,755) | |
48cfd300 | 126 | %attr(755,root,root) %{_libdir}/libsemanage.so |
43a24b22 | 127 | %{_pkgconfigdir}/libsemanage.pc |
fe16c4f5 | 128 | %{_includedir}/semanage |
923117dd | 129 | %{_mandir}/man3/semanage_*.3* |
999c2098 AM |
130 | |
131 | %files static | |
132 | %defattr(644,root,root,755) | |
133 | %{_libdir}/libsemanage.a | |
48cfd300 | 134 | |
dced15db | 135 | %if %{with python} |
69350c54 JB |
136 | %files -n python3-semanage |
137 | %defattr(644,root,root,755) | |
5aadb0da | 138 | %attr(755,root,root) %{py3_sitedir}/_semanage.cpython-*.so |
69350c54 JB |
139 | %{py3_sitedir}/semanage.py |
140 | %{py3_sitedir}/__pycache__/semanage.cpython-*.py[co] | |
dced15db | 141 | %attr(755,root,root) %{_libexecdir}/selinux/semanage_migrate_store |
69350c54 | 142 | %endif |