]>
Commit | Line | Data |
---|---|---|
69350c54 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python # Python (any) bindings | |
4 | %bcond_without python2 # Python 2 binding | |
5 | %bcond_without python3 # Python 3 binding | |
6 | # | |
7 | %if %{without python} | |
8 | %undefine with_python2 | |
9 | %undefine with_python3 | |
10 | %endif | |
999c2098 | 11 | Summary: An interface for SELinux management |
9b912e4c | 12 | Summary(pl.UTF-8): Interfejs do zarządzania SELinuksem |
999c2098 | 13 | Name: libsemanage |
a90263ff JB |
14 | Version: 2.8 |
15 | Release: 1 | |
999c2098 AM |
16 | License: LGPL v2.1+ |
17 | Group: Libraries | |
be126f80 | 18 | #Source0Download: https://github.com/SELinuxProject/selinux/wiki/Releases |
a90263ff JB |
19 | Source0: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/%{name}-%{version}.tar.gz |
20 | # Source0-md5: 62ed7bb2ede677a735f2750751677a4f | |
be126f80 JB |
21 | Patch0: %{name}-libexecdir.patch |
22 | URL: https://github.com/SELinuxProject/selinux/wiki | |
fe16c4f5 | 23 | BuildRequires: bison |
2206d4e6 | 24 | BuildRequires: bzip2-devel |
fe16c4f5 | 25 | BuildRequires: flex |
a90263ff JB |
26 | BuildRequires: libselinux-devel >= 2.8 |
27 | BuildRequires: libsepol-devel >= 2.8 | |
69350c54 JB |
28 | %{?with_python2:BuildRequires: python-devel >= 2} |
29 | %{?with_python3:BuildRequires: python3-devel >= 1:3.2} | |
48cfd300 | 30 | BuildRequires: rpm-pythonprov |
69350c54 | 31 | BuildRequires: rpmbuild(macros) >= 1.714 |
a90263ff JB |
32 | Requires: libselinux >= 2.8 |
33 | Requires: libsepol >= 2.8 | |
999c2098 AM |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
35 | ||
36 | %description | |
37 | An interface for SELinux management. | |
38 | ||
28e7fd3d JR |
39 | %description -l pl.UTF-8 |
40 | Interfejs do zarządzania SELinuksem. | |
9d002d9c | 41 | |
999c2098 | 42 | %package devel |
9d002d9c | 43 | Summary: Header files for libsemanage library |
9b912e4c | 44 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libsemanage |
999c2098 AM |
45 | Group: Development/Libraries |
46 | Requires: %{name} = %{version}-%{release} | |
47 | ||
48 | %description devel | |
9d002d9c JB |
49 | This package contains the header files for libsemanage library. |
50 | ||
28e7fd3d JR |
51 | %description devel -l pl.UTF-8 |
52 | Ten pakiet zawiera pliki nagłówkowe biblioteki libsemanage. | |
999c2098 AM |
53 | |
54 | %package static | |
55 | Summary: Static version of libsemanage library | |
9b912e4c | 56 | Summary(pl.UTF-8): Statyczna wersja biblioteki libsemanage |
999c2098 AM |
57 | Group: Development/Libraries |
58 | Requires: %{name}-devel = %{version}-%{release} | |
59 | ||
60 | %description static | |
61 | Static version of libsemanage library. | |
62 | ||
28e7fd3d | 63 | %description static -l pl.UTF-8 |
999c2098 AM |
64 | Statyczna wersja biblioteki libsemanage. |
65 | ||
48cfd300 | 66 | %package -n python-semanage |
69350c54 JB |
67 | Summary: Python 2 binding for semanage library |
68 | Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki semanage | |
48cfd300 JB |
69 | Group: Libraries/Python |
70 | Requires: %{name} = %{version}-%{release} | |
a90263ff | 71 | Requires: python-selinux >= 2.8 |
48cfd300 JB |
72 | |
73 | %description -n python-semanage | |
69350c54 | 74 | Python 2 binding for semanage library. |
48cfd300 | 75 | |
28e7fd3d | 76 | %description -n python-semanage -l pl.UTF-8 |
69350c54 JB |
77 | Wiązania Pythona 2 do biblioteki semanage. |
78 | ||
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} | |
a90263ff | 84 | Requires: python3-selinux >= 2.8 |
69350c54 JB |
85 | |
86 | %description -n python3-semanage | |
87 | Python 3 binding for semanage library. | |
88 | ||
89 | %description -n python3-semanage -l pl.UTF-8 | |
90 | Wiązania Pythona 3 do biblioteki semanage. | |
48cfd300 | 91 | |
999c2098 AM |
92 | %prep |
93 | %setup -q | |
be126f80 | 94 | %patch0 -p1 |
999c2098 AM |
95 | |
96 | %build | |
69350c54 JB |
97 | %{__make} -j1 all %{?with_python2:pywrap} \ |
98 | CC="%{__cc}" \ | |
99 | CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \ | |
100 | LIBDIR=%{_libdir} \ | |
a90263ff | 101 | LIBEXECDIR=%{_libexecdir} \ |
69350c54 JB |
102 | PYPREFIX=python2 \ |
103 | PYTHON=%{__python} | |
104 | ||
105 | %if %{with python3} | |
106 | %{__make} -j1 -C src pywrap \ | |
999c2098 | 107 | CC="%{__cc}" \ |
be126f80 | 108 | CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \ |
69350c54 | 109 | LIBDIR=%{_libdir} \ |
a90263ff | 110 | LIBEXECDIR=%{_libexecdir} \ |
69350c54 JB |
111 | PYPREFIX=python3 \ |
112 | PYTHON=%{__python3} | |
113 | %endif | |
999c2098 AM |
114 | |
115 | %install | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
69350c54 | 118 | %{__make} install %{?with_python2:install-pywrap} \ |
a90263ff JB |
119 | LIBDIR=%{_libdir} \ |
120 | LIBEXECDIR=%{_libexecdir} \ | |
69350c54 | 121 | PYPREFIX=python2 \ |
a90263ff | 122 | PYSITEDIR=%{py_sitedir} \ |
69350c54 | 123 | PYTHON=%{__python} \ |
999c2098 | 124 | DESTDIR=$RPM_BUILD_ROOT |
8927f05f | 125 | |
be126f80 JB |
126 | # changed in 2.4 |
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 | |
828d2a6c | 130 | ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libsemanage.so.*) \ |
48cfd300 JB |
131 | $RPM_BUILD_ROOT%{_libdir}/libsemanage.so |
132 | ||
69350c54 | 133 | %if %{with python2} |
828d2a6c JB |
134 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
135 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
136 | %py_postclean | |
69350c54 JB |
137 | %endif |
138 | ||
139 | %if %{with python3} | |
140 | %{__make} -C src install-pywrap \ | |
a90263ff JB |
141 | LIBDIR=%{_libdir} \ |
142 | LIBEXECDIR=%{_libexecdir} \ | |
69350c54 | 143 | PYPREFIX=python3 \ |
a90263ff | 144 | PYSITEDIR=%{py3_sitedir} \ |
69350c54 JB |
145 | PYTHON=%{__python3} \ |
146 | DESTDIR=$RPM_BUILD_ROOT | |
147 | ||
148 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
149 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
150 | %endif | |
828d2a6c | 151 | |
999c2098 AM |
152 | %clean |
153 | rm -rf $RPM_BUILD_ROOT | |
154 | ||
48cfd300 JB |
155 | %post -p /sbin/ldconfig |
156 | %postun -p /sbin/ldconfig | |
999c2098 AM |
157 | |
158 | %files | |
159 | %defattr(644,root,root,755) | |
5aadb0da | 160 | %attr(755,root,root) /%{_lib}/libsemanage.so.1 |
f752a62e | 161 | %dir %{_sysconfdir}/selinux |
48cfd300 | 162 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/selinux/semanage.conf |
a888ae4f | 163 | %dir %{_libexecdir}/selinux |
a38bd406 | 164 | %{_mandir}/man5/semanage.conf.5* |
999c2098 AM |
165 | |
166 | %files devel | |
167 | %defattr(644,root,root,755) | |
48cfd300 | 168 | %attr(755,root,root) %{_libdir}/libsemanage.so |
43a24b22 | 169 | %{_pkgconfigdir}/libsemanage.pc |
fe16c4f5 | 170 | %{_includedir}/semanage |
923117dd | 171 | %{_mandir}/man3/semanage_*.3* |
999c2098 AM |
172 | |
173 | %files static | |
174 | %defattr(644,root,root,755) | |
175 | %{_libdir}/libsemanage.a | |
48cfd300 | 176 | |
69350c54 | 177 | %if %{with python2} |
48cfd300 JB |
178 | %files -n python-semanage |
179 | %defattr(644,root,root,755) | |
180 | %attr(755,root,root) %{py_sitedir}/_semanage.so | |
828d2a6c | 181 | %{py_sitedir}/semanage.py[co] |
a888ae4f | 182 | %attr(755,root,root) %{_libexecdir}/selinux/semanage_migrate_store |
69350c54 JB |
183 | %endif |
184 | ||
185 | %if %{with python3} | |
186 | %files -n python3-semanage | |
187 | %defattr(644,root,root,755) | |
5aadb0da | 188 | %attr(755,root,root) %{py3_sitedir}/_semanage.cpython-*.so |
69350c54 JB |
189 | %{py3_sitedir}/semanage.py |
190 | %{py3_sitedir}/__pycache__/semanage.cpython-*.py[co] | |
191 | %endif |