Skip to content

Commit 4daf00b

Browse files
committed
Build: Update build process for new python module.
The presence of the new arch-specific compiled python module requires various build changes: * The python3-pacemaker package goes from noarch to arch-specific. * python3-libxml2 is now required as part of the build process to run tests. * PYTHONPATH needs to be updated in various places to run tests.
1 parent dc06f40 commit 4daf00b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

python/Makefile.am

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2023-2024 the Pacemaker project contributors
2+
# Copyright 2023-2025 the Pacemaker project contributors
33
#
44
# The version control history for this file may have further details.
55
#
@@ -22,4 +22,5 @@ check-local:
2222
if [ "x$(top_srcdir)" != "x$(top_builddir)" ]; then \
2323
cp -r $(top_srcdir)/python/* $(abs_top_builddir)/python/; \
2424
fi
25-
PYTHONPATH=$(top_builddir)/python $(PYTHON) -m unittest discover -v -s $(top_builddir)/python/tests
25+
PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/pacemaker/.libs \
26+
$(PYTHON) -m unittest discover -v -s $(top_builddir)/python/tests

rpm/pacemaker.spec.in

+5-3
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ Requires: %{python_name}-%{name} = %{version}-%{release}
248248
Requires: %{python_path}
249249
BuildRequires: %{python_name}-devel
250250
BuildRequires: %{python_name}-setuptools
251+
BuildRequires: %{python_name}-libxml2
251252

252253
# Pacemaker requires a minimum libqb functionality
253254
Requires: libqb >= 1.0.1
@@ -373,7 +374,6 @@ License: LGPL-2.1-or-later
373374
Summary: Python libraries for Pacemaker
374375
Requires: %{python_path}
375376
Requires: %{pkgname_pcmk_libs} = %{version}-%{release}
376-
BuildArch: noarch
377377

378378
%description -n %{python_name}-%{name}
379379
Pacemaker is an advanced, scalable High-Availability cluster resource
@@ -516,8 +516,9 @@ popd
516516

517517
%check
518518
make %{_smp_mflags} check
519-
{ cts/cts-scheduler --run load-stopped-loop \
520-
&& cts/cts-cli -V \
519+
{ PYTHONPATH=python/pacemaker/.libs \
520+
cts/cts-scheduler --run load-stopped-loop \
521+
&& PYTHONPATH=python/pacemaker/.libs cts/cts-cli -V \
521522
&& touch .CHECKED
522523
} 2>&1 | sed 's/[fF]ail/faiil/g' # prevent false positives in rpmlint
523524
[ -f .CHECKED ] && rm -f -- .CHECKED
@@ -747,6 +748,7 @@ exit 0
747748
%doc ChangeLog.md
748749

749750
%files -n %{python_name}-%{name}
751+
%{python3_sitearch}/_pcmksupport.so
750752
%{python3_sitelib}/pacemaker/
751753
%{python3_sitelib}/pacemaker-*.egg-info
752754
%exclude %{python3_sitelib}/pacemaker/_cts/

0 commit comments

Comments
 (0)