Skip to content

Commit c44c6b0

Browse files
committed
fixup rpm tests
need to depend on wheel to have simpler life (or disable usage of wheel, I guess) need to depend on pip show it off make it build almost but not quite, wrong rpath forgotten dep, this is good to go to main python 3.9 set for proton python 3.9 fixup build Proton TLS sub lib fixup Interprocedural optimization for proton fixup _disable_source_fetch workaround for Proton OpenSSL3 build issue Fixed # 306: Build and use static Proton library in RPM build
1 parent 349fce8 commit c44c6b0

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ include(CMakeDependentOption)
121121
##
122122
find_library(rt_lib rt)
123123

124-
find_package(Python 3.6.8 REQUIRED COMPONENTS Interpreter Development)
124+
find_package(Python 3.9 REQUIRED COMPONENTS Interpreter Development)
125125
find_package(Threads REQUIRED)
126126
find_package(Proton 0.38.0 REQUIRED COMPONENTS Core Proactor Tls)
127127
message(STATUS "Found Proton: ${Proton_LIBRARIES} (found version \"${Proton_VERSION}\")" )

packaging/skupper-router.spec.rpkg

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
%global proton_vendored_version 0.38.0
4040
%define proton_install_prefix %{_builddir}/qpid-proton-%{proton_vendored_version}/install
4141

42+
%global python_minimum_version 3.9.0
4243
%global proton_minimum_version 0.34.0
4344
%global libwebsockets_minimum_version 3.0.1
4445
%global libnghttp2_minimum_version 1.33.0
@@ -51,7 +52,8 @@ License: ASL 2.0
5152
URL: https://skupper.io
5253
VCS: {{{ git_dir_vcs }}}
5354

54-
Requires: python3
55+
%{?fedora:Requires: python3 >= %{python_minimum_version}}
56+
%{?rhel:Requires: python39 >= %{python_minimum_version}}
5557
Requires: skupper-router-common == %{version}
5658
Requires: libwebsockets >= %{libwebsockets_minimum_version}
5759
Requires: libnghttp2 >= %{libnghttp2_minimum_version}
@@ -63,19 +65,28 @@ BuildRequires: gcc-c++
6365
BuildRequires: cmake
6466

6567
# skupper-router requirements
66-
BuildRequires: python3-devel
67-
BuildRequires: python3-setuptools
68+
%{?fedora:BuildRequires: python3-devel >= %{python_minimum_version}}
69+
%{?fedora:BuildRequires: python3-setuptools}
70+
%{?fedora:BuildRequires: python3-pip}
71+
# without wheel the installed files lack `python_qpid_proton-0.37.0.dist-info`
72+
%{?fedora:BuildRequires: python3-wheel}
73+
%{?rhel:BuildRequires: python39-devel >= %{python_minimum_version}}
74+
%{?rhel:BuildRequires: python39-setuptools}
75+
%{?rhel:BuildRequires: python39-pip}
76+
%{?rhel:BuildRequires: python39-wheel}
77+
%{?rhel:BuildRequires: python39-rpm-macros}
6878
BuildRequires: libwebsockets-devel >= %{libwebsockets_minimum_version}
6979
BuildRequires: libnghttp2-devel >= %{libnghttp2_minimum_version}
7080
# man pages --help
7181
BuildRequires: asciidoc
72-
BuildRequires: python3-qpid-proton >= %{proton_minimum_version}
7382
# check ctest
7483
BuildRequires: cyrus-sasl-plain
7584

7685
# proton-c requirements
7786
BuildRequires: openssl-devel
7887
BuildRequires: cyrus-sasl-devel
88+
# python-qpid-proton requirements
89+
BuildRequires: swig
7990

8091
# skupper-router sources
8192
Source0: {{{ git_dir_pack }}}
@@ -97,7 +108,8 @@ cd %{_builddir}/qpid-proton-%{proton_vendored_version}
97108
-DCMAKE_C_FLAGS="$CFLAGS -Wno-error=deprecated-declarations" \
98109
-DBUILD_EXAMPLES=OFF \
99110
-DBUILD_TESTING=OFF \
100-
-DBUILD_BINDINGS=OFF \
111+
-DBUILD_BINDINGS=python \
112+
-DPython_EXECUTABLE=%{python3} \
101113
-DBUILD_TLS=ON -DSSL_IMPL=openssl \
102114
-DBUILD_STATIC_LIBS=ON \
103115
-DCMAKE_POLICY_DEFAULT_CMP0069=NEW -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
@@ -106,6 +118,8 @@ cd %{_builddir}/qpid-proton-%{proton_vendored_version}
106118
%__cmake --install "%{__cmake_builddir}"
107119

108120
cd %{_builddir}/skupper-router
121+
# for `import proton` when rendering sktools --help to manpages
122+
source %{_builddir}/qpid-proton-%{proton_vendored_version}/%{__cmake_builddir}/config.sh
109123
%cmake \
110124
-DVERSION="%{version}" \
111125
-DPython_EXECUTABLE=%{python3} \
@@ -115,12 +129,14 @@ cd %{_builddir}/skupper-router
115129
%cmake_build --target all --target man
116130

117131
%install
132+
# this will install all-in-one cpython .so module with proton inside
133+
%python3 -m pip install --target "%{buildroot}/usr/lib/skupper-router/python/" %{_builddir}/qpid-proton-%{proton_vendored_version}/%{__cmake_builddir}/python/pkgs/python-qpid-proton-*.tar.gz
118134
cd %{_builddir}/skupper-router
119135
%cmake_install
120136

121137
%check
122-
cd %{_builddir}/skupper-router
123-
%ctest
138+
cd %{_builddir}/skupper-router/%{__cmake_builddir}
139+
PYTHONPATH="%{buildroot}/usr/lib/skupper-router/python/" %__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags}
124140

125141
%files
126142
/usr/sbin/skrouterd
@@ -140,21 +156,26 @@ cd %{_builddir}/skupper-router
140156

141157
%package common
142158
Summary: Internal code shared between the router daemon and the tools
143-
BuildArch: noarch
159+
# BuildArch: noarch # due to binary proton
144160
Requires: python3
145-
Requires: python3-qpid-proton >= %{proton_minimum_version}
146161

147162
%description common
148163
%{summary}.
149164

150165
%files common
166+
# -tools and -tests depend on this
167+
/usr/lib/skupper-router/python/cproton.py
168+
/usr/lib/skupper-router/python/proton
169+
/usr/lib/skupper-router/python/python_qpid_proton-*.dist-info
170+
/usr/lib/skupper-router/python/_cproton.cpython-*-*-linux-gnu.so
171+
/usr/lib/skupper-router/python/__pycache__/cproton.cpython-*.pyc
172+
# skupper-router, -tools, and -tests depend on this
151173
/usr/lib/skupper-router/python/skupper_router_internal/
152174

153175
%package tools
154176
Summary: The skstat and skmanage tools for skrouterd
155177
BuildArch: noarch
156178
Requires: python3
157-
Requires: python3-qpid-proton >= %{proton_minimum_version}
158179
Requires: skupper-router-common == %{version}
159180
Requires: cyrus-sasl-plain
160181
Requires: cyrus-sasl-gssapi
@@ -172,7 +193,6 @@ Requires: cyrus-sasl-gssapi
172193
%package tests
173194
Summary: Tests for the skupper router and the tools
174195
Requires: python3
175-
Requires: python3-qpid-proton >= %{proton_minimum_version}
176196
Requires: skupper-router == %{version}
177197
Requires: skupper-router-tools == %{version}
178198
Requires: cyrus-sasl-plain

0 commit comments

Comments
 (0)