spec ?= $(wildcard *.spec) ifneq ($(words spec),1) $(error More than one spec file: $(spec)) endif outdir ?= $(CURDIR) sourcedir = $(shell rpmbuild -E '%_sourcedir') srpm: $(spec) /usr/bin/spectool spectool -R -g $(spec) env -C $(sourcedir) \ sha512sum -c $(CURDIR)/sources || \ (find $(sourcedir) -type f -delete; exit 1) rpmbuild -D "_srcrpmdir $(outdir)" -bs $(spec) .PHONY: srpm %: dnf -y install $@