outdir ?= .
spec   ?= libratbag.spec

srpm:
	dnf -y install git-core rpm-build
	git archive --format=tar.gz --prefix=libratbag-snapshot/ \
	    -o $(outdir)/libratbag-snapshot.tar.gz HEAD
	rpmbuild -bs $(spec) \
	    --define "_sourcedir $(outdir)" \
	    --define "_srcrpmdir $(outdir)" \
	    --define "gitdate $$(date +%Y%m%d)" \
	    --define "shortcommit $$(git rev-parse --short=7 HEAD)"
