]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add configure option to enable/disable creation of user/group 1820/head
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 7 Mar 2024 04:37:37 +0000 (23:37 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 7 Mar 2024 05:20:39 +0000 (00:20 -0500)
Useful for Yocto, for example, where groupadd or getenv is not available.

Enabled by default, to keep same behavior as before.

Makefile.am
configure.ac

index d11f095d571ccf057fab61296fac26d1b3f4b4df..298f59be4421babd939cb2d823bfd1c6095f0db1 100644 (file)
@@ -261,7 +261,11 @@ INSTALL_GROUP_TARGET = install-group-local
 $(INSTALL_GROUP_TARGET):
        getent group shairport-sync &>/dev/null || groupadd -r shairport-sync &>/dev/null
 
+if INSTALL_CREATE_USER_GROUP
 INSTALL_USER_TARGET = install-user-local
+else
+INSTALL_USER_TARGET =
+endif
 
 $(INSTALL_USER_TARGET): $(INSTALL_GROUP_TARGET)
        getent passwd shairport-sync &>/dev/null || useradd -r -M -g shairport-sync -s /usr/sbin/nologin -G audio shairport-sync &>/dev/null
index d13795a6525cb1034fcdd1e570e694a37ba25695..6c71bb8b058e18b0a62e3440a5e74deef960daf2 100644 (file)
@@ -115,6 +115,11 @@ if  test "x$with_external_mdns" = xyes ; then
 fi
 AM_CONDITIONAL([USE_EXTERNAL_MDNS], [test "x$with_external_mdns" = "xyes" ])
 
+# Check if we want to create user/group (default to yes):
+
+AC_ARG_WITH([create-user-group],[AS_HELP_STRING([--with-create-user-group],[create user/group during a make install])], ,[with_with_create_user_group=yes])
+AM_CONDITIONAL([INSTALL_CREATE_USER_GROUP], [test "x$with_with_create_user_group" = "xyes"])
+
 # Add the libconfig package
 if  test "x${with_pkg_config}" = xyes ; then
   PKG_CHECK_MODULES(