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