From bb3dcf151e3b7849d5d4f3c079dec6f56891e753 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 6 May 2024 09:36:00 -0400 Subject: [PATCH 1/3] rpm: Add gcc as a build dependency. This is required to make building with mock work. --- booth.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/booth.spec.in b/booth.spec.in index 49617634..18465006 100644 --- a/booth.spec.in +++ b/booth.spec.in @@ -64,6 +64,7 @@ Source1: %name-rpmlintrc BuildRequires: @asciidoc@ BuildRequires: autoconf BuildRequires: automake +BuildRequires: gcc BuildRequires: pkgconfig %if 0%{?suse_version} BuildRequires: glib2-devel From dadab7c9340632f157e48deac0f82292e75f95ae Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 6 May 2024 09:43:08 -0400 Subject: [PATCH 2/3] rpm: Remove the tar file as part of "make clean". --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index b6466580..675b23b3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -121,6 +121,7 @@ lint: clean-local: rm -rf test/*.pyc test/__pycache__ test/runtests.py test/boothtestenv.py cov* $(SPEC) + -rm -rf $(TARFILE) dist-clean-local: rm -f autoconf automake autoheader From 4f87eb50aac9323ffed4d1e89620c9b60e75bcd7 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 6 May 2024 09:46:50 -0400 Subject: [PATCH 3/3] build: Add support for building with mock. The makefile target includes the name of the mock chroot you want to use when building. Most of the time for booth, you'd use it like so: $ make mock-centos-stream+epel-9-x86_64 You may wish to change the release or arch, but due to the build requirement on asciidoctor, it looks like epel always needs to be included. --- Makefile.am | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 675b23b3..1148203c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -88,6 +88,9 @@ TESTS = test/runtests.py SUBDIRS = src docs conf +MOCK_DIR = $(abs_builddir)/mock +MOCK_OPTIONS ?= --resultdir="$(MOCK_DIR)" --no-cleanup-after + coverity: cov-build --dir=cov make cov-analyze --dir cov --concurrency --wait-for-license @@ -121,7 +124,7 @@ lint: clean-local: rm -rf test/*.pyc test/__pycache__ test/runtests.py test/boothtestenv.py cov* $(SPEC) - -rm -rf $(TARFILE) + -rm -rf booth-*.rpm $(TARFILE) dist-clean-local: rm -f autoconf automake autoheader @@ -240,6 +243,14 @@ rpm: clean $(MAKE) $(SPEC) $(TARFILE) rpmbuild $(RPMBUILDOPTS) -ba $(SPEC) +mock-%: clean srpm + mock $(MOCK_OPTIONS) --root=$* --no-cleanup-after --rebuild \ + "$(abs_top_builddir)"/*.src.rpm + +.PHONY: mock-clean +mock-clean: + -rm -rf "$(MOCK_DIR)" + gen_start_date = 2000-01-01 .PHONY: gen-ChangeLog gen-ChangeLog: