| |
@@ -4,7 +4,7 @@
|
| |
Summary: SELinux library and simple utilities
|
| |
Name: libselinux
|
| |
Version: 3.5
|
| |
- Release: 1%{?dist}
|
| |
+ Release: 2%{?dist}
|
| |
License: LicenseRef-Fedora-Public-Domain
|
| |
# https://github.com/SELinuxProject/selinux/wiki/Releases
|
| |
Source0: https://github.com/SELinuxProject/selinux/releases/download/3.5/libselinux-3.5.tar.gz
|
| |
@@ -20,7 +20,7 @@
|
| |
# Patch list end
|
| |
BuildRequires: gcc make
|
| |
BuildRequires: ruby-devel ruby libsepol-static >= %{libsepolver} swig pcre2-devel xz-devel
|
| |
- BuildRequires: python3 python3-devel python3-setuptools python3-pip
|
| |
+ BuildRequires: python3-devel
|
| |
BuildRequires: systemd
|
| |
Requires: libsepol%{?_isa} >= %{libsepolver} pcre2
|
| |
Conflicts: filesystem < 3, selinux-policy-base < 3.13.1-138
|
| |
@@ -89,6 +89,12 @@
|
| |
%prep
|
| |
%autosetup -p 2 -n libselinux-%{version}
|
| |
|
| |
+
|
| |
+ %generate_buildrequires
|
| |
+ cd src # this is where the setup.py script is
|
| |
+ %pyproject_buildrequires
|
| |
+
|
| |
+
|
| |
%build
|
| |
export DISABLE_RPM="y"
|
| |
export USE_PCRE2="y"
|
| |
@@ -96,39 +102,16 @@
|
| |
%set_build_flags
|
| |
CFLAGS="$CFLAGS -fno-semantic-interposition"
|
| |
|
| |
- # To support building the Python wrapper against multiple Python runtimes
|
| |
- # Define a function, for how to perform a "build" of the python wrapper against
|
| |
- # a specific runtime:
|
| |
- BuildPythonWrapper() {
|
| |
- BinaryName=$1
|
| |
-
|
| |
- # Perform the build from the upstream Makefile:
|
| |
- %make_build \
|
| |
- PYTHON=$BinaryName \
|
| |
- LIBDIR="%{_libdir}" \
|
| |
- pywrap
|
| |
- }
|
| |
-
|
| |
%make_build LIBDIR="%{_libdir}" swigify
|
| |
%make_build LIBDIR="%{_libdir}" all
|
| |
|
| |
- BuildPythonWrapper %{__python3}
|
| |
+ cd src
|
| |
+ %pyproject_wheel
|
| |
+ cd -
|
| |
|
| |
%make_build RUBYINC="%{ruby_inc}" SHLIBDIR="%{_libdir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" rubywrap
|
| |
|
| |
%install
|
| |
- InstallPythonWrapper() {
|
| |
- BinaryName=$1
|
| |
-
|
| |
- make \
|
| |
- PYTHON=$BinaryName \
|
| |
- DESTDIR="%{buildroot}" LIBDIR="%{_libdir}" \
|
| |
- SHLIBDIR="%{_lib}" BINDIR="%{_bindir}" \
|
| |
- SBINDIR="%{_sbindir}" \
|
| |
- LIBSEPOLA="%{_libdir}/libsepol.a" \
|
| |
- install-pywrap
|
| |
- }
|
| |
-
|
| |
rm -rf %{buildroot}
|
| |
mkdir -p %{buildroot}%{_tmpfilesdir}
|
| |
mkdir -p %{buildroot}%{_libdir}
|
| |
@@ -137,7 +120,11 @@
|
| |
install -d -m 0755 %{buildroot}%{_rundir}/setrans
|
| |
echo "d %{_rundir}/setrans 0755 root root" > %{buildroot}%{_tmpfilesdir}/libselinux.conf
|
| |
|
| |
- InstallPythonWrapper %{__python3}
|
| |
+ %pyproject_install
|
| |
+ %pyproject_save_files selinux
|
| |
+ # this is what the make install-pywrap job is doing, TODO move to setup.py
|
| |
+ ln -sf --relative %{buildroot}%{python3_sitearch}/{selinux/,}_selinux%{python3_ext_suffix}
|
| |
+ install -m 644 src/selinux.py %{buildroot}%{python3_sitearch}/selinux/__init__.py
|
| |
|
| |
%make_install LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" BINDIR="%{_bindir}" SBINDIR="%{_sbindir}"
|
| |
make DESTDIR="%{buildroot}" RUBYINSTALL=%{ruby_vendorarchdir} install-rubywrap
|
| |
@@ -205,15 +192,19 @@
|
| |
%files static
|
| |
%{_libdir}/libselinux.a
|
| |
|
| |
- %files -n python3-libselinux
|
| |
- %{python3_sitearch}/selinux/
|
| |
- %{python3_sitearch}/selinux-%{version}*
|
| |
- %{python3_sitearch}/_selinux*
|
| |
+ %files -n python3-libselinux -f %{pyproject_files}
|
| |
+ # manually installed/linked files:
|
| |
+ %pycached %{python3_sitearch}/selinux/__init__.py
|
| |
+ %{python3_sitearch}/_selinux%{python3_ext_suffix}
|
| |
|
| |
%files ruby
|
| |
%{ruby_vendorarchdir}/selinux.so
|
| |
|
| |
%changelog
|
| |
+ * Mon May 22 2023 Miro Hrončok <mhroncok@redhat.com> - 3.5-2
|
| |
+ - Install the Python package via standardized Python RPM macros
|
| |
+ - Fixes: rhbz#2209019
|
| |
+
|
| |
* Fri Feb 24 2023 Petr Lautrbach <lautrbach@redhat.com> - 3.5-1
|
| |
- SELinux userspace 3.5 release
|
| |
|
| |
This fixes problems with new pip, for example https://bugzilla.redhat.com/2209019
It also ensures the INSTALLER is properly set to rpm, RECORD is not installed etc.
On another hand, this removes the ability to call BuildPythonWrapper/InstallPythonWrapper multiple times.
Calling the macros repeatedly with different %python3_pkgversion set should be doable, but was never tested.
It also duplicates the Makefile partially, but that could be ideally solved in the upstream's setup.py.