Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #910, #48, #102 - Require Python 3.9 in RPM package #398

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 33 additions & 13 deletions packaging/skupper-router.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
%global proton_vendored_version 0.39.0
%define proton_install_prefix %{_builddir}/qpid-proton-%{proton_vendored_version}/install

%global python_minimum_version 3.9.0
%global proton_minimum_version 0.37.0
%global libwebsockets_minimum_version 3.0.1
%global libnghttp2_minimum_version 1.33.0
Expand All @@ -50,7 +51,10 @@ Summary: The skrouterd router daemon for Skupper.io
License: ASL 2.0
URL: https://skupper.io

Requires: python3
%{?fedora:Requires: python3 >= %{python_minimum_version}}
%{?fedora:Requires: python3-cffi}
%{?rhel:Requires: python39 >= %{python_minimum_version}}
%{?rhel:Requires: python39-cffi}
Requires: skupper-router-common == %{version}
Requires: libwebsockets >= %{libwebsockets_minimum_version}
Requires: libnghttp2 >= %{libnghttp2_minimum_version}
Expand All @@ -63,14 +67,21 @@ BuildRequires: gcc-c++
BuildRequires: cmake

# skupper-router requirements
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%{?fedora:BuildRequires: python3-devel >= %{python_minimum_version}}
%{?fedora:BuildRequires: python3-setuptools}
%{?fedora:BuildRequires: python3-pip}
# without wheel the installed files lack `python_qpid_proton-0.37.0.dist-info`
%{?fedora:BuildRequires: python3-wheel}
%{?rhel:BuildRequires: python39-devel >= %{python_minimum_version}}
%{?rhel:BuildRequires: python39-setuptools}
%{?rhel:BuildRequires: python39-pip}
%{?rhel:BuildRequires: python39-wheel}
%{?rhel:BuildRequires: python39-rpm-macros}
BuildRequires: libwebsockets-devel >= %{libwebsockets_minimum_version}
BuildRequires: libnghttp2-devel >= %{libnghttp2_minimum_version}
BuildRequires: libunwind-devel >= %{libunwind_minimum_version}
# man pages --help
BuildRequires: asciidoc
BuildRequires: python3-qpid-proton >= %{proton_minimum_version}
# check ctest
BuildRequires: cyrus-sasl-plain
BuildRequires: openssl
Expand All @@ -94,19 +105,24 @@ A lightweight message router, written in C and built on Qpid Proton, that provid
%build
%set_build_flags
cd %{_builddir}/qpid-proton-%{proton_vendored_version}
# PROTON-2473: -Wno-error=deprecated-declarations for DH_new, DH_...
%__cmake . -B "%{__cmake_builddir}" \
-DCMAKE_C_FLAGS="$CFLAGS -Wno-error=deprecated-declarations" \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_BINDINGS=OFF \
-DBUILD_BINDINGS=python \
-DPython_EXECUTABLE=%{python3} \
-DBUILD_TLS=ON -DSSL_IMPL=openssl \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DCMAKE_INSTALL_PREFIX=%{proton_install_prefix}
%__cmake --build "%{__cmake_builddir}" %{?_smp_mflags} --verbose
%__cmake --install "%{__cmake_builddir}"

# for `import proton` when rendering `sktools --help` to manpages, and for running tests later
# this will install all-in-one cpython .so module with proton inside
%python3 -m pip install --target "%{buildroot}/usr/lib/skupper-router/python/" %{_builddir}/qpid-proton-%{proton_vendored_version}/%{__cmake_builddir}/python/dist/python-qpid-proton-*.tar.gz
#%python3 -m pip install --target "%{buildroot}/usr/lib/skupper-router/python/" %{_builddir}/qpid-proton-%{proton_vendored_version}/%{__cmake_builddir}/python/dist/python_qpid_proton-*.whl
export PYTHONPATH="%{buildroot}/usr/lib/skupper-router/python/"

cd %{_builddir}/skupper-router-%{version}
%cmake \
-DVERSION="%{version}" \
Expand All @@ -121,8 +137,8 @@ cd %{_builddir}/skupper-router-%{version}
%cmake_install

%check
cd %{_builddir}/skupper-router-%{version}
%ctest
cd %{_builddir}/skupper-router-%{version}/%{__cmake_builddir}
PYTHONPATH="%{buildroot}/usr/lib/skupper-router/python/" %__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags}

%files
/usr/sbin/skrouterd
Expand All @@ -139,21 +155,26 @@ cd %{_builddir}/skupper-router-%{version}

%package common
Summary: Internal code shared between the router daemon and the tools
BuildArch: noarch
# BuildArch: noarch # due to binary proton
Requires: python3
Requires: python3-qpid-proton >= %{proton_minimum_version}

%description common
%{summary}.

%files common
# -tools and -tests depend on this
/usr/lib/skupper-router/python/cproton.py
/usr/lib/skupper-router/python/proton
/usr/lib/skupper-router/python/python_qpid_proton-*.dist-info
/usr/lib/skupper-router/python/_cproton.cpython-*-*-linux-gnu.so
/usr/lib/skupper-router/python/__pycache__/cproton.cpython-*.pyc
# skupper-router, -tools, and -tests depend on this
/usr/lib/skupper-router/python/skupper_router_internal/

%package tools
Summary: The skstat and skmanage tools for skrouterd
BuildArch: noarch
Requires: python3
Requires: python3-qpid-proton >= %{proton_minimum_version}
Requires: skupper-router-common == %{version}
Requires: cyrus-sasl-plain
Requires: cyrus-sasl-gssapi
Expand All @@ -171,7 +192,6 @@ Requires: cyrus-sasl-gssapi
%package tests
Summary: Tests for the skupper router and the tools
Requires: python3
Requires: python3-qpid-proton >= %{proton_minimum_version}
Requires: skupper-router == %{version}
Requires: skupper-router-tools == %{version}
Requires: cyrus-sasl-plain
Expand Down