Skip to contentSkip to conversation

package/php-pam: new package

PATCH Applied Herve Codina 2 participants 2 messages Oct 14, 2021 – Dec 17, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/php-pam: new package

The php-pam package provides a PHP PAM (Pluggable Authentication Modules) integration.

https://pecl.php.net/package/PAM

Based on initial work from Nicolas Carrier <[email protected]>

---
 DEVELOPERS                                    |  4 +++
 package/Config.in                             |  1 +
 package/php-pam/Config.in                     | 15 +++++++++
 package/php-pam/php-pam.hash                  |  3 ++
 package/php-pam/php-pam.mk                    | 26 +++++++++++++++
 support/testing/tests/package/test_php_pam.py | 32 +++++++++++++++++++
 6 files changed, 81 insertions(+)
 create mode 100644 package/php-pam/Config.in
 create mode 100644 package/php-pam/php-pam.hash
 create mode 100644 package/php-pam/php-pam.mk
 create mode 100644 support/testing/tests/package/test_php_pam.py
DEVELOPERS +4 -0
index b1439391ca..8bbac82936 100644
@@ -1154,8 +1154,10 @@ F:	package/dtbocfg/
 F:	package/libdbi/
 F:	package/libdbi-drivers/
 F:	package/lua-augeas/
+F:	package/php-pam/
 F:	support/testing/tests/package/test_dtbocfg.py
 F:	support/testing/tests/package/test_lua_augeas.py
+F:	support/testing/tests/package/test_php_pam.py
 
 N:	Hiroshi Kawashima <[email protected]>
 F:	package/gauche/
@@ -1994,6 +1996,7 @@ F:	package/bmap-tools/
 F:	package/libdbi/
 F:	package/libdbi-drivers/
 F:	package/lua-augeas/
+F:	package/php-pam/
 F:	package/php-xdebug/
 F:	package/python-augeas/
 F:	package/python-flask-expects-json/
@@ -2004,6 +2007,7 @@ F:	support/testing/tests/package/sample_python_augeas.py
 F:	support/testing/tests/package/sample_python_flask_expects_json.py
 F:	support/testing/tests/package/sample_python_git.py
 F:	support/testing/tests/package/test_bmap_tools.py
+F:	support/testing/tests/package/test_php_pam.py
 F:	support/testing/tests/package/test_python_augeas.py
 F:	support/testing/tests/package/test_python_flask_expects_json.py
 F:	support/testing/tests/package/test_python_git.py
package/Config.in +1 -0
index 7971726875..b00d7b1475 100644
@@ -868,6 +868,7 @@ menu "External php extensions"
 	source "package/php-gnupg/Config.in"
 	source "package/php-imagick/Config.in"
 	source "package/php-memcached/Config.in"
+	source "package/php-pam/Config.in"
 	source "package/php-ssh2/Config.in"
 	source "package/php-xdebug/Config.in"
 	source "package/php-yaml/Config.in"
package/php-pam/Config.in new file +15 -0
new file mode 100644
index 0000000000..5eae1ba1c2
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_PHP_PAM
+	bool "php-pam"
+	depends on BR2_ENABLE_LOCALE # linux-pam
+	depends on BR2_USE_WCHAR # linux-pam
+	depends on BR2_USE_MMU # linux-pam
+	depends on !BR2_STATIC_LIBS # linux-pam
+	select BR2_PACKAGE_LINUX_PAM
+	help
+	  PHP PAM (Pluggable Authentication Modules) integration
+
+	  https://pecl.php.net/package/PAM
+
+comment "php-pam needs a toolchain w/ wchar, locale, dynamic library"
+	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
+		|| BR2_STATIC_LIBS
package/php-pam/php-pam.hash new file +3 -0
new file mode 100644
index 0000000000..c3eb49fbe7
@@ -0,0 +1,3 @@
+# Locally calculated:
+sha256  fda3b5f719d51cb278351eedd3d7a96db75661324d81fdcf8072a4309121bc92  pam-2.2.3.tgz
+sha256  0967ad6cf4b7fe81d38709d7aaef3fecb3bd685be7eebb37b864aa34c991baa7  LICENSE
package/php-pam/php-pam.mk new file +26 -0
new file mode 100644
index 0000000000..8e20095d86
@@ -0,0 +1,26 @@
+################################################################################
+#
+# php-pam
+#
+################################################################################
+
+PHP_PAM_VERSION = 2.2.3
+PHP_PAM_SITE = http://pecl.php.net/get
+PHP_PAM_SOURCE = pam-$(PHP_PAM_VERSION).tgz
+PHP_PAM_LICENSE = PHP-3.01
+PHP_PAM_LICENSE_FILES = LICENSE
+PHP_PAM_DEPENDENCIES = php linux-pam host-autoconf host-pkgconf
+
+PHP_PAM_CONF_OPTS = \
+	--with-php-config=$(STAGING_DIR)/usr/bin/php-config \
+	--with-pam=$(STAGING_DIR)/usr
+
+define PHP_PAM_PHPIZE
+	(cd $(@D); \
+		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		$(STAGING_DIR)/usr/bin/phpize)
+endef
+PHP_PAM_PRE_CONFIGURE_HOOKS += PHP_PAM_PHPIZE
+
+$(eval $(autotools-package))
support/testing/tests/package/test_php_pam.py new file +32 -0
new file mode 100644
index 0000000000..c4c1412e10
@@ -0,0 +1,32 @@
+import os
+
+import infra.basetest
+
+
+class TestPhpPam(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_PACKAGE_PHP=y
+        BR2_PACKAGE_PHP_SAPI_CLI=y
+        BR2_PACKAGE_PHP_PAM=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        img = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv5",
+                           kernel="builtin",
+                           options=["-initrd", img])
+        self.emulator.login()
+
+        self.assertRunOk("mkdir /etc/php.d")
+        self.assertRunOk("echo 'extension=pam.so'> /etc/php.d/pam.ini")
+
+        output, exit_code = self.emulator.run("php --ri pam | sed '/^$/d'")
+        self.assertEqual(exit_code, 0)
+        self.assertEqual(output[0], "pam")
+        self.assertEqual(output[1], "PAM support => enabled")
+        # Do not check the version value in order to avoid test failure when
+        # bumping package version
+        self.assertEqual(output[2][0:21], "Extension version => ")
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 8 lines · On Thu, 14 Oct 2021 14:13:50 +0200 Herve Codina <[email protected]>…

The php-pam package provides a PHP PAM (Pluggable Authentication Modules) integration.

https://pecl.php.net/package/PAM

Based on initial work from Nicolas Carrier <[email protected]>

Quoted 12 lines
---
 DEVELOPERS                                    |  4 +++
 package/Config.in                             |  1 +
 package/php-pam/Config.in                     | 15 +++++++++
 package/php-pam/php-pam.hash                  |  3 ++
 package/php-pam/php-pam.mk                    | 26 +++++++++++++++
 support/testing/tests/package/test_php_pam.py | 32 +++++++++++++++++++
 6 files changed, 81 insertions(+)
 create mode 100644 package/php-pam/Config.in
 create mode 100644 package/php-pam/php-pam.hash
 create mode 100644 package/php-pam/php-pam.mk
 create mode 100644 support/testing/tests/package/test_php_pam.py

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot