[packages/python-selinux] - python 2 module copied from libselinux.spec v2.9 (even though 3.1 can be forced to build, 2.9 is

qboosh qboosh at pld-linux.org
Thu Jun 10 21:10:43 CEST 2021


commit 64958ed049627640b53d35d8d7e2d240a9c0336b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Jun 10 21:13:22 2021 +0200

    - python 2 module copied from libselinux.spec v2.9
      (even though 3.1 can be forced to build, 2.9 is the last version officially supporting python 2)

 libselinux-vcontext-selinux.patch | 10 +++++
 python-selinux.spec               | 83 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
---
diff --git a/python-selinux.spec b/python-selinux.spec
new file mode 100644
index 0000000..4122ae6
--- /dev/null
+++ b/python-selinux.spec
@@ -0,0 +1,83 @@
+%define	sepol_ver	2.9
+Summary:	Python 2 binding for SELinux library
+Summary(pl.UTF-8):	Wiązania Pythona 2 do biblioteki SELinux
+Name:		python-selinux
+Version:	2.9
+Release:	1
+License:	Public Domain
+Group:		Libraries
+#Source0Download: https://github.com/SELinuxProject/selinux/wiki/Releases
+Source0:	https://github.com/SELinuxProject/selinux/releases/download/20190315/libselinux-%{version}.tar.gz
+# Source0-md5:	bb449431b6ed55a0a0496dbc366d6e31
+Patch0:		libselinux-vcontext-selinux.patch
+URL:		https://github.com/SELinuxProject/selinux/wiki
+%ifarch ppc ppc64 sparc sparcv9 sparc64
+BuildRequires:	gcc >= 5:3.4
+%else
+BuildRequires:	gcc >= 5:3.2
+%endif
+BuildRequires:	glibc-devel >= 6:2.3
+BuildRequires:	libsepol-static >= %{sepol_ver}
+BuildRequires:	pcre-devel
+BuildRequires:	pkgconfig
+BuildRequires:	python-devel >= 2
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+BuildRequires:	sed >= 4.0
+BuildRequires:	swig-python
+Requires:	libselinux >= %{version}
+ExcludeArch:	i386
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Python 2 binding for SELinux library.
+
+%description -l pl.UTF-8
+Wiązania Pythona 2 do biblioteki SELinux.
+
+%prep
+%setup -q -n libselinux-%{version}
+%patch0 -p1
+
+# "-z defs" doesn't mix with --as-needed when some object needs symbols from
+# ld.so (because of __thread variable in this case)
+%{__sed} -i -e 's/-z,defs,//' src/Makefile
+
+%build
+%{__make} -j1 pywrap \
+	CC="%{__cc}" \
+	CFLAGS="%{rpmcppflags} %{rpmcflags} -D_FILE_OFFSET_BITS=64" \
+	LDFLAGS="%{rpmldflags}" \
+	LIBDIR=%{_libdir} \
+	PYPREFIX=python2 \
+	PYSITEDIR=%{py_sitedir} \
+	PYTHON=%{__python}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install-pywrap \
+	LIBDIR=%{_libdir} \
+	SHLIBDIR=/%{_lib} \
+	PYPREFIX=python2 \
+	PYSITEDIR=%{py_sitedir} \
+	PYTHON=%{__python} \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%py_comp $RPM_BUILD_ROOT%{py_sitedir}/selinux
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/selinux
+%py_postclean
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE
+%dir %{py_sitedir}/selinux
+%attr(755,root,root) %{py_sitedir}/_selinux.so
+%attr(755,root,root) %{py_sitedir}/selinux/audit2why.so
+%{py_sitedir}/selinux/__init__.py[co]
diff --git a/libselinux-vcontext-selinux.patch b/libselinux-vcontext-selinux.patch
new file mode 100644
index 0000000..0ad15a5
--- /dev/null
+++ b/libselinux-vcontext-selinux.patch
@@ -0,0 +1,10 @@
+--- libselinux-2.0.65/include/selinux/av_permissions.h.orig	2008-02-21 17:11:33.000000000 +0100
++++ libselinux-2.0.65/include/selinux/av_permissions.h	2008-09-10 22:17:10.876983118 +0200
+@@ -542,6 +542,7 @@
+ #define CAPABILITY__SETFCAP                       0x80000000UL
+ #define CAPABILITY2__MAC_OVERRIDE                 0x00000001UL
+ #define CAPABILITY2__MAC_ADMIN                    0x00000002UL
++#define CAPABILITY2__CONTEXT                      0x00000004UL
+ #define PASSWD__PASSWD                            0x00000001UL
+ #define PASSWD__CHFN                              0x00000002UL
+ #define PASSWD__CHSH                              0x00000004UL
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-selinux.git/commitdiff/64958ed049627640b53d35d8d7e2d240a9c0336b



More information about the pld-cvs-commit mailing list