From e7e11bbf340f031223b56442b3aa4f4220fed315 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 24 Jun 2017 19:30:26 +0200 Subject: [PATCH] make nss-systemd support conditional (#6155) This allows the nss-systemd module to be disabled on minimal installations. --- Makefile-man.am | 17 +++++++++++------ Makefile.am | 2 ++ configure.ac | 10 ++++++++++ man/nss-systemd.xml | 2 +- man/rules/meson.build | 2 +- meson.build | 4 +++- meson_options.txt | 2 ++ 7 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Makefile-man.am b/Makefile-man.am index f21cc527f0..d51236ed56 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -23,7 +23,6 @@ MANPAGES += \ man/localtime.5 \ man/machine-id.5 \ man/machine-info.5 \ - man/nss-systemd.8 \ man/os-release.5 \ man/sd-bus-errors.3 \ man/sd-bus.3 \ @@ -259,7 +258,6 @@ MANPAGES_ALIAS += \ man/SD_WARNING.3 \ man/init.1 \ man/journald.conf.d.5 \ - man/libnss_systemd.so.2.8 \ man/poweroff.8 \ man/reboot.8 \ man/sd_bus_creds_get_audit_login_uid.3 \ @@ -617,7 +615,6 @@ man/SD_NOTICE.3: man/sd-daemon.3 man/SD_WARNING.3: man/sd-daemon.3 man/init.1: man/systemd.1 man/journald.conf.d.5: man/journald.conf.5 -man/libnss_systemd.so.2.8: man/nss-systemd.8 man/poweroff.8: man/halt.8 man/reboot.8: man/halt.8 man/sd_bus_creds_get_audit_login_uid.3: man/sd_bus_creds_get_pid.3 @@ -1131,9 +1128,6 @@ man/init.html: man/systemd.html man/journald.conf.d.html: man/journald.conf.html $(html-alias) -man/libnss_systemd.so.2.html: man/nss-systemd.html - $(html-alias) - man/poweroff.html: man/halt.html $(html-alias) @@ -2170,6 +2164,17 @@ man/systemd-networkd.html: man/systemd-networkd.service.html endif +if ENABLE_NSS_SYSTEMD +MANPAGES += \ + man/nss-systemd.8 +MANPAGES_ALIAS += \ + man/libnss_systemd.so.2.8 +man/libnss_systemd.so.2.8: man/nss-systemd.8 +man/libnss_systemd.so.2.html: man/nss-systemd.html + $(html-alias) + +endif + if ENABLE_QUOTACHECK MANPAGES += \ man/systemd-quotacheck.service.8 diff --git a/Makefile.am b/Makefile.am index 07b425eab8..4838df69f9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5280,6 +5280,7 @@ manual_tests += \ test-nss # ------------------------------------------------------------------------------ +if ENABLE_NSS_SYSTEMD libnss_systemd_la_SOURCES = \ src/nss-systemd/nss-systemd.sym \ src/nss-systemd/nss-systemd.c @@ -5299,6 +5300,7 @@ libnss_systemd_la_LIBADD = \ rootlib_LTLIBRARIES += \ libnss_systemd.la +endif # ------------------------------------------------------------------------------ if HAVE_MYHOSTNAME diff --git a/configure.ac b/configure.ac index 90e79d7799..379f617acf 100644 --- a/configure.ac +++ b/configure.ac @@ -1058,6 +1058,15 @@ if test "x$enable_idn" != "xno"; then fi AM_CONDITIONAL(ENABLE_IDN, [test "$have_idn" = "yes"]) +# ------------------------------------------------------------------------------ +have_nss_systemd=no +AC_ARG_ENABLE(nss-systemd, AS_HELP_STRING([--disable-nss-systemd], [disable nss-systemd support])) +if test "x$enable_nss_systemd" != "xno"; then + have_nss_systemd=yes + AC_DEFINE(ENABLE_NSS_SYSTEMD, [1], [nss-systemd is enabled]) +fi +AM_CONDITIONAL(ENABLE_NSS_SYSTEMD, [test "$have_nss_systemd" = "yes"]) + # ------------------------------------------------------------------------------ have_libiptc=no AC_ARG_ENABLE(libiptc, AS_HELP_STRING([--disable-libiptc], [disable optional LIBIPTC support])) @@ -1801,6 +1810,7 @@ AC_MSG_RESULT([ dbus: ${have_dbus} glib: ${have_glib} nss-myhostname: ${have_myhostname} + nss-systemd: ${have_nss_systemd} hwdb: ${enable_hwdb} tpm: ${have_tpm} Python: ${have_python} diff --git a/man/nss-systemd.xml b/man/nss-systemd.xml index 71aed4df83..34811f0a2e 100644 --- a/man/nss-systemd.xml +++ b/man/nss-systemd.xml @@ -21,7 +21,7 @@ along with systemd; If not, see . --> - + nss-systemd diff --git a/man/rules/meson.build b/man/rules/meson.build index 1508b012df..9f7201a909 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -39,7 +39,7 @@ manpages = [ ['nss-myhostname', '8', ['libnss_myhostname.so.2'], 'HAVE_MYHOSTNAME'], ['nss-mymachines', '8', ['libnss_mymachines.so.2'], 'ENABLE_MACHINED'], ['nss-resolve', '8', ['libnss_resolve.so.2'], 'ENABLE_RESOLVED'], - ['nss-systemd', '8', ['libnss_systemd.so.2'], ''], + ['nss-systemd', '8', ['libnss_systemd.so.2'], 'ENABLE_NSS_SYSTEMD'], ['os-release', '5', [], ''], ['pam_systemd', '8', [], 'HAVE_PAM'], ['resolved.conf', '5', ['resolved.conf.d'], 'ENABLE_RESOLVED'], diff --git a/meson.build b/meson.build index 301c8a913d..be33ea10dc 100644 --- a/meson.build +++ b/meson.build @@ -1014,6 +1014,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'], ['smack', 'HAVE_SMACK'], ['gshadow', 'ENABLE_GSHADOW'], ['idn', 'ENABLE_IDN'], + ['nss-systemd', 'ENABLE_NSS_SYSTEMD'], ] if get_option(pair[0]) @@ -1162,7 +1163,7 @@ test_dlopen = executable( dependencies : [libdl]) foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'], - ['systemd', '' ], + ['systemd', 'ENABLE_NSS_SYSTEMD'], ['mymachines', 'ENABLE_MACHINED'], ['resolve', 'ENABLE_RESOLVED']] @@ -2455,6 +2456,7 @@ foreach tuple : [ ['idn'], ['libidn2'], ['libidn'], + ['nss-systemd'], ['libiptc'], ['elfutils'], ['binfmt'], diff --git a/meson_options.txt b/meson_options.txt index 0de217744f..1594fec41f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -203,6 +203,8 @@ option('libidn2', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libidn2 support') option('libidn', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libidn support') +option('nss-systemd', type : 'boolean', + description : 'enable nss-systemd') option('libiptc', type : 'combo', choices : ['auto', 'true', 'false'], description : 'libiptc support') option('qrencode', type : 'combo', choices : ['auto', 'true', 'false'],