39
39
%global proton_vendored_version 0.38.0
40
40
%define proton_install_prefix %{_builddir}/qpid-proton-%{proton_vendored_version}/install
41
41
42
+ %global python_minimum_version 3.9.0
42
43
%global proton_minimum_version 0.34.0
43
44
%global libwebsockets_minimum_version 3.0.1
44
45
%global libnghttp2_minimum_version 1.33.0
@@ -51,7 +52,8 @@ License: ASL 2.0
51
52
URL: https://skupper.io
52
53
VCS: {{{ git_dir_vcs }}}
53
54
54
- Requires: python3
55
+ %{?fedora:Requires: python3 >= %{python_minimum_version}}
56
+ %{?rhel:Requires: python39 >= %{python_minimum_version}}
55
57
Requires: skupper-router-common == %{version}
56
58
Requires: libwebsockets >= %{libwebsockets_minimum_version}
57
59
Requires: libnghttp2 >= %{libnghttp2_minimum_version}
@@ -63,19 +65,28 @@ BuildRequires: gcc-c++
63
65
BuildRequires: cmake
64
66
65
67
# 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}
68
78
BuildRequires: libwebsockets-devel >= %{libwebsockets_minimum_version}
69
79
BuildRequires: libnghttp2-devel >= %{libnghttp2_minimum_version}
70
80
# man pages --help
71
81
BuildRequires: asciidoc
72
- BuildRequires: python3-qpid-proton >= %{proton_minimum_version}
73
82
# check ctest
74
83
BuildRequires: cyrus-sasl-plain
75
84
76
85
# proton-c requirements
77
86
BuildRequires: openssl-devel
78
87
BuildRequires: cyrus-sasl-devel
88
+ # python-qpid-proton requirements
89
+ BuildRequires: swig
79
90
80
91
# skupper-router sources
81
92
Source0: {{{ git_dir_pack }}}
@@ -97,7 +108,8 @@ cd %{_builddir}/qpid-proton-%{proton_vendored_version}
97
108
-DCMAKE_C_FLAGS="$CFLAGS -Wno-error=deprecated-declarations" \
98
109
-DBUILD_EXAMPLES=OFF \
99
110
-DBUILD_TESTING=OFF \
100
- -DBUILD_BINDINGS=OFF \
111
+ -DBUILD_BINDINGS=python \
112
+ -DPython_EXECUTABLE=%{python3} \
101
113
-DBUILD_TLS=ON -DSSL_IMPL=openssl \
102
114
-DBUILD_STATIC_LIBS=ON \
103
115
-DCMAKE_POLICY_DEFAULT_CMP0069=NEW -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
@@ -106,6 +118,8 @@ cd %{_builddir}/qpid-proton-%{proton_vendored_version}
106
118
%__cmake --install "%{__cmake_builddir}"
107
119
108
120
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
109
123
%cmake \
110
124
-DVERSION="%{version}" \
111
125
-DPython_EXECUTABLE=%{python3} \
@@ -115,12 +129,14 @@ cd %{_builddir}/skupper-router
115
129
%cmake_build --target all --target man
116
130
117
131
%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
118
134
cd %{_builddir}/skupper-router
119
135
%cmake_install
120
136
121
137
%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}
124
140
125
141
%files
126
142
/usr/sbin/skrouterd
@@ -140,21 +156,26 @@ cd %{_builddir}/skupper-router
140
156
141
157
%package common
142
158
Summary: Internal code shared between the router daemon and the tools
143
- BuildArch: noarch
159
+ # BuildArch: noarch # due to binary proton
144
160
Requires: python3
145
- Requires: python3-qpid-proton >= %{proton_minimum_version}
146
161
147
162
%description common
148
163
%{summary}.
149
164
150
165
%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
151
173
/usr/lib/skupper-router/python/skupper_router_internal/
152
174
153
175
%package tools
154
176
Summary: The skstat and skmanage tools for skrouterd
155
177
BuildArch: noarch
156
178
Requires: python3
157
- Requires: python3-qpid-proton >= %{proton_minimum_version}
158
179
Requires: skupper-router-common == %{version}
159
180
Requires: cyrus-sasl-plain
160
181
Requires: cyrus-sasl-gssapi
@@ -172,7 +193,6 @@ Requires: cyrus-sasl-gssapi
172
193
%package tests
173
194
Summary: Tests for the skupper router and the tools
174
195
Requires: python3
175
- Requires: python3-qpid-proton >= %{proton_minimum_version}
176
196
Requires: skupper-router == %{version}
177
197
Requires: skupper-router-tools == %{version}
178
198
Requires: cyrus-sasl-plain
0 commit comments