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