]>
Commit | Line | Data |
---|---|---|
835f2e4f JB |
1 | # |
2 | # Conditional build: | |
3231c037 JB |
3 | %bcond_without python # Python binding |
4 | %bcond_without ruby # Ruby binding | |
835f2e4f | 5 | # |
4f8f4c69 | 6 | %define sepol_ver 2.3 |
e87b3ac3 | 7 | # |
adb66b1f | 8 | Summary: SELinux library and simple utilities |
4967c211 | 9 | Summary(pl.UTF-8): Biblioteka SELinux i proste narzędzia |
adb66b1f | 10 | Name: libselinux |
4f8f4c69 | 11 | Version: 2.3 |
36fb53d9 | 12 | Release: 2 |
fefe9db1 | 13 | License: Public Domain |
adb66b1f | 14 | Group: Libraries |
c11186ed | 15 | #git clone http://oss.tresys.com/git/selinux.git/ |
4f8f4c69 JB |
16 | Source0: http://userspace.selinuxproject.org/releases/current/%{name}-%{version}.tar.gz |
17 | # Source0-md5: b11d4d95ef4bde732dbc8462df57a1e5 | |
3157c0b5 | 18 | Patch0: %{name}-vcontext-selinux.patch |
50fa2c36 | 19 | URL: http://userspace.selinuxproject.org/trac |
ba4f2429 JB |
20 | %ifarch ppc ppc64 sparc sparcv9 sparc64 |
21 | BuildRequires: gcc >= 5:3.4 | |
22 | %else | |
23 | BuildRequires: gcc >= 5:3.2 | |
24 | %endif | |
51212447 | 25 | BuildRequires: glibc-devel >= 6:2.3 |
e87b3ac3 AM |
26 | BuildRequires: libsepol-devel >= %{sepol_ver} |
27 | %{?with_python:BuildRequires: libsepol-static >= %{sepol_ver}} | |
3231c037 JB |
28 | BuildRequires: pcre-devel |
29 | BuildRequires: pkgconfig | |
835f2e4f JB |
30 | %{?with_python:BuildRequires: python-devel} |
31 | %{?with_python:BuildRequires: rpm-pythonprov} | |
3231c037 | 32 | %{?with_ruby:BuildRequires: ruby-devel >= 1.9} |
6b7a7bf6 | 33 | BuildRequires: sed >= 4.0 |
8d42c624 | 34 | %{?with_python:BuildRequires: swig-python} |
3231c037 | 35 | %{?with_ruby:BuildRequires: swig-ruby} |
87678bda | 36 | Requires: glibc(tls) |
e87b3ac3 | 37 | Requires: libsepol >= %{sepol_ver} |
9b0e6c11 | 38 | Obsoletes: selinux-libs |
af1b8555 | 39 | Conflicts: SysVinit < 2.86-4 |
801180f1 | 40 | ExcludeArch: i386 |
c017911b | 41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
adb66b1f | 42 | |
43 | %description | |
6ed4fb38 AM |
44 | Security-enhanced Linux is a patch of the Linux kernel and a number of |
45 | utilities with enhanced security functionality designed to add | |
adb66b1f | 46 | mandatory access controls to Linux. The Security-enhanced Linux kernel |
47 | contains new architectural components originally developed to improve | |
48 | the security of the Flask operating system. These architectural | |
49 | components provide general support for the enforcement of many kinds | |
50 | of mandatory access control policies, including those based on the | |
51 | concepts of Type Enforcement, Role-based Access Control, and | |
52 | Multi-level Security. | |
53 | ||
54 | libselinux provides an API for SELinux applications to get and set | |
55 | process and file security contexts and to obtain security policy | |
56 | decisions. Required for any applications that use the SELinux API. | |
57 | ||
c75faa25 JR |
58 | %description -l pl.UTF-8 |
59 | Security-enhanced Linux jest prototypem jądra Linuksa i wielu | |
60 | aplikacji użytkowych o funkcjach podwyższonego bezpieczeństwa. | |
61 | Zaprojektowany jest tak, aby w prosty sposób ukazać znaczenie | |
62 | obowiązkowej kontroli dostępu dla społeczności linuksowej. Ukazuje | |
63 | również jak taką kontrolę można dodać do istniejącego systemu typu | |
64 | Linux. Jądro SELinux zawiera nowe składniki architektury pierwotnie | |
65 | opracowane w celu ulepszenia bezpieczeństwa systemu operacyjnego | |
3f1ec040 | 66 | Flask. Te elementy zapewniają ogólne wsparcie we wdrażaniu wielu typów |
6ed4fb38 AM |
67 | polityk obowiązkowej kontroli dostępu, włączając te wzorowane na: Type |
68 | Enforcement (TE), kontroli dostępu opartej na rolach (RBAC) i | |
69 | zabezpieczeniach wielopoziomowych. | |
06b84620 | 70 | |
6ed4fb38 AM |
71 | libselinux dostarcza API dla aplikacji SELinux aby mogły pobierać i |
72 | ustawiać procesy i konteksty plików w celu korzystania z polityki | |
c75faa25 JR |
73 | bezpieczeństwa. Biblioteka jest wymagana przez wszystkie aplikacje, |
74 | które używają API SELinux. | |
adb66b1f | 75 | |
76 | %package devel | |
9f09f0e2 | 77 | Summary: Header files and devel documentation |
4967c211 | 78 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja programistyczna |
9f09f0e2 | 79 | Group: Development/Libraries |
5e241984 | 80 | Requires: %{name} = %{epoch}:%{version}-%{release} |
e87b3ac3 | 81 | Requires: libsepol-devel >= %{sepol_ver} |
9b0e6c11 | 82 | Obsoletes: selinux-libs-devel |
adb66b1f | 83 | |
84 | %description devel | |
85 | Header files and devel documentation for SELinux libraries. | |
86 | ||
c75faa25 JR |
87 | %description devel -l pl.UTF-8 |
88 | Pliki nagłówkowe i dokumentacja programistyczna bibliotek SELinux. | |
adb66b1f | 89 | |
90 | %package static | |
9f09f0e2 | 91 | Summary: Static SELinux library |
4967c211 | 92 | Summary(pl.UTF-8): Biblioteki statyczne SELinux |
9f09f0e2 | 93 | Group: Development/Libraries |
5e241984 | 94 | Requires: %{name}-devel = %{epoch}:%{version}-%{release} |
9b0e6c11 | 95 | Obsoletes: selinux-static |
adb66b1f | 96 | |
97 | %description static | |
98 | SELinux static libraries. | |
99 | ||
c75faa25 | 100 | %description static -l pl.UTF-8 |
adb66b1f | 101 | Biblioteki statyczne SELinux. |
102 | ||
103 | %package utils | |
9f09f0e2 | 104 | Summary: SELinux utils |
4967c211 | 105 | Summary(pl.UTF-8): Narzędzia SELinux |
9f09f0e2 | 106 | Group: Applications/System |
5e241984 | 107 | Requires: %{name} = %{epoch}:%{version}-%{release} |
9b0e6c11 | 108 | Obsoletes: selinux-utils |
adb66b1f | 109 | |
110 | %description utils | |
111 | SELinux utils. | |
112 | ||
c75faa25 JR |
113 | %description utils -l pl.UTF-8 |
114 | Narzędzia SELinux. | |
adb66b1f | 115 | |
1531e56e JB |
116 | %package -n python-selinux |
117 | Summary: Python binding for SELinux library | |
4967c211 | 118 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki SELinux |
1531e56e JB |
119 | Group: Libraries/Python |
120 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
121 | ||
122 | %description -n python-selinux | |
123 | Python binding for SELinux library. | |
124 | ||
c75faa25 JR |
125 | %description -n python-selinux -l pl.UTF-8 |
126 | Wiązania Pythona do biblioteki SELinux. | |
1531e56e | 127 | |
3231c037 JB |
128 | %package -n ruby-selinux |
129 | Summary: Ruby binding for SELinux library | |
130 | Summary(pl.UTF-8): Wiązania języka Ruby do biblioteki SELinux | |
131 | Group: Development/Languages | |
132 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
133 | ||
134 | %description -n ruby-selinux | |
135 | Ruby binding for SELinux library. | |
136 | ||
137 | %description -n ruby-selinux -l pl.UTF-8 | |
138 | Wiązania języka Ruby do biblioteki SELinux. | |
139 | ||
adb66b1f | 140 | %prep |
141 | %setup -q | |
3157c0b5 | 142 | %patch0 -p1 |
adb66b1f | 143 | |
6b7a7bf6 JB |
144 | # "-z defs" doesn't mix with --as-needed when some object needs symbols from |
145 | # ld.so (because of __thread variable in this case) | |
146 | sed -i -e 's/-z,defs,//' src/Makefile | |
147 | ||
adb66b1f | 148 | %build |
3231c037 | 149 | %{__make} -j1 all %{?with_python:pywrap} %{?with_ruby:rubywrap} \ |
06b84620 | 150 | CC="%{__cc}" \ |
6ed4fb38 | 151 | CFLAGS="%{rpmcppflags} %{rpmcflags} -D_FILE_OFFSET_BITS=64" \ |
3231c037 JB |
152 | LDFLAGS="%{rpmldflags} -lpcre -lpthread" \ |
153 | LIBDIR=%{_libdir} \ | |
154 | %{?with_ruby:RUBYINC="$(pkg-config --cflags ruby-1.9)"} | |
adb66b1f | 155 | |
156 | %install | |
157 | rm -rf $RPM_BUILD_ROOT | |
06b84620 | 158 | |
3231c037 | 159 | %{__make} install %{?with_python:install-pywrap} %{?with_ruby:install-rubywrap} \ |
f9a14a1c JK |
160 | LIBDIR="$RPM_BUILD_ROOT%{_libdir}" \ |
161 | SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" \ | |
3231c037 JB |
162 | DESTDIR="$RPM_BUILD_ROOT" \ |
163 | RUBYINSTALL="$RPM_BUILD_ROOT%{ruby_vendorarchdir}" | |
adb66b1f | 164 | |
c017911b | 165 | # make symlink across / absolute |
4c5842ce | 166 | ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libselinux.so.*) \ |
c017911b JB |
167 | $RPM_BUILD_ROOT%{_libdir}/libselinux.so |
168 | ||
adb66b1f | 169 | %clean |
170 | rm -rf $RPM_BUILD_ROOT | |
171 | ||
172 | %post -p /sbin/ldconfig | |
173 | %postun -p /sbin/ldconfig | |
174 | ||
175 | %files | |
176 | %defattr(644,root,root,755) | |
949e0ed7 | 177 | %doc ChangeLog LICENSE |
c017911b | 178 | %attr(755,root,root) /%{_lib}/libselinux.so.* |
f63476a2 JB |
179 | %{_mandir}/man5/booleans.5* |
180 | %{_mandir}/man5/customizable_types.5* | |
181 | %{_mandir}/man5/default_contexts.5* | |
182 | %{_mandir}/man5/default_type.5* | |
183 | %{_mandir}/man5/failsafe_context.5* | |
64ef7b6a AM |
184 | %{_mandir}/man5/file_contexts.homedirs.5* |
185 | %{_mandir}/man5/file_contexts.local.5 | |
186 | %{_mandir}/man5/file_contexts.subs.5 | |
187 | %{_mandir}/man5/file_contexts.subs_dist.5 | |
f63476a2 JB |
188 | %{_mandir}/man5/local.users.5* |
189 | %{_mandir}/man5/removable_context.5* | |
190 | %{_mandir}/man5/secolor.conf.5* | |
191 | %{_mandir}/man5/securetty_types.5* | |
192 | %{_mandir}/man5/service_seusers.5* | |
193 | %{_mandir}/man5/seusers.5* | |
194 | %{_mandir}/man5/user_contexts.5* | |
195 | %{_mandir}/man5/virtual_domain_context.5* | |
196 | %{_mandir}/man5/virtual_image_context.5* | |
adb66b1f | 197 | |
198 | %files devel | |
199 | %defattr(644,root,root,755) | |
c017911b | 200 | %attr(755,root,root) %{_libdir}/libselinux.so |
3f14fe48 | 201 | %{_pkgconfigdir}/libselinux.pc |
06b84620 | 202 | %{_includedir}/selinux |
4063d94d | 203 | %{_mandir}/man3/*.3* |
f63476a2 JB |
204 | %{_mandir}/man5/file_contexts.5* |
205 | %{_mandir}/man5/media.5* | |
e18dd3a0 | 206 | %{_mandir}/man5/selabel_*.5* |
f63476a2 JB |
207 | %{_mandir}/man5/sepgsql_contexts.5* |
208 | %{_mandir}/man5/x_contexts.5* | |
adb66b1f | 209 | |
210 | %files static | |
211 | %defattr(644,root,root,755) | |
212 | %{_libdir}/libselinux.a | |
213 | ||
214 | %files utils | |
215 | %defattr(644,root,root,755) | |
f63476a2 JB |
216 | %attr(755,root,root) %{_sbindir}/avcstat |
217 | %attr(755,root,root) %{_sbindir}/compute_* | |
218 | %attr(755,root,root) %{_sbindir}/getconlist | |
219 | %attr(755,root,root) %{_sbindir}/getdefaultcon | |
220 | %attr(755,root,root) %{_sbindir}/getenforce | |
221 | %attr(755,root,root) %{_sbindir}/getfilecon | |
222 | %attr(755,root,root) %{_sbindir}/getpidcon | |
223 | %attr(755,root,root) %{_sbindir}/getsebool | |
224 | %attr(755,root,root) %{_sbindir}/getseuser | |
225 | %attr(755,root,root) %{_sbindir}/matchpathcon | |
226 | %attr(755,root,root) %{_sbindir}/policyvers | |
227 | %attr(755,root,root) %{_sbindir}/selinux* | |
228 | %attr(755,root,root) %{_sbindir}/setenforce | |
64ef7b6a | 229 | %attr(755,root,root) %{_sbindir}/sefcontext_compile |
f63476a2 JB |
230 | %attr(755,root,root) %{_sbindir}/setfilecon |
231 | %attr(755,root,root) %{_sbindir}/togglesebool | |
f63476a2 JB |
232 | %{_mandir}/man8/avcstat.8* |
233 | %{_mandir}/man8/booleans.8* | |
234 | %{_mandir}/man8/getenforce.8* | |
235 | %{_mandir}/man8/getsebool.8* | |
236 | %{_mandir}/man8/matchpathcon.8* | |
21e1440d | 237 | %{_mandir}/man8/sefcontext_compile.8* |
f63476a2 JB |
238 | %{_mandir}/man8/selinux*.8* |
239 | %{_mandir}/man8/setenforce.8* | |
240 | %{_mandir}/man8/togglesebool.8* | |
1531e56e | 241 | |
835f2e4f | 242 | %if %{with python} |
1531e56e JB |
243 | %files -n python-selinux |
244 | %defattr(644,root,root,755) | |
f0f66b1d | 245 | %dir %{py_sitedir}/selinux |
246 | %attr(755,root,root) %{py_sitedir}/selinux/_selinux.so | |
247 | %attr(755,root,root) %{py_sitedir}/selinux/audit2why.so | |
248 | %{py_sitedir}/selinux/__init__.py | |
835f2e4f | 249 | %endif |
3231c037 JB |
250 | |
251 | %if %{with ruby} | |
252 | %files -n ruby-selinux | |
253 | %defattr(644,root,root,755) | |
254 | %attr(755,root,root) %{ruby_vendorarchdir}/selinux.so | |
255 | %endif |