From 401953ed829f00607ae5bd163a4997bd8f5d1553 Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 8 Feb 2018 13:52:41 -0600 Subject: Spec file changes for COPR COPR needed slight tweaks to our spec file. Signed-off-by: baude --- .copr/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .copr/Makefile (limited to '.copr/Makefile') diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 000000000..49a4450a0 --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,28 @@ +#!/usr/bin/make -f + +spec := contrib/spec/podman.spec +outdir := $(CURDIR) +tmpdir := build +gitdir := $(PWD)/.git + +rev := $(shell sed 's/\(.......\).*/\1/' $(gitdir)/$$(sed -n '/^ref:/{s/.* //;p}' $(gitdir)/HEAD)) +date := $(shell date +%Y%m%d.%H%M) + +version := $(shell sed -n '/Version:/{s/.* //;p}' $(spec)) +release := $(date).git.$(rev) + +srpm: $(outdir)/podman-$(version)-$(release).src.rpm + +$(tmpdir)/podman.spec: $(spec) + @mkdir -p $(tmpdir) + sed '/^Release:/s/\(: *\).*/\1$(release)%{?dist}/' $< >$@ + +$(tmpdir)/$(version).tar.gz: $(gitdir)/.. + @mkdir -p $(tmpdir) + tar c --exclude-vcs --exclude-vcs-ignores -C $< --transform 's|^\.|podman-$(version)|' . | gzip -9 >$@ + +$(outdir)/podman-$(version)-$(release).src.rpm: $(tmpdir)/podman.spec $(tmpdir)/$(version).tar.gz + @mkdir -p $(outdir) + rpmbuild -D'_srcrpmdir $(outdir)' -D'_sourcedir $(tmpdir)' -bs $(tmpdir)/podman.spec + +.PHONY: srpm -- cgit v1.2.3-54-g00ecf