SHA256
1
0
forked from pool/libselinux

Accepting request 590073 from home:jsegitz:branches:libselinux

- Updated spec file to use python3. Added python3.patch to fix
  build

OBS-URL: https://build.opensuse.org/request/show/590073
OBS-URL: https://build.opensuse.org/package/show/security:SELinux/libselinux?expand=0&rev=94
This commit is contained in:
Johannes Segitz 2018-03-22 10:58:22 +00:00 committed by Git OBS Bridge
parent b0259f782e
commit a9b0f4a216
4 changed files with 39 additions and 10 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 16 15:25:10 UTC 2018 - jsegitz@suse.com
- Updated spec file to use python3. Added python3.patch to fix
build
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Nov 24 09:09:02 UTC 2017 - jsegitz@suse.com Fri Nov 24 09:09:02 UTC 2017 - jsegitz@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package libselinux-bindings # spec file for package libselinux-bindings
# #
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,6 +16,8 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define libsepol_ver 2.6 %define libsepol_ver 2.6
Name: libselinux-bindings Name: libselinux-bindings
@ -32,10 +34,12 @@ Source1: selinux-ready
Source2: baselibs.conf Source2: baselibs.conf
# PATCH-FIX-UPSTREAM Include <sys/uio.h> for readv prototype # PATCH-FIX-UPSTREAM Include <sys/uio.h> for readv prototype
Patch4: readv-proto.patch Patch4: readv-proto.patch
Patch5: python3.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libsepol-devel-static >= %{libsepol_ver} BuildRequires: libsepol-devel-static >= %{libsepol_ver}
BuildRequires: pcre-devel BuildRequires: pcre-devel
BuildRequires: python-devel BuildRequires: python-rpm-macros
BuildRequires: python3-devel
BuildRequires: ruby-devel BuildRequires: ruby-devel
BuildRequires: swig BuildRequires: swig
@ -43,14 +47,19 @@ BuildRequires: swig
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 python-selinux %package -n python3-selinux
Summary: Python bindings for the SELinux runtime library Summary: Python bindings for the SELinux runtime library
License: SUSE-Public-Domain License: SUSE-Public-Domain
Group: Development/Libraries/Python Group: Development/Libraries/Python
%define oldpython python
%ifpython2
Obsoletes: %{oldpython}-selinux < %{version}
Provides: %{oldpython}-selinux = %{version}
%endif
Requires: libselinux1 = %{version} Requires: libselinux1 = %{version}
Requires: python Requires: python3
%description -n python-selinux %description -n python3-selinux
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.
@ -74,11 +83,12 @@ language.
%prep %prep
%setup -q -n libselinux-%{version} %setup -q -n libselinux-%{version}
%patch4 -p1 %patch4 -p1
%patch5 -p1
%build %build
make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src
make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src swigify make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src swigify
make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src pywrap make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" PYTHON=/usr/bin/python3 -C src pywrap
make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src rubywrap make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src rubywrap
%install %install
@ -87,10 +97,10 @@ make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" -C src install-rubywrap make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" -C src install-rubywrap
rm -rf $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT%{_libdir}/libselinux.* $RPM_BUILD_ROOT%{_libdir}/pkgconfig rm -rf $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT%{_libdir}/libselinux.* $RPM_BUILD_ROOT%{_libdir}/pkgconfig
%files -n python-selinux %files -n python3-selinux
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{py_sitedir}/selinux/ %{python3_sitearch}/selinux/
%{py_sitedir}/_selinux.so %{python3_sitearch}/_selinux.so
%files -n ruby-selinux %files -n ruby-selinux
%defattr(-,root,root,-) %defattr(-,root,root,-)

View File

@ -1,7 +1,7 @@
# #
# spec file for package libselinux # spec file for package libselinux
# #
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed

13
python3.patch Normal file
View File

@ -0,0 +1,13 @@
Index: libselinux-2.6/src/Makefile
===================================================================
--- libselinux-2.6.orig/src/Makefile 2016-10-14 17:31:26.000000000 +0200
+++ libselinux-2.6/src/Makefile 2018-03-22 11:33:36.527385495 +0100
@@ -1,7 +1,7 @@
# Support building the Python bindings multiple times, against various Python
# runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build
# targets with "PYPREFIX":
-PYTHON ?= python
+PYTHON ?= python3
PYPREFIX ?= $(notdir $(PYTHON))
RUBY ?= ruby
RUBYPREFIX ?= $(notdir $(RUBY))