11# Disable automatic compilation of Python files in extra directories
22%global _python_bytecompile_extra 0
3- # set following to the actual commit or, for final release, concatenate
4- # "boothver" macro to "v" (will yield a tag per the convention)
5- %global commit 5d837d2b5bf1c240a5f1c5efe4e8d79f55727cca
6- %global shortcommit %(c= %{commit }; echo ${c:0:7})
73%{! ?_pkgdocdir: %global _pkgdocdir %{_docdir }/%{name }}
84%{! ?_licensedir:%global license %doc }
95%global test_path %{_datadir }/booth/tests
6+ %global booth_user booth_test_user
107# RPMs are split as follows:
118# * booth:
129# - envelope package serving as a syntactic shortcut to install
3128%bcond_with glue
3229Summary: Ticket Manager for Multi-site Clusters
3330Name: booth
34- Version: 1.0
35- Release: 8 %{?dist }
36- License: GPLv2+
31+ Version: 1.2
32+ Release: 1 %{?dist }
33+ License: GPL-2.0 -or-later
3734Vendor: Microsoft Corporation
3835Distribution: Azure Linux
3936URL: https://github.com/ClusterLabs/%{name }
40- Source0: https://github.com/ClusterLabs/%{name }/archive/%{commit }/%{name }-%{shortcommit }.tar.gz#/%{name}-%{version}.tar.gz
41- Patch0: CVE-2022-2553.patch
37+ Source0: https://github.com/ClusterLabs/%{name }/releases/download/v%{version }/%{name }-%{version }.tar.gz
4238# direct build process dependencies
4339BuildRequires: autoconf
4440BuildRequires: automake
@@ -78,7 +74,9 @@ Requires: %{name}-core%{?_isa}
7874Requires: %{name }-site
7975
8076%files
81- # intentionally empty
77+ %license COPYING
78+ %dir %{_datadir }/pkgconfig
79+ %{_datadir }/pkgconfig/booth.pc
8280
8381%description
8482Booth manages tickets which authorize cluster sites located
@@ -154,7 +152,7 @@ BuildArch: noarch
154152Automated tests for running Booth, ticket manager for multi-site clusters.
155153
156154%prep
157- %autosetup -p1 - n %{name }-%{commit }
155+ %autosetup -n %{name }-%{version }
158156
159157%build
160158export CFLAGS=" %{build_cflags} -I/usr/include/pacemaker "
@@ -182,22 +180,43 @@ cp -a -t %{buildroot}/%{_pkgdocdir} \
182180rm -rf %{buildroot }/%{_initrddir }/booth-arbitrator
183181rm -rf %{buildroot }/%{_pkgdocdir }/README.upgrade-from-v0.1
184182rm -rf %{buildroot }/%{_pkgdocdir }/COPYING
183+
184+ # Removing absolute symlinks
185+ rm -f %{buildroot }%{_sbindir }/booth
186+ rm -f %{buildroot }%{_sbindir }/geostore
187+ ln -s boothd %{buildroot }%{_sbindir }/booth
188+ ln -s boothd %{buildroot }%{_sbindir }/geostore
189+
185190# tests
186- mkdir -p %{buildroot }/%{test_path }
187- cp -a -t %{buildroot }/%{test_path } \
188- -- conf test unit-tests script/unit-test.py
189- chmod +x %{buildroot }/%{test_path }/test/booth_path
190- chmod +x %{buildroot }/%{test_path }/test/live_test.sh
191- mkdir -p %{buildroot }/%{test_path }/src
192- ln -s -t %{buildroot }/%{test_path }/src \
193- -- %{_sbindir }/boothd
191+ mkdir -p %{test_path }
192+ cp -a -t %{test_path } \
193+ -- conf test
194+ chmod +x %{test_path }/test/booth_path
195+ chmod +x %{test_path }/test/live_test.sh
196+ mkdir -p %{test_path }/src
197+ ln -s -t %{test_path }/src \
198+ -- %{buildroot }/%{_sbindir }/boothd
199+ # Generate runtests.py and boothtestenv.py
200+ sed -e 's#PYTHON_SHEBANG#%{__python3} -Es#g' \
201+ -e 's#TEST_SRC_DIR#%{test_path}/test#g' \
202+ -e 's#TEST_BUILD_DIR#%{test_path}/test#g' \
203+ %{test_path }/test/runtests.py.in > %{test_path }/test/runtests.py
204+
205+ chmod +x %{test_path }/test/runtests.py
206+
207+ sed -e 's#PYTHON_SHEBANG#%{__python3} -Es#g' \
208+ -e 's#TEST_SRC_DIR#%{test_path}/test#g' \
209+ -e 's#TEST_BUILD_DIR#%{test_path}/test#g' \
210+ %{test_path }/test/boothtestenv.py.in > %{test_path }/test/boothtestenv.py
194211
195212# https://fedoraproject.org/wiki/Packaging:Python_Appendix#Manual_byte_compilation
196- %py_byte_compile %{__python3} %{buildroot }/%{ test_path }
213+ %py_byte_compile %{__python3} %{test_path }
197214
198215%check
199216# alternatively: test/runtests.py
200- VERBOSE=1 make check
217+ # Booth tests cannot run as root in RPM build system
218+ useradd -s /usr/bin/sh %{booth_user }
219+ su %{booth_user } -s /bin/sh -c " VERBOSE=1 %{test_path}/test/runtests.py"
201220
202221%files core
203222%license COPYING
@@ -212,6 +231,9 @@ VERBOSE=1 make check
212231%dir %{_sysconfdir }/booth
213232%exclude %{_sysconfdir }/booth/booth.conf.example
214233
234+ %dir %attr (750, %{uname }, %{gname }) %{_var }/lib/booth/
235+ %dir %attr (750, %{uname }, %{gname }) %{_var }/lib/booth/cores
236+
215237%files arbitrator
216238%{_unitdir }/booth@.service
217239%{_unitdir }/booth-arbitrator.service
@@ -233,11 +255,14 @@ VERBOSE=1 make check
233255%files test
234256%doc %{_pkgdocdir }/README-testing
235257# /usr/share/booth provided by -site
236- %{test_path }
237258# /usr/lib/ocf/resource.d/booth provided by -site
238259%{_libdir }/ocf/resource.d/booth/sharedrsc
239260
240261%changelog
262+ * Thu Dec 18 2025 Aditya Singh <v-aditysing@microsoft.com> - 1.2-1
263+ - Upgrade to version 1.2
264+ - License verified.
265+
241266* Wed Aug 30 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.0-8
242267- Add patch for CVE-2022-2553
243268
0 commit comments