From 63462a0c597686788e3a1c999d96f9eda84a81e7 Mon Sep 17 00:00:00 2001
From: aviau <alexandre@alexandreviau.net>
Date: Wed, 20 Jul 2016 18:51:24 -0400
Subject: [PATCH] Move dring to $(LIBDIR)/ring/dring

In reaction to Debian bug:
 - https://bugs.debian.org/831978

Accoding to the FHS[1]:
  Utilities used for system administration (and other root-only
  commands) are stored in /sbin, /usr/sbin, and /usr/local/sbin. /sbin
  contains binaries essential for booting, restoring, recovering, and/or
  repairing the system in addition to the binaries in /bin. [18]
  Programs executed after /usr is known to be mounted (when there are no
  problems) are generally placed into /usr/sbin. Locally-installed
  system administration programs should be placed into
  /usr/local/sbin.

1. https://www.debian.org/doc/packaging-manuals/fhs/fhs-2.3.html#SBINSYSTEMBINARIES

Change-Id: I13e16eb0e7750fc84d5f44c53da63ad0aebbe240
Tuleap: #860
---
 bin/Makefile.am                  | 8 +++++---
 bin/dbus/cx.ring.Ring.service.in | 2 +-
 configure.ac                     | 4 ++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 9366c7a716..92cfa4677b 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -1,5 +1,7 @@
+ringlibdir = $(libdir)/ring
+
 if HAVE_WIN32
-bin_PROGRAMS = ringcli
+ringlib_PROGRAMS = ringcli
 ringcli_SOURCES = winmain.cpp
 ringcli_CXXFLAGS = -I$(top_srcdir)/src \
                    -I$(top_srcdir)/src/dring \
@@ -8,7 +10,7 @@ ringcli_LDADD = $(top_builddir)/src/libring.la
 endif
 
 if HAVE_OSX
-bin_PROGRAMS = ringcli
+ringlib_PROGRAMS = ringcli
 ringcli_SOURCES = osxmain.cpp
 ringcli_CXXFLAGS = -I$(top_srcdir)/src \
                    -I$(top_srcdir)/src/dring \
@@ -19,7 +21,7 @@ endif
 if RING_DBUS
 SUBDIRS=dbus
 
-sbin_PROGRAMS = dring
+ringlib_PROGRAMS = dring
 
 dring_SOURCES = main.cpp
 
diff --git a/bin/dbus/cx.ring.Ring.service.in b/bin/dbus/cx.ring.Ring.service.in
index b7acab7bb3..4312a8dfb0 100644
--- a/bin/dbus/cx.ring.Ring.service.in
+++ b/bin/dbus/cx.ring.Ring.service.in
@@ -1,3 +1,3 @@
 [D-BUS Service]
 Name=cx.ring.Ring
-Exec=@SBINDIR@/dring
+Exec=@LIBDIR@/ring/dring
diff --git a/configure.ac b/configure.ac
index ab744a105d..472d34d50d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -367,8 +367,8 @@ AC_ARG_WITH([dbus],
 AS_IF([test "x$with_dbus" = "xyes"], [
        PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,, AC_MSG_WARN([Missing dbus development files]))
 
-       AS_AC_EXPAND(SBINDIR, $sbindir)
-       AC_SUBST(SBINDIR)
+       AS_AC_EXPAND(LIBDIR, $libdir)
+       AC_SUBST(LIBDIR)
 
        AC_CONFIG_FILES([bin/dbus/Makefile
                         bin/dbus/cx.ring.Ring.service])
-- 
GitLab