This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 2/2] Install nscd systemd files
- From: Allan McRae <allan at archlinux dot org>
- To: libc-alpha at sourceware dot org
- Date: Sun, 8 Feb 2015 20:13:23 +1000
- Subject: [PATCH 2/2] Install nscd systemd files
- Authentication-results: sourceware.org; auth=none
- References: <1423390403-29943-1-git-send-email-allan at archlinux dot org>
Install nscd systemd services file and tmpfile when glibc is configured with
--with-systemdsystemunitdir=<dir>
---
Makeconfig | 2 ++
config.make.in | 1 +
configure.ac | 7 +++++++
nscd/Makefile | 12 ++++++++++++
5 files changed, 36 insertions(+)
Note that this does not suffer the same "controversy" as the previous patch
as any modifications to theses files should be done in /etc.
2015-02-08 Allan McRae <allan@archlinux.org>
* configure.ac: Add --with-systemdsystemunitdir configure option
* configure: Regenerated
* config.make.in: (systemd-system-unit-dir) New variable
* Makeconfig: (inst_systemdsystemunitdir) New variable
* nscd/Makefile: (install-others): Add systemd files if requested
($(inst_systemdsystemunitdir)/nscd.service): New rule
($(inst_libdir)/tmpfiles.d/nscd.conf): New rule
diff --git a/Makeconfig b/Makeconfig
index 751e9ff..d9faa49 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -306,6 +306,8 @@ ifndef sysincludedir
sysincludedir = /usr/include
endif
+# Directory to install systemd service files
+inst_systemdsystemunitdir = $(install_root)$(systemd-system-unit-dir)
# Commands to install files.
ifndef INSTALL_DATA
diff --git a/config.make.in b/config.make.in
index ad4dd30..c73af0b 100644
--- a/config.make.in
+++ b/config.make.in
@@ -94,6 +94,7 @@ use-nscd = @use_nscd@
build-hardcoded-path-in-tests= @hardcoded_path_in_tests@
build-pt-chown = @build_pt_chown@
enable-lock-elision = @enable_lock_elision@
+systemd-system-unit-dir = @systemdsystemunitdir@
# Build tools.
CC = @CC@
diff --git a/configure.ac b/configure.ac
index d89aaf0..464ffcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,6 +127,13 @@ AC_ARG_WITH([headers],
[sysheaders=''])
AC_SUBST(sysheaders)
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
+ [directory for systemd service files]),
+ [systemdsystemunitdir=$withval],
+ [systemdsystemunitdir=''])
+AC_SUBST(systemdsystemunitdir)
+
AC_SUBST(use_default_link)
AC_ARG_WITH([default-link],
AC_HELP_STRING([--with-default-link],
diff --git a/nscd/Makefile b/nscd/Makefile
index 184c921..1d65c00 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -27,6 +27,10 @@ routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
nscd_initgroups nscd_getserv_r nscd_netgroup
aux := nscd_helper
install-others = $(inst_sysconfdir)/nscd.conf
+ifneq ($(systemd-system-unit-dir),)
+install-others += $(inst_systemdsystemunitdir)/nscd.service
+install-others += $(inst_libdir)/tmpfiles.d/nscd.conf
+endif
endif
# To find xmalloc.c
@@ -108,3 +112,11 @@ endif
$(inst_sysconfdir)/nscd.conf: nscd.conf $(+force)
$(do-install)
+
+ifneq ($(systemd-system-unit-dir),)
+$(inst_systemdsystemunitdir)/nscd.service: nscd.service $(+force)
+ $(do-install)
+
+$(inst_libdir)/tmpfiles.d/nscd.conf: nscd.tmpfiles $(+force)
+ $(do-install)
+endif
--
2.3.0