From 459ae07e889277b83e820982377b63e4507317f5 Mon Sep 17 00:00:00 2001
From: Thibault Cohen <thibault.cohen@savoirfairelinux.com>
Date: Tue, 21 Apr 2015 13:36:24 -0400
Subject: [PATCH] Fix get orig sources

Change-Id: I7c7110ec04a77237369cc4aba249f441b4ba7539
---
 debian/rules     | 10 ++++++++--
 ring-daemon.spec |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/debian/rules b/debian/rules
index 3c50a6d216..515d74c62d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,7 +7,8 @@ PKG  = $(shell dpkg-parsechangelog -l$(PKD)/changelog --show-field=Source)
 VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
 DISTRIB_ID = $(shell grep -hPo "^ID=\K.*" /etc/*ease)
 DISTRIB_VERSION_ID = $(shell grep -hPo "^VERSION_ID=\K.*" /etc/*ease)
-DAEMON_TAG = 2.1.0
+
+DAEMON_TAG = $(VER)
 
 # Uncomment this to turn on verbose mode.
 export DH_VERBOSE=1
@@ -49,8 +50,13 @@ override_dh_auto_install:
 
 get-orig-source:
 	# Daemon
+	git init
+	git remote add origin https://gerrit-ring.savoirfairelinux.com/ring-daemon
 	git fetch --all
-	git merge origin $(DAEMON_TAG) --no-edit
+	git checkout packaging-releases -f
+	git config user.name "joulupukki"
+	git config user.email "joulupukki@localhost"
+	git merge $(DAEMON_TAG) --no-edit
 	# Packing
 	@echo "# Packing ... "
 	find . | sort \
diff --git a/ring-daemon.spec b/ring-daemon.spec
index 5e47328c9c..c9f9588948 100644
--- a/ring-daemon.spec
+++ b/ring-daemon.spec
@@ -46,7 +46,7 @@ git fetch --all
 git checkout packaging-releases -f
 git config user.name "joulupukki"
 git config user.email "joulupukki@localhost"
-git merge origin/%{daemon_tag} --no-edit
+git merge %{daemon_tag} --no-edit
 # Apply all patches
 for patch_file in $(cat debian/patches/series | grep -v "^#")
 do
-- 
GitLab