Accepting request 1090487 from home:jsegitz:branches:home:ojkastl_buildservice:branches:security:SELinux

- allow building this with different python versions, to make this
  usable for the new sle15 macro (using python3.11)

OBS-URL: https://build.opensuse.org/request/show/1090487
OBS-URL: https://build.opensuse.org/package/show/security:SELinux/libselinux?expand=0&rev=154
This commit is contained in:
Johannes Segitz 2023-06-02 12:03:50 +00:00 committed by Git OBS Bridge
parent 781fce764f
commit 8bc935fc0e
2 changed files with 34 additions and 5 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jun 1 11:50:33 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
- allow building this with different python versions, to make this
usable for the new sle15 macro (using python3.11)
------------------------------------------------------------------- -------------------------------------------------------------------
Fri May 5 12:35:31 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com> Fri May 5 12:35:31 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>

View File

@ -16,7 +16,30 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?sle15_python_module_pythons}
%if 0%{?suse_version} < 1699
# Leap15, SLES15
# have some safe defaults
%define python_subpackage_name python3-libselinux
%define python_base_requirement python3
%if "%pythons" == "python36"
%define python_subpackage_name python36-libselinux
%define python_base_requirement python36
%endif
%if "%pythons" == "python310"
%define python_subpackage_name python310-libselinux
%define python_base_requirement python310
%endif
%if "%pythons" == "python311"
%define python_subpackage_name python311-libselinux
%define python_base_requirement python311
%endif
%else
# Tumbleweed
%define python_subpackage_name python3-libselinux
%define python_base_requirement python3
%endif
%define libsepol_ver 3.5 %define libsepol_ver 3.5
Name: libselinux-bindings Name: libselinux-bindings
Version: 3.5 Version: 3.5
@ -50,18 +73,18 @@ BuildRequires: pkgconfig(libpcre2-8)
libselinux provides an interface to get and set process and file libselinux provides an interface to get and set process and file
security contexts and to obtain security policy decisions. security contexts and to obtain security policy decisions.
%package -n python3-selinux %package -n %{python_subpackage_name}
%define oldpython python %define oldpython python
Summary: Python bindings for the SELinux runtime library Summary: Python bindings for the SELinux runtime library
Group: Development/Libraries/Python Group: Development/Libraries/Python
Requires: %{python_base_requirement}
Requires: libselinux1 = %{version} Requires: libselinux1 = %{version}
Requires: python3
%ifpython2 %ifpython2
Obsoletes: %{oldpython}-selinux < %{version} Obsoletes: %{oldpython}-selinux < %{version}
Provides: %{oldpython}-selinux = %{version} Provides: %{oldpython}-selinux = %{version}
%endif %endif
%description -n python3-selinux %description -n %{python_subpackage_name}
libselinux provides an interface to get and set process and file libselinux provides an interface to get and set process and file
security contexts and to obtain security policy decisions. security contexts and to obtain security policy decisions.
@ -95,7 +118,7 @@ make DESTDIR=%{buildroot} LIBDIR="%{_libdir}" SHLIBDIR="/%{_lib}" LIBSEPOLA=%{_l
make DESTDIR=%{buildroot} LIBDIR="%{_libdir}" SHLIBDIR="/%{_lib}" LIBSEPOLA=%{_libdir}/libsepol.a install-rubywrap V=1 make DESTDIR=%{buildroot} LIBDIR="%{_libdir}" SHLIBDIR="/%{_lib}" LIBSEPOLA=%{_libdir}/libsepol.a install-rubywrap V=1
rm -rf %{buildroot}/%{_lib} %{buildroot}%{_libdir}/libselinux.* %{buildroot}%{_libdir}/pkgconfig rm -rf %{buildroot}/%{_lib} %{buildroot}%{_libdir}/libselinux.* %{buildroot}%{_libdir}/pkgconfig
%files -n python3-selinux %files -n %{python_subpackage_name}
%{python3_sitearch}/*selinux* %{python3_sitearch}/*selinux*
%files -n ruby-selinux %files -n ruby-selinux