SHA256
1
0
forked from pool/libselinux

Accepting request 609004 from home:mcepl:SELinux

Rebase to 2.7

OBS-URL: https://build.opensuse.org/request/show/609004
OBS-URL: https://build.opensuse.org/package/show/security:SELinux/libselinux?expand=0&rev=96
This commit is contained in:
Johannes Segitz 2018-05-23 07:59:14 +00:00 committed by Git OBS Bridge
parent a9b0f4a216
commit f80cff1a4a
7 changed files with 52 additions and 28 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ea2dde50665c202253ba5caac7738370ea0337c47b251ba981c60d24e1a118a
size 203119

3
libselinux-2.7.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d0fec0769b3ad60aa7baf9b9a4b7a056827769dc2dadda0dc0eb59b3d1c18c57
size 187574

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon May 14 22:50:42 UTC 2018 - mcepl@cepl.eu
- Update to version 2.7.
* %files needed to be heavily modified
* Based expressly on python3, not just python
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Mar 16 15:25:10 UTC 2018 - jsegitz@suse.com Fri Mar 16 15:25:10 UTC 2018 - jsegitz@suse.com

View File

@ -18,23 +18,23 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define libsepol_ver 2.6 %define libsepol_ver 2.7
Name: libselinux-bindings Name: libselinux-bindings
Version: 2.6 Version: 2.7
Release: 0 Release: 0
Summary: SELinux runtime library and simple utilities Summary: SELinux runtime library and simple utilities
License: GPL-2.0 and SUSE-Public-Domain License: GPL-2.0-only AND SUSE-Public-Domain
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Url: https://github.com/SELinuxProject/selinux/wiki/Releases Url: https://github.com/SELinuxProject/selinux/wiki/Releases
# embedded is the MD5 # embedded is the MD5
Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014/libselinux-%{version}.tar.gz Source: https://github.com/SELinuxProject/selinux/archive/libselinux-%{version}.tar.gz
Source1: selinux-ready Source1: selinux-ready
Source2: baselibs.conf Source2: baselibs.conf
Patch3: python3.patch
# 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
@ -82,25 +82,31 @@ language.
%prep %prep
%setup -q -n libselinux-%{version} %setup -q -n libselinux-%{version}
%patch3 -p1
%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 V=1
make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src swigify make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src swigify V=1
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 pywrap V=1
make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src rubywrap make %{?_smp_mflags} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src rubywrap V=1
%install %install
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" -C src install make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" \
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" -C src install-pywrap SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" LIBSEPOLA=%{_libdir}/libsepol.a \
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" -C src install-rubywrap -C src install V=1
rm -rf $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT%{_libdir}/libselinux.* $RPM_BUILD_ROOT%{_libdir}/pkgconfig make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" \
SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" LIBSEPOLA=%{_libdir}/libsepol.a \
-C src install-pywrap V=1
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" \
SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" LIBSEPOLA=%{_libdir}/libsepol.a \
-C src install-rubywrap V=1
rm -rf $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT%{_libdir}/libselinux.* \
$RPM_BUILD_ROOT%{_libdir}/pkgconfig
%files -n python3-selinux %files -n python3-selinux
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{python3_sitearch}/selinux/ %{python3_sitearch}/*selinux*
%{python3_sitearch}/_selinux.so
%files -n ruby-selinux %files -n ruby-selinux
%defattr(-,root,root,-) %defattr(-,root,root,-)

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon May 14 22:45:54 UTC 2018 - mcepl@cepl.eu
- Update to version 2.7.
* %files needed to be heavily modified
* Based expressly on python3, not just python
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Nov 24 09:09:02 UTC 2017 - jsegitz@suse.com Fri Nov 24 09:09:02 UTC 2017 - jsegitz@suse.com

View File

@ -16,19 +16,20 @@
# #
%define libsepol_ver 2.6 %define libsepol_ver 2.7
Name: libselinux Name: libselinux
Version: 2.6 Version: 2.7
Release: 0 Release: 0
Summary: SELinux runtime library and utilities Summary: SELinux runtime library and utilities
License: GPL-2.0 and SUSE-Public-Domain License: GPL-2.0-only AND SUSE-Public-Domain
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Url: https://github.com/SELinuxProject/selinux/wiki/Releases Url: https://github.com/SELinuxProject/selinux/wiki/Releases
Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014/%{name}-%{version}.tar.gz Source: https://github.com/SELinuxProject/selinux/archive/libselinux-%{version}.tar.gz
Source1: selinux-ready Source1: selinux-ready
Source2: baselibs.conf Source2: baselibs.conf
Patch3: python3.patch
# 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
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -36,6 +37,7 @@ BuildRequires: fdupes
BuildRequires: libsepol-devel >= %{libsepol_ver} BuildRequires: libsepol-devel >= %{libsepol_ver}
BuildRequires: pcre-devel BuildRequires: pcre-devel
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: python3
%description %description
libselinux provides an interface to get and set process and file libselinux provides an interface to get and set process and file
@ -97,6 +99,7 @@ necessary to develop your own software using libselinux.
%prep %prep
%setup -q %setup -q
%patch3 -p1
%patch4 -p1 %patch4 -p1
%build %build
@ -139,6 +142,7 @@ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/selinux-ready
%{_sbindir}/matchpathcon %{_sbindir}/matchpathcon
%{_sbindir}/selabel_digest %{_sbindir}/selabel_digest
%{_sbindir}/selabel_lookup %{_sbindir}/selabel_lookup
%{_sbindir}/selinux_check_access
%{_sbindir}/selabel_lookup_best_match %{_sbindir}/selabel_lookup_best_match
%{_sbindir}/selabel_partial_match %{_sbindir}/selabel_partial_match
%{_sbindir}/selinuxconlist %{_sbindir}/selinuxconlist
@ -146,7 +150,7 @@ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/selinux-ready
%{_sbindir}/selinuxenabled %{_sbindir}/selinuxenabled
%{_sbindir}/setenforce %{_sbindir}/setenforce
%{_sbindir}/togglesebool %{_sbindir}/togglesebool
%{_sbindir}/selinux_restorecon #%#{_sbindir}/selinux_restorecon
%{_sbindir}/selinux-ready %{_sbindir}/selinux-ready
%{_sbindir}/selinuxexeccon %{_sbindir}/selinuxexeccon
%{_sbindir}/sefcontext_compile %{_sbindir}/sefcontext_compile

View File

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