diff --git a/debian/rules b/debian/rules
index fd2d375af345225e376a87caa45a94c003c0767d..d7eb2a51e872039140f6b008b86029ee471ee2ab 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 8c992a073933be6c60e6ed01c71bd2356e7cbb32..f270847b9b8e9cc15d68ae2820d58d887076eace 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