mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH v2 3/4] shadow: new package
Date: Mon, 27 Jan 2020 09:53:50 +0100	[thread overview]
Message-ID: <20200127085350.GD901743@lenoch> (raw)
In-Reply-To: <20200127085111.GA901743@lenoch>

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 Changes:
 -v2: Avoid conflicting with Busybox, simplify menuconfig

 rules/shadow.in   |  26 ++++++++++
 rules/shadow.make | 121 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 147 insertions(+)
 create mode 100644 rules/shadow.in
 create mode 100644 rules/shadow.make

diff --git a/rules/shadow.in b/rules/shadow.in
new file mode 100644
index 000000000..8e1fa2270
--- /dev/null
+++ b/rules/shadow.in
@@ -0,0 +1,26 @@
+## SECTION=shell_and_console
+comment "BusyBox' loginutils selected!"
+        depends on BUSYBOX_ADDUSER || BUSYBOX_ADDGROUP || BUSYBOX_LOGIN || BUSYBOX_PASSWD || BUSYBOX_SU
+
+menuconfig SHADOW
+	tristate
+	depends on (!BUSYBOX_ADDUSER && !BUSYBOX_ADDGROUP && !BUSYBOX_LOGIN && !BUSYBOX_PASSWD && !BUSYBOX_SU) || ALLYES
+	select LIBC_CRYPT
+	select LIBSELINUX	if GLOBAL_SELINUX
+	select PAM		if GLOBAL_PAM
+	prompt "shadow                        "
+	help
+	  Password and account management tool suite with support
+	  for shadow files and PAM.
+
+if SHADOW
+
+config SHADOW_ADMIN
+	bool
+	prompt "install account administration commands"
+	help
+	  Enable this option if you want to install commands
+	  which manipulate user accout (administer /etc/passwd,
+	  /etc/shadow and /etc/group, /etc/gshadow ...)
+
+endif
diff --git a/rules/shadow.make b/rules/shadow.make
new file mode 100644
index 000000000..d9319806f
--- /dev/null
+++ b/rules/shadow.make
@@ -0,0 +1,121 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Ladislav Michl <ladis@linux-mips.org>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_SHADOW) += shadow
+
+#
+# Paths and names
+#
+SHADOW_VERSION	:= 4.8.1
+SHADOW_MD5	:= 4b05eff8a427cf50e615bda324b5bc45
+SHADOW		:= shadow-$(SHADOW_VERSION)
+SHADOW_SUFFIX	:= tar.xz
+SHADOW_URL	:= https://github.com/shadow-maint/shadow/releases/download/$(SHADOW_VERSION)/$(SHADOW).$(SHADOW_SUFFIX)
+SHADOW_SOURCE	:= $(SRCDIR)/$(SHADOW).$(SHADOW_SUFFIX)
+SHADOW_DIR	:= $(BUILDDIR)/$(SHADOW)
+SHADOW_LICENSE	:= BSD-3-Clause
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# autoconf
+#
+SHADOW_CONF_TOOL	:= autoconf
+SHADOW_CONF_OPT		:= \
+	$(CROSS_AUTOCONF_USR) \
+	--bindir=/usr/bin \
+	--sbindir=/usr/sbin \
+	$(GLOBAL_LARGE_FILE_OPTION) \
+	--enable-shadowgrp \
+	--disable-man \
+	--$(call ptx/endis, PTXCONF_GLOBAL_PAM)-account-tools-setuid \
+	--disable-utmpx \
+	--enable-subordinate-ids \
+	--disable-nls \
+	--disable-rpath \
+	--without-audit \
+	--$(call ptx/wwo, PTXCONF_GLOBAL_PAM)-libpam \
+	--without-btrfs \
+	--$(call ptx/wwo, PTXCONF_GLOBAL_SELINUX)-selinux \
+	--without-acl \
+  	--without-attr \
+	--without-skey \
+	--without-tcb \
+	--without-libcrack \
+	--with-sha-crypt \
+	--without-nscd \
+	--without-sssd \
+	--with-su \
+	--without-fcaps
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+SHADOW_ADMIN_BIN_PROGS	:= \
+	chage chfn chsh expiry gpasswd newgidmap newgrp newuidmap passwd
+SHADOW_ADMIN_SBIN_PROGS	:= \
+	chgpasswd chpasswd \
+	groupadd groupdel groupmems groupmod grpck grpconv grpunconv \
+	newusers pwck pwconv pwunconv useradd userdel usermod vipw
+SHADOW_ADMIN_PAMD	:= \
+	chage chfn chgpasswd chpasswd chsh \
+	groupadd groupdel groupmems groupmod \
+	newusers passwd useradd userdel usermod
+
+$(STATEDIR)/shadow.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, shadow)
+	@$(call install_fixup, shadow,PRIORITY,optional)
+	@$(call install_fixup, shadow,SECTION,base)
+	@$(call install_fixup, shadow,AUTHOR,"Ladislav Michl <ladis@linux-mips.org>")
+	@$(call install_fixup, shadow,DESCRIPTION,missing)
+
+	@$(call install_copy, shadow, 0, 0, 0755, -, /usr/bin/faillog)
+	@$(call install_copy, shadow, 0, 0, 0755, -, /usr/bin/groups)
+	@$(call install_copy, shadow, 0, 0, 0755, -, /usr/bin/lastlog)
+	@$(call install_copy, shadow, 0, 0, 0755, -, /usr/bin/login)
+	@$(call install_copy, shadow, 0, 0, 4755, -, /usr/bin/su)
+	@$(call install_copy, shadow, 0, 0, 0755, -, /usr/sbin/nologin)
+
+	@$(call install_alternative, shadow, 0, 0, 0644, /etc/login.defs)
+ifdef PTXCONF_GLOBAL_PAM
+	@$(call install_alternative, shadow, 0, 0, 0644, /etc/pam.d/login)
+	@$(call install_alternative, shadow, 0, 0, 0644, /etc/pam.d/su)
+endif
+
+ifdef PTXCONF_SHADOW_ADMIN
+	@$(foreach prog, $(SHADOW_ADMIN_BIN_PROGS), \
+		$(call install_copy, shadow, 0, 0, 4755, -, \
+			/usr/bin/$(prog))$(ptx/nl))
+	@$(call install_link, shadow, newgrp, /usr/bin/sg)
+
+	@$(foreach prog, $(SHADOW_ADMIN_SBIN_PROGS), \
+		$(call install_copy, shadow, 0, 0, 0755, -, \
+			/usr/sbin/$(prog))$(ptx/nl))
+	@$(call install_link, shadow, vipw, /usr/sbin/wigr)
+
+	@$(call install_alternative, shadow, 0, 0, 0644, /etc/default/useradd)
+ifdef PTXCONF_GLOBAL_PAM
+	@$(foreach pam, $(SHADOW_ADMIN_PAMD), \
+		$(call install_alternative, shadow, 0, 0, 0644, \
+			/etc/pam.d/$(pam))$(ptx/nl))
+endif
+endif
+
+	@$(call install_finish, shadow)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.25.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2020-01-27  8:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27  8:51 [ptxdist] [PATCH v2 0/4] PAM Ladislav Michl
2020-01-27  8:52 ` [ptxdist] [PATCH v2 1/4] pam: new package Ladislav Michl
2020-01-27  9:57   ` Roland Hieber
2020-01-27 15:57     ` Ladislav Michl
2020-01-28 10:57       ` Roland Hieber
2020-01-28 19:48         ` [ptxdist] [PATCH v3] " Ladislav Michl
2020-01-29  9:44           ` Roland Hieber
2020-01-27  8:53 ` [ptxdist] [PATCH v2 2/4] Introduce global PAM option Ladislav Michl
2020-01-27  8:53 ` Ladislav Michl [this message]
2020-01-27  8:54 ` [ptxdist] [PATCH v2 4/4] util-linux: optionally build login program Ladislav Michl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200127085350.GD901743@lenoch \
    --to=ladis@linux-mips.org \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox