From 3007ae09383e190deb8e57019992337135582d6c Mon Sep 17 00:00:00 2001
From: Thibault Cohen <thibault.cohen@savoirfairelinux.com>
Date: Mon, 13 Apr 2015 14:57:14 -0400
Subject: [PATCH] Fix repo package

Change-Id: Iab4e52fa5f3b03a1b3809902549b980aa4eab186
(cherry picked from commit cf78cedea8b9780de371e4e10893b2ecfed2ba4d)
---
 debian/rules     |  6 +++---
 ring-daemon.spec | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/debian/rules b/debian/rules
index fd2d375af3..d7eb2a51e8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,14 +5,14 @@ PKD  = $(abspath $(dir $(MAKEFILE_LIST)))
 #PKG  = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog --show-field=Source))
 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)
+DISTRIB_ID = $(shell grep -hPo "^ID=\K.*" /etc/*ease)
+DISTRIB_VERSION_ID = $(shell grep -hPo "^VERSION_ID=\K.*" /etc/*ease)
 
 # Uncomment this to turn on verbose mode.
 export DH_VERBOSE=1
 
 %:
-	dh $@ 
+	dh $@
 
 override_dh_auto_configure:
 	mkdir -p contrib/native && cd contrib/native && ../bootstrap --disable-ogg --disable-flac --disable-vorbis --disable-vorbisenc --disable-speex --disable-sndfile --disable-speexdsp --disable-gnutls && make list && make -j 2
diff --git a/ring-daemon.spec b/ring-daemon.spec
index 8c992a0739..f270847b9b 100644
--- a/ring-daemon.spec
+++ b/ring-daemon.spec
@@ -29,6 +29,13 @@ Group:          Applications/Internet
 Ring is free software for distributed and secured communication.
 This is the daemon headers.
 
+%package repository
+Summary:        Free software for distributed and secured communication.
+Group:          Applications/Internet
+
+%description repository
+Ring is free software for distributed and secured communication.
+This is the ring repository
 
 %prep
 %setup -q
@@ -62,6 +69,13 @@ make -j %{?_smp_mflags}
 %install
 mkdir -p %{buildroot}/ring-daemon
 make DESTDIR=%{buildroot} install
+mkdir -p %{buildroot}/%{_sysconfdir}/yum.repo.d/
+echo '[ring]' > %{buildroot}/%{_sysconfdir}/yum.repo.d/ring-nightly.repo
+echo 'name=Fedora $releasever - $basearch - ring' >> %{buildroot}/%{_sysconfdir}/yum.repo.d/ring-nightly.repo
+echo 'baseurl=http://nightly.yum.ring.cx/fedora_$releasever' >> %{buildroot}/%{_sysconfdir}/yum.repo.d/ring-nightly.repo
+echo 'enabled=1' >> %{buildroot}/%{_sysconfdir}/yum.repo.d/ring-nightly.repo
+echo 'gpgcheck=0' >> %{buildroot}/%{_sysconfdir}/yum.repo.d/ring-nightly.repo
+
 
 %files
 %defattr(-,root,root,-)
@@ -76,6 +90,9 @@ make DESTDIR=%{buildroot} install
 %{_libdir}/libring.a
 /usr/include/dring/
 
+%files repository
+%config %{_sysconfdir}/yum.repo.d/ring-nightly.repo
+
 %changelog
 * Fri Mar 27 2015 Thibault Cohen <thibault.cohen@savoirfairelinux.com> - 2.0.1-1
 - New upstream version
-- 
GitLab