packaging: install repo and keys

Currently it is very difficult for non-power-users to get Ring
automatically updated when using the Debian package from the website.

This is because configuring the Ring package repository requires
command line operations.

We want the Ring Debian/Ubuntu/whatever-Debian-based package (the
one from the website, not the official one from the Debian archive)
to make sure Ring's repository url and GnuPG key are installed as
trusted source together with the binaries so that Ring gets
transparently updated along with system updates.

In order to do that, we have to change some things from the official
package we have in the Debian archive:

* we need to provide both daemon and client in a single ring-all
package. Otherwise we will not be able to provide a one-click install
(users would have to install daemon and client in two separate steps
and that doesn't make much sense to non-geek users).

So, replace ring by ring-all and keep building ring-daemon as before
(we still want to provide daemon-only packages).

* we need to add prerm and postinst scripts which will take care of
installing the repo and keys (and this has to be done in different
ways depending on the distribution) in the ring-all case.

Also, remove transition package ring-gnome which has already
disappeared from the Debian package some time ago.

Change-Id: I34d5e5ba000d5d750c8db55c65b536a237a738b5
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
diff --git a/packaging/rules/debian/rules b/packaging/rules/debian/rules
index 5a69c84..65027e3 100755
--- a/packaging/rules/debian/rules
+++ b/packaging/rules/debian/rules
@@ -12,6 +12,10 @@
 NO_CPUS=1
 endif
 
+# Binary package names
+RING_ALL_IN_ONE_PKG_NAME="ring-all"
+RING_DAEMON_PKG_NAME="ring-daemon"
+
 %:
 	dh $@
 
@@ -132,29 +136,36 @@
 
 override_dh_auto_install:
 	#########################
-	## Ring Daemon install ##
+	## Ring daemon install ##
 	#########################
-	cd daemon && make DESTDIR=$(CURDIR)/debian/ring-daemon install
-	rm -rfv $(CURDIR)/debian/ring-daemon/usr/include
-	rm -rfv $(CURDIR)/debian/ring-daemon/usr/lib/*.a
-	rm -rfv $(CURDIR)/debian/ring-daemon/usr/lib/*.la
 
-	###########################
-	## libringclient install ##
-	###########################
-	cd lrc/build && make DESTDIR=$(CURDIR)/debian/ring install
-	rm -rfv $(CURDIR)/debian/ring/usr/include
+	cd daemon && make DESTDIR=$(CURDIR)/debian/$(RING_DAEMON_PKG_NAME) install
+	rm -rfv $(CURDIR)/debian/$(RING_DAEMON_PKG_NAME)/usr/include
+	rm -rfv $(CURDIR)/debian/$(RING_DAEMON_PKG_NAME)/usr/lib/*.a
+	rm -rfv $(CURDIR)/debian/$(RING_DAEMON_PKG_NAME)/usr/lib/*.la
+
+	######################
+	## Ring AiO install ##
+	######################
+
+        ## daemon
+	cd daemon && make DESTDIR=$(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME) install
+	rm -rfv $(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME)/usr/include
+	rm -rfv $(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME)/usr/lib/*.a
+	rm -rfv $(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME)/usr/lib/*.la
+
+        ## LibRingClient
+	cd lrc/build && make DESTDIR=$(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME) install
+	rm -rfv $(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME)/usr/include
 
 	# This is a symlink, should be in -dev package
-	rm -v $(CURDIR)/debian/ring/usr/lib/libringclient.so
+	rm -v $(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME)/usr/lib/libringclient.so
 
 	# cmake files
-	rm -rfv $(CURDIR)/debian/ring/usr/lib/cmake
+	rm -rfv $(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME)/usr/lib/cmake
 
-	##########################
-	## gnome client install ##
-	##########################
-	cd client-gnome/build && make DESTDIR=$(CURDIR)/debian/ring install
+        ## GNOME client
+	cd client-gnome/build && make DESTDIR=$(CURDIR)/debian/$(RING_ALL_IN_ONE_PKG_NAME) install
 
 tmpdir:= $(shell mktemp -d)
 workdir:= $(shell pwd)