Message ID | 1423390403-29943-2-git-send-email-allan@archlinux.org |
---|---|
State | New |
Headers | show |
On Sun, 8 Feb 2015, Allan McRae wrote: > Install nscd systemd services file and tmpfile when glibc is configured with > --with-systemdsystemunitdir=<dir> If you're adding a new configure option, the patch should update install.texi (and regenerate INSTALL).
On 02/08/2015 05:13 AM, Allan McRae wrote: > 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. Minor nit. Use --with-systemd-systemunitdir please. Since the proper name is systemd. Modulo Joseph's comment about documenting the new configure option LGTM. > 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 >
"Carlos O'Donell" <carlos@redhat.com> writes: > On 02/08/2015 05:13 AM, Allan McRae wrote: >> 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. > Minor nit. > Use --with-systemd-systemunitdir please. Since the proper name is systemd. I find it rather ugly too, but note that --with-systemdsystemunitdir is the recommended option by systemd upstream in daemon(7), which means a lot of other systemd-aware packages will use that as the flag as a semi-standard.
On 02/10/2015 11:48 AM, Russ Allbery wrote: > "Carlos O'Donell" <carlos@redhat.com> writes: > >> On 02/08/2015 05:13 AM, Allan McRae wrote: >>> 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. > >> Minor nit. > >> Use --with-systemd-systemunitdir please. Since the proper name is systemd. > > I find it rather ugly too, but note that --with-systemdsystemunitdir is > the recommended option by systemd upstream in daemon(7), which means a lot > of other systemd-aware packages will use that as the flag as a > semi-standard. > Nit withdrawn then. Cheers, Carlos.
On 08 Feb 2015 20:13, Allan McRae wrote: > --- a/Makeconfig > +++ b/Makeconfig > > +# Directory to install systemd service files should be a period at the end otherwise both lgtm ;) -mike
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