Skip to content
Snippets Groups Projects
Commit 2afa99fd authored by Maxim Cournoyer's avatar Maxim Cournoyer
Browse files

daemon: Install dring to libexec and edit templates at install time.

Executables are typically installed under bin/, sbin/ or libexec,
rather than lib/.  The problem was noticed when trying to use Jami
with a Guix relocatable pack, which only wraps executables found under
the above locations.  Since dring is a daemon and should not be run
directly by users under normal circumstances, the convention is to use
the libexec directory, according to the File Hierchy Standard 3.0.

Also tackled in this change is the substitution of the Autoconf
variables at installation time rather than configuration time, as per
the GNU Coding Standards.  The following solution is taken from
https://github.com/gentoo/eudev/pull/183/commits, which in turn is
adapted from the Autoconf manual (c.f.: info "(autoconf)Installation
Directory Variables").

* bin/Makefile.am (ringlibdir): Delete variable.
* bin/dbus/Makefile.am (do_subst): New variable.
(cx.ring.Ring.service): Derive from the cx.ring.Ring.service.in
template.
[HAVE_WIN32]: (ringlib_PROGRAMS): Rename to ...
(bin_PROGRAMS): ... this.
[HAVE_OSX, RING_DBUS]: Likewise.
* bin/dbus/cx.ring.Ring.service.in (Exec): Adust.
* globals.mk (ringlibdir): Delete variable.
* configure.ac [with_dbus] <AC_CONFIG_FILES>: Remove
bin/dbus/cx.ring.Ring.service.  Also remove the LIBDIR variable, no
longer used.  Fix indentation.

Thanks to Vladimir Stoiakin for providing feedback on this change.

Change-Id: I845bf2bd590a9457e70ca173027217b8f164d713
parent 4bb6741e
Branches
No related tags found
No related merge requests found
ringlibdir = $(libdir)/ring
if HAVE_WIN32
ringlib_PROGRAMS = ringcli
libexec_PROGRAMS = ringcli
ringcli_SOURCES = winmain.cpp
ringcli_CXXFLAGS = -I$(top_srcdir)/src \
-I$(top_srcdir)/src/dring \
......@@ -11,7 +9,7 @@ ringcli_LDADD = $(top_builddir)/src/libring.la
endif
if HAVE_OSX
ringlib_PROGRAMS = ringcli
libexec_PROGRAMS = ringcli
ringcli_SOURCES = osxmain.cpp
ringcli_CXXFLAGS = -I$(top_srcdir)/src \
-I$(top_srcdir)/src/dring \
......@@ -25,7 +23,7 @@ SUBDIRS=
if RING_DBUS
SUBDIRS+=dbus
ringlib_PROGRAMS = dring
libexec_PROGRAMS = dring
dring_SOURCES = main.cpp
......
......@@ -65,6 +65,12 @@ libclient_dbus_la_CXXFLAGS = -I../ \
-DPROGSHAREDIR=\"${datadir}/ring\" \
$(DBUSCPP_CFLAGS)
do_subst = $(SED) \
-e 's,[@]bindir[@],$(bindir),g'
cx.ring.Ring.service: cx.ring.Ring.service.in Makefile
$(do_subst) < $< > $@
# Dbus service file
servicedir = $(datadir)/dbus-1/services
service_DATA = cx.ring.Ring.service
......
[D-BUS Service]
Name=cx.ring.Ring
Exec=@LIBDIR@/ring/dring
Exec=@libexec@/dring
......@@ -381,15 +381,11 @@ AC_ARG_WITH([dbus],
[AS_HELP_STRING([--without-dbus], [disable support for dbus])],
[],
[with_dbus=yes])
AS_IF([test "x$with_dbus" = "xyes"], [
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,,
AS_IF([test "x$with_dbus" = "xyes"],
[PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,,
AC_MSG_WARN([Missing dbus development files]))
AS_AC_EXPAND(LIBDIR, $libdir)
AC_SUBST(LIBDIR)
AC_CONFIG_FILES([bin/dbus/Makefile
bin/dbus/cx.ring.Ring.service])
AC_CONFIG_FILES([bin/dbus/Makefile])
AC_PATH_PROG([DBUSXX_XML2CPP], dbusxx-xml2cpp,
[AC_MSG_ERROR([dbusxx-xml2cpp not found])])
......@@ -397,8 +393,9 @@ AS_IF([test "x$with_dbus" = "xyes"], [
AS_IF([test "x$CLANG" = "xyes"],
[AC_MSG_ERROR([dbus does not compile when clang is used,
rerun with --without-dbus])]);
AM_CONDITIONAL(RING_DBUS, true)],TESTS= $(check_PROGRAMS)
AM_CONDITIONAL(RING_DBUS, false));
AM_CONDITIONAL(RING_DBUS, true)],
[TESTS= $(check_PROGRAMS)
AM_CONDITIONAL(RING_DBUS, false)]);
dnl name service is default-enabled
AC_ARG_ENABLE([ringns], AS_HELP_STRING([--disable-ringns],
......
# Global variables
src=$(abs_top_srcdir)
ringlibdir=$(DESTDIR)$(libdir)/ring
ASTYLERC="$(top_srcdir)/../astylerc"
indent="/usr/bin/astyle"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment