@@ -, +, @@ --- eclass/acct-group.eclass | 16 +++++++++++++++- eclass/acct-user.eclass | 14 +++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) --- a/eclass/acct-group.eclass +++ a/eclass/acct-group.eclass @@ -80,7 +80,7 @@ S=${WORKDIR} # << Phase functions >> -EXPORT_FUNCTIONS pkg_pretend pkg_preinst +EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst # @FUNCTION: acct-group_pkg_pretend # @DESCRIPTION: @@ -116,6 +116,20 @@ acct-group_pkg_pretend() { fi } +# @FUNCTION: acct-group_src_install +# @DESCRIPTION: +# Installs sysusers.d file for the group. +acct-group_src_install() { + debug-print-function ${FUNCNAME} "${@}" + + insinto /usr/lib/sysusers.d + newins - ${CATEGORY}-${ACCT_GROUP_NAME}.conf < <( + printf "g\t%q\t%q\n" \ + "${ACCT_GROUP_NAME}" \ + "${ACCT_GROUP_ID/#-*/-}" + ) +} + # @FUNCTION: acct-group_pkg_preinst # @DESCRIPTION: # Creates the group if it does not exist yet. --- a/eclass/acct-user.eclass +++ a/eclass/acct-user.eclass @@ -312,7 +312,7 @@ acct-user_pkg_pretend() { # @FUNCTION: acct-user_src_install # @DESCRIPTION: # Installs a keep-file into the user's home directory to ensure it is -# owned by the package. +# owned by the package, and sysusers.d file. acct-user_src_install() { debug-print-function ${FUNCNAME} "${@}" @@ -321,6 +321,18 @@ acct-user_src_install() { # created yet keepdir "${ACCT_USER_HOME}" fi + + insinto /usr/lib/sysusers.d + newins - ${CATEGORY}-${ACCT_USER_NAME}.conf < <( + printf "u\t%q\t%q\t%q\t%q\t%q\n" \ + "${ACCT_USER_NAME}" \ + "${ACCT_USER_ID/#-*/-}" \ + "${DESCRIPTION//[:,=]/;}" \ + "${ACCT_USER_HOME}" \ + "${ACCT_USER_SHELL/#-*/-}" + printf "m\t${ACCT_USER_NAME}\t%q\n" \ + "${ACCT_USER_GROUPS[@]}" + ) } # @FUNCTION: acct-user_pkg_preinst --