Blame SOURCES/0009-Makefile-Adds-srpm-target.patch

9d8306
From cde55c7b8e2bc35c1eb38dd96dc1606d1adbff2b Mon Sep 17 00:00:00 2001
9d8306
From: Matej Habrnal <mhabrnal@redhat.com>
9d8306
Date: Fri, 13 Mar 2015 16:17:25 +0100
9d8306
Subject: [PATCH] Makefile: Adds srpm target
9d8306
9d8306
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
9d8306
---
9d8306
 Makefile | 7 +++++++
9d8306
 1 file changed, 7 insertions(+)
9d8306
9d8306
diff --git a/Makefile b/Makefile
9d8306
index 2e20217..8802256 100644
9d8306
--- a/Makefile
9d8306
+++ b/Makefile
9d8306
@@ -46,6 +46,13 @@ rpm: dist
9d8306
 		$(PKG_DIR)/abrt-java-connector.spec > $(OUT_DIR)/abrt-java-connector.spec && \
9d8306
 	rpmbuild $(RPM_DIRS) $(RPM_FLAGS) -ba $(OUT_DIR)/abrt-java-connector.spec
9d8306
 
9d8306
+.PHONY: srpm
9d8306
+srpm: dist
9d8306
+	sed -e 's/global commit .*$$/global commit '"$$(git log -1 --format=%H)"'/' \
9d8306
+		-e 's/%{?dist}/.'"$$(git log -1 --format=%h)%{?dist}"'/' \
9d8306
+		$(PKG_DIR)/abrt-java-connector.spec > $(OUT_DIR)/abrt-java-connector.spec && \
9d8306
+	rpmbuild $(RPM_DIRS) $(RPM_FLAGS) -bs $(OUT_DIR)/abrt-java-connector.spec
9d8306
+
9d8306
 # Make sure the output dir is created
9d8306
 $(OUT_DIR):
9d8306
 	mkdir -p $@ && cd $@ && cmake $$CMAKE_OPTS ../
9d8306
-- 
9d8306
2.4.6
9d8306