From 43a547a837323b8d628d0f38e0f97b6cbc2fa448 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Wed, 30 Jul 2014 19:23:39 -0400 Subject: [PATCH] Standardized approach to systemd unit files --- Makefile.am | 8 +++++--- configure.ac | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 613c423..9f792a1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +DISTCHECK_CONFIGURE_FLAGS = \ + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) bin_PROGRAMS= tr/trust_router tid/example/tidc tid/example/tids common/dh_test/tr_dh_test AM_CPPFLAGS=-I$(srcdir)/include AM_CFLAGS = -Wall -Werror=missing-prototypes -Werror -Wno-parentheses @@ -60,9 +62,9 @@ noinst_HEADERS = include/gsscon.h include/tr_config.h \ include/tid_internal.h pkgdata_DATA=schema.sql -systemddir=/lib/systemd/system - -systemd_DATA=tids.service +if HAVE_SYSTEMD + systemdsystemunit_DATA = tids.service +endif EXTRA_DIST = trust_router.spec common/tests.json schema.sql tids.service diff --git a/configure.ac b/configure.ac index 1494ca4..ccd1d88 100644 --- a/configure.ac +++ b/configure.ac @@ -10,6 +10,14 @@ AM_MAINTAINER_MODE LT_INIT() AC_PROG_CC + PKG_PROG_PKG_CONFIG + AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), + [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) + if test "x$with_systemdsystemunitdir" != xno; then + AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) + fi + AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context]) AC_CHECK_LIB([com_err], [error_message]) -- 2.1.4