diff options
-rw-r--r-- | Makeconfig | 2 | ||||
-rw-r--r-- | config.make.in | 1 | ||||
-rwxr-xr-x | configure | 14 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | nscd/Makefile | 12 |
5 files changed, 36 insertions, 0 deletions
diff --git a/Makeconfig b/Makeconfig index 751e9ffa32..d9faa49e1a 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 ad4dd30607..c73af0b589 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 b/configure index ce0c6a01f1..e21e1e48e4 100755 --- a/configure +++ b/configure @@ -675,6 +675,7 @@ bindnow enable_lock_elision hardcoded_path_in_tests use_default_link +systemdsystemunitdir sysheaders with_fp READELF @@ -753,6 +754,7 @@ with_fp with_binutils with_selinux with_headers +with_systemdsystemunitdir with_default_link enable_sanity_checks enable_shared @@ -1454,6 +1456,8 @@ Optional Packages: --with-selinux if building with SELinux support --with-headers=PATH location of system headers to use (for example /usr/src/linux/include) [default=compiler default] + --with-systemdsystemunitdir=DIR + directory for systemd service files --with-default-link do not use explicit linker scripts --with-cpu=CPU select code for CPU variant @@ -3422,6 +3426,16 @@ fi +# Check whether --with-systemdsystemunitdir was given. +if test "${with_systemdsystemunitdir+set}" = set; then : + withval=$with_systemdsystemunitdir; systemdsystemunitdir=$withval +else + systemdsystemunitdir='' +fi + + + + # Check whether --with-default-link was given. if test "${with_default_link+set}" = set; then : diff --git a/configure.ac b/configure.ac index d89aaf0cdf..464ffcda08 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 184c921b12..1d65c00ba2 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 |