diff mbox series

[1/1] package/libnss-ato: new package

Message ID 20241120080703.63802-1-vjardin@free.fr
State New
Headers show
Series [1/1] package/libnss-ato: new package | expand

Commit Message

Vincent Jardin Nov. 20, 2024, 8:07 a.m. UTC
The libnss_ato module is a set of C library extensions which allows to
map every nss request for unknown user to a single predefined user.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
 DEVELOPERS                         |  1 +
 package/Config.in                  |  1 +
 package/libnss-ato/Config.in       | 11 +++++++++++
 package/libnss-ato/libnss-ato.hash |  4 ++++
 package/libnss-ato/libnss-ato.mk   | 26 ++++++++++++++++++++++++++
 5 files changed, 43 insertions(+)
 create mode 100644 package/libnss-ato/Config.in
 create mode 100644 package/libnss-ato/libnss-ato.hash
 create mode 100644 package/libnss-ato/libnss-ato.mk

Comments

Vincent Jardin Jan. 27, 2025, 9:57 a.m. UTC | #1
On Wed, Nov 20, 2024 at 09:07:03AM +0100, Vincent Jardin wrote:
> The libnss_ato module is a set of C library extensions which allows to
> map every nss request for unknown user to a single predefined user.
> 
> Signed-off-by: Vincent Jardin <vjardin@free.fr>

Hi,

I believe that new package  was "ok" for Baruch last november. Could it be
considered for a merge ?

Thanks,
  Vincent

> ---
>  DEVELOPERS                         |  1 +
>  package/Config.in                  |  1 +
>  package/libnss-ato/Config.in       | 11 +++++++++++
>  package/libnss-ato/libnss-ato.hash |  4 ++++
>  package/libnss-ato/libnss-ato.mk   | 26 ++++++++++++++++++++++++++
>  5 files changed, 43 insertions(+)
>  create mode 100644 package/libnss-ato/Config.in
>  create mode 100644 package/libnss-ato/libnss-ato.hash
>  create mode 100644 package/libnss-ato/libnss-ato.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 3945803d53..6dee1c10ec 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -3285,6 +3285,7 @@ F:	board/nvidia/bf3/
>  F:	configs/nvidia_bf3_defconfig
>  F:	package/bfscripts/
>  F:	package/dpdk/
> +F:	package/libnss-ato/
>  
>  N:	Vincent Prince <vincent.prince.fr@gmail.com>
>  F:	package/nss-myhostname/
> diff --git a/package/Config.in b/package/Config.in
> index 1eb5e1e020..30dc2c1712 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1610,6 +1610,7 @@ menu "Crypto"
>  	source "package/libmd/Config.in"
>  	source "package/libmhash/Config.in"
>  	source "package/libnss/Config.in"
> +	source "package/libnss-ato/Config.in"
>  	source "package/libolm/Config.in"
>  	source "package/libp11/Config.in"
>  	source "package/libscrypt/Config.in"
> diff --git a/package/libnss-ato/Config.in b/package/libnss-ato/Config.in
> new file mode 100644
> index 0000000000..6c6fc23857
> --- /dev/null
> +++ b/package/libnss-ato/Config.in
> @@ -0,0 +1,11 @@
> +config BR2_PACKAGE_LIBNSS_ATO
> +	bool "libnss-ato"
> +	depends on BR2_TOOLCHAIN_USES_GLIBC
> +	help
> +	  Library to map every nss request for unknown user to a
> +	  single predefined user.
> +
> +	  https://github.com/donapieppo/libnss-ato
> +
> +comment "libnss-ato needs a glibc toolchain"
> +	depends on !BR2_TOOLCHAIN_USES_GLIBC
> diff --git a/package/libnss-ato/libnss-ato.hash b/package/libnss-ato/libnss-ato.hash
> new file mode 100644
> index 0000000000..5e828f1be6
> --- /dev/null
> +++ b/package/libnss-ato/libnss-ato.hash
> @@ -0,0 +1,4 @@
> +# Locally computed
> +sha256  3de3161d298c48e55d7416ad89130e13dd72263b93563f3fb79c899fa8450ce2  copyright
> +sha256  e3a994d82e644b03a792a930f574002658412f62407f5fee083f2555c5f23118  lgpl-3.0.txt
> +sha256  87e17468eec71254e7848cb7c9dae5603ab376a719b05e2f5e69038ffed8beef  libnss-ato-4a29c8410cdac590a210dab2dec41d5f4b40d282.tar.gz
> diff --git a/package/libnss-ato/libnss-ato.mk b/package/libnss-ato/libnss-ato.mk
> new file mode 100644
> index 0000000000..46b8a7963b
> --- /dev/null
> +++ b/package/libnss-ato/libnss-ato.mk
> @@ -0,0 +1,26 @@
> +################################################################################
> +#
> +# libnss-ato
> +#
> +################################################################################
> +
> +LIBNSS_ATO_VERSION = 4a29c8410cdac590a210dab2dec41d5f4b40d282
> +LIBNSS_ATO_SITE = $(call github,donapieppo,libnss-ato,$(LIBNSS_ATO_VERSION))
> +LIBNSS_ATO_LICENSE = LGPL-3.0+
> +LIBNSS_ATO_LICENSE_FILES = copyright lgpl-3.0.txt
> +
> +# Skip the default build system (avoid patching Makefile for 1 .c)
> +define LIBNSS_ATO_BUILD_CMDS
> +	$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
> +		-fPIC -Wall -shared -o $(@D)/libnss_ato.so.2 \
> +		-Wl,-soname,libnss_ato.so.2 \
> +		$(@D)/libnss_ato.c
> +endef
> +
> +define LIBNSS_ATO_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/libnss_ato.so.2 $(TARGET_DIR)/lib/libnss_ato.so.2
> +	ln -sf libnss_ato.so.2 $(TARGET_DIR)/lib/libnss_ato.so
> +	$(INSTALL) -D -m 0644 $(@D)/libnss-ato.conf $(TARGET_DIR)/etc/libnss-ato.conf
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 3945803d53..6dee1c10ec 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3285,6 +3285,7 @@  F:	board/nvidia/bf3/
 F:	configs/nvidia_bf3_defconfig
 F:	package/bfscripts/
 F:	package/dpdk/
+F:	package/libnss-ato/
 
 N:	Vincent Prince <vincent.prince.fr@gmail.com>
 F:	package/nss-myhostname/
diff --git a/package/Config.in b/package/Config.in
index 1eb5e1e020..30dc2c1712 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1610,6 +1610,7 @@  menu "Crypto"
 	source "package/libmd/Config.in"
 	source "package/libmhash/Config.in"
 	source "package/libnss/Config.in"
+	source "package/libnss-ato/Config.in"
 	source "package/libolm/Config.in"
 	source "package/libp11/Config.in"
 	source "package/libscrypt/Config.in"
diff --git a/package/libnss-ato/Config.in b/package/libnss-ato/Config.in
new file mode 100644
index 0000000000..6c6fc23857
--- /dev/null
+++ b/package/libnss-ato/Config.in
@@ -0,0 +1,11 @@ 
+config BR2_PACKAGE_LIBNSS_ATO
+	bool "libnss-ato"
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  Library to map every nss request for unknown user to a
+	  single predefined user.
+
+	  https://github.com/donapieppo/libnss-ato
+
+comment "libnss-ato needs a glibc toolchain"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC
diff --git a/package/libnss-ato/libnss-ato.hash b/package/libnss-ato/libnss-ato.hash
new file mode 100644
index 0000000000..5e828f1be6
--- /dev/null
+++ b/package/libnss-ato/libnss-ato.hash
@@ -0,0 +1,4 @@ 
+# Locally computed
+sha256  3de3161d298c48e55d7416ad89130e13dd72263b93563f3fb79c899fa8450ce2  copyright
+sha256  e3a994d82e644b03a792a930f574002658412f62407f5fee083f2555c5f23118  lgpl-3.0.txt
+sha256  87e17468eec71254e7848cb7c9dae5603ab376a719b05e2f5e69038ffed8beef  libnss-ato-4a29c8410cdac590a210dab2dec41d5f4b40d282.tar.gz
diff --git a/package/libnss-ato/libnss-ato.mk b/package/libnss-ato/libnss-ato.mk
new file mode 100644
index 0000000000..46b8a7963b
--- /dev/null
+++ b/package/libnss-ato/libnss-ato.mk
@@ -0,0 +1,26 @@ 
+################################################################################
+#
+# libnss-ato
+#
+################################################################################
+
+LIBNSS_ATO_VERSION = 4a29c8410cdac590a210dab2dec41d5f4b40d282
+LIBNSS_ATO_SITE = $(call github,donapieppo,libnss-ato,$(LIBNSS_ATO_VERSION))
+LIBNSS_ATO_LICENSE = LGPL-3.0+
+LIBNSS_ATO_LICENSE_FILES = copyright lgpl-3.0.txt
+
+# Skip the default build system (avoid patching Makefile for 1 .c)
+define LIBNSS_ATO_BUILD_CMDS
+	$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
+		-fPIC -Wall -shared -o $(@D)/libnss_ato.so.2 \
+		-Wl,-soname,libnss_ato.so.2 \
+		$(@D)/libnss_ato.c
+endef
+
+define LIBNSS_ATO_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/libnss_ato.so.2 $(TARGET_DIR)/lib/libnss_ato.so.2
+	ln -sf libnss_ato.so.2 $(TARGET_DIR)/lib/libnss_ato.so
+	$(INSTALL) -D -m 0644 $(@D)/libnss-ato.conf $(TARGET_DIR)/etc/libnss-ato.conf
+endef
+
+$(eval $(generic-package))