.PHONY: installdeps srpm

installdeps:
	dnf -y install git gzip java-11-openjdk-devel maven rpm-build sed

srpm: installdeps
	./.automation/build-srpm.sh
	cp rpmbuild/SRPMS/*.src.rpm $(outdir)

.PHONY: installdeps git_cfg_safe srpm

installdeps:
	dnf -y install git gzip java-11-openjdk-devel maven rpm-build sed

git_cfg_safe:
	# From git 2.35.2 we need to mark temporary directory, where the project is cloned to, as safe, otherwise
	# git commands won't work because of the fix for CVE-2022-24765
	git config --global --add safe.directory "$(shell pwd)"

srpm: installdeps git_cfg_safe
	./.automation/build-srpm.sh
	cp rpmbuild/SRPMS/*.src.rpm $(outdir)

Mark temp repo directory as safe for COPR
Mark temp repo directory as safe for COPR

When building from COPR the project is cloned into temporary directory,
which is not owned by current user. From git 2.35.2 such directory needs
to be marked as safe inn order git commands work correctly.

Signed-off-by: Martin Perina <7bf83f5b771f1cc16b652b5fe02fa33310bda7b0@redhat.com>
