From 67174cff766e927017ed8edb8a73abe35a6d89af Mon Sep 17 00:00:00 2001 From: Jan Pazdziora Date: Wed, 1 Aug 2018 12:05:06 +0200 Subject: Support building in copr using make srpm. --- .copr/Makefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .copr/Makefile diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 0000000..8cc9ab8 --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,22 @@ + +PACKAGE := mod_authnz_pam + +outdir := $(CURDIR) +spec := $(PACKAGE).spec + +spec_dir := . +ifeq ($(shell test -d $(spec) && echo true),true) + spec_dir = $(spec) + spec_file = $(spec)/$(PACKAGE).spec +else + spec_dir = $(dir $(spec)) + spec_file = $(spec) +endif + +VERSION := $(shell rpm -q --qf '%{name}-%{version}\n' --specfile mod_authnz_pam.spec 2> /dev/null | head -1) + +srpm: + cd $(spec_dir) && mkdir -p .source/$(VERSION) && cp -rp * .source/$(VERSION) && cd .source && tar cvzf $(VERSION).tar.gz $(VERSION) + cd $(spec_dir) && rpmbuild -D '_srcrpmdir $(outdir)' -D '_sourcedir .source' -bs $(spec_file) + cd $(spec_dir) && rm -rf .source + -- cgit