# Makefile for source rpm: perl-Mock-Quick
NAME := perl-Mock-Quick
SPECFILE = $(firstword $(wildcard *.spec))

define find-makefile-common
for d in common ../common ../../common ../../../common ../../../../common ; do if [ -f $$d/trunk/Makefile.common ] ; then if [ -f $$d/trunk/.svn -a -w $$/Makefile.common ] ; then cd $$d/trunk ; svn update --quiet ; fi ; echo "$$d/trunk/Makefile.common" ; break ; fi ; done
endef

MAKEFILE_COMMON := $(shell $(find-makefile-common))

# Need -r epel for RHEL builds, -r base for Fedora builds
# F-18 does not have Exporter::Declare or Fennec::Lite
# Needs Module::Build 0.42
FROM_DIST = fc36
BUILD_OPTIONS = -r base
DIST_REGEX = ^fc

include $(MAKEFILE_COMMON)

# Needs Test::Exception ≥ 0.29
# v1.107 can build for EPEL-7 unpatched; v1.108 wants Module::Build 0.42, which is too new for EL-7
build :: srpm
	mb --noarch -r epel --from=rhel8 -- $(MOCK_OPTIONS) $(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE).src.rpm