From: Alexander Kanavin <[email protected]>

Change from autotools to meson.

ptest support is removed for now, as pam-ptest isn't executed
on the autobuilder.

Adjust packaging as pam now installs everything into /usr rather than /.

Signed-off-by: Alexander Kanavin <[email protected]>
---
 ...ect-check-for-existence-of-two-prepr.patch | 40 +++++++++++++++
 .../pam/libpam/libpam-xtests.patch            | 45 ----------------
 .../pam/{libpam_1.6.1.bb => libpam_1.7.0.bb}  | 51 +++++--------------
 3 files changed, 52 insertions(+), 84 deletions(-)
 create mode 100644 
meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch
 delete mode 100644 meta/recipes-extended/pam/libpam/libpam-xtests.patch
 rename meta/recipes-extended/pam/{libpam_1.6.1.bb => libpam_1.7.0.bb} (79%)

diff --git 
a/meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch
 
b/meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch
new file mode 100644
index 00000000000..ef087ffc06b
--- /dev/null
+++ 
b/meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch
@@ -0,0 +1,40 @@
+From 9b5182d4781bcd6fb37a4030faf325965fde3e93 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Thu, 28 Nov 2024 20:32:17 +0100
+Subject: [PATCH] meson: correct check for existence of two preprocessor
+ defines
+
+sizeof is meant for *types*, and in case of cross compiling
+the test program produced by it has incorrect syntax
+  __NR_keyctl something;
+and will always fail to compile.
+
+* meson.build: Use cc.get_define() instead of cc.sizeof() to check for
+preprocessor symbols.
+
+Co-authored-by: Dmitry V. Levin <[email protected]>
+Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/pull/861]
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ meson.build | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index f6a7dafe9..307fed0aa 100644
+--- a/meson.build
++++ b/meson.build
+@@ -198,12 +198,12 @@ foreach ident: check_functions
+   endif
+ endforeach
+ 
+-enable_pam_keyinit = cc.sizeof('__NR_keyctl', prefix: '#include 
<sys/syscall.h>') > 0
++enable_pam_keyinit = cc.get_define('__NR_keyctl', prefix: '#include 
<sys/syscall.h>') != ''
+ 
+ if get_option('mailspool') != ''
+   cdata.set_quoted('PAM_PATH_MAILDIR', get_option('mailspool'))
+ else
+-  have = cc.sizeof('_PATH_MAILDIR', prefix: '#include <paths.h>') > 0
++  have = cc.get_define('_PATH_MAILDIR', prefix: '#include <paths.h>') != ''
+   cdata.set('PAM_PATH_MAILDIR', have ? '_PATH_MAILDIR' : '"/var/spool/mail"')
+ endif
+ 
diff --git a/meta/recipes-extended/pam/libpam/libpam-xtests.patch 
b/meta/recipes-extended/pam/libpam/libpam-xtests.patch
deleted file mode 100644
index f2dafa72a5b..00000000000
--- a/meta/recipes-extended/pam/libpam/libpam-xtests.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 060726f7e60c8ecb5bf50fd776910b290d9a0a69 Mon Sep 17 00:00:00 2001
-From: Kang Kai <[email protected]>
-Date: Tue, 19 Jul 2011 17:08:31 +0800
-Subject: [PATCH] This patch is used to create a new sub package libpam-xtests
- to do more checks.
-
-Upstream-Status: Pending
-
-Signed-off-by: Kang Kai <[email protected]>
----
- xtests/Makefile.am | 17 ++++++++++++++++-
- 1 file changed, 16 insertions(+), 1 deletion(-)
-
-diff --git a/xtests/Makefile.am b/xtests/Makefile.am
-index acf9746..9826c9f 100644
---- a/xtests/Makefile.am
-+++ b/xtests/Makefile.am
-@@ -8,7 +8,7 @@ AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_srcdir)/libpam/include \
- LDADD = $(top_builddir)/libpam/libpam.la \
-       $(top_builddir)/libpam_misc/libpam_misc.la
- 
--CLEANFILES = *~ $(XTESTS)
-+CLEANFILES = *~
- 
- EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \
-       tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \
-@@ -55,3 +55,18 @@ EXTRA_PROGRAMS = $(XTESTS)
- 
- xtests: $(XTESTS) run-xtests.sh
-       "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS}
-+
-+all: $(XTESTS)
-+
-+install: install_xtests
-+
-+install_xtests:
-+      $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests
-+      for file in $(EXTRA_DIST) ; do \
-+              $(INSTALL) $(srcdir)/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
-+      done
-+      for file in $(XTESTS); do \
-+              $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
-+      done
-+
-+.PHONY: all install_xtests
diff --git a/meta/recipes-extended/pam/libpam_1.6.1.bb 
b/meta/recipes-extended/pam/libpam_1.7.0.bb
similarity index 79%
rename from meta/recipes-extended/pam/libpam_1.6.1.bb
rename to meta/recipes-extended/pam/libpam_1.7.0.bb
index a48f78187b2..ec1c868d219 100644
--- a/meta/recipes-extended/pam/libpam_1.6.1.bb
+++ b/meta/recipes-extended/pam/libpam_1.7.0.bb
@@ -20,40 +20,32 @@ SRC_URI = 
"${GITHUB_BASE_URI}/download/v${PV}/Linux-PAM-${PV}.tar.xz \
            file://pam.d/common-session \
            file://pam.d/common-session-noninteractive \
            file://pam.d/other \
-           file://libpam-xtests.patch \
            file://run-ptest \
            file://pam-volatiles.conf \
+           
file://0001-meson.build-correct-check-for-existence-of-two-prepr.patch \
            "
 
-SRC_URI[sha256sum] = 
"f8923c740159052d719dbfc2a2f81942d68dd34fcaf61c706a02c9b80feeef8e"
+SRC_URI[sha256sum] = 
"57dcd7a6b966ecd5bbd95e1d11173734691e16b68692fa59661cdae9b13b1697"
 
 DEPENDS = "bison-native flex-native libxml2-native virtual/crypt"
 
-EXTRA_OECONF = "--includedir=${includedir}/security \
-                --libdir=${base_libdir} \
-                --with-systemdunitdir=${systemd_system_unitdir} \
-                --disable-nis \
-                --disable-regenerate-docu \
-                --disable-doc \
-               --disable-prelude"
-
-CFLAGS += "-fPIC "
+EXTRA_OEMESON = "-Ddocs=disabled"
 
 S = "${WORKDIR}/Linux-PAM-${PV}"
 
-inherit autotools gettext pkgconfig systemd ptest github-releases
+inherit meson gettext pkgconfig systemd ptest github-releases
 
 PACKAGECONFIG ??= ""
-PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
-PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db,"
+PACKAGECONFIG[audit] = "-Daudit=enabled,-Daudit=disabled,audit,"
+PACKAGECONFIG[userdb] = "-Dpam_userdb=enabled 
-Ddb=gdbm,-Dpam_userdb=disabled,gdbm,"
 
 PACKAGES += "${PN}-runtime ${PN}-xtests"
 FILES:${PN} = " \
-    ${base_libdir}/lib*${SOLIBS} \
+    ${libdir}/lib*${SOLIBS} \
     ${nonarch_libdir}/tmpfiles.d/*.conf \
 "
-FILES:${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la 
${base_libdir}/lib*${SOLIBSDEV}"
-FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${systemd_system_unitdir}"
+FILES:${PN}-dev += "${libdir}/security/*.la ${libdir}/*.la 
${libdir}/lib*${SOLIBSDEV}"
+FILES:${PN}-runtime = "${sysconfdir} ${sbindir} 
${nonarch_libdir}/systemd/system"
 FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests"
 
 # libpam installs /etc/environment for use with the pam_env plugin. Make sure 
it is
@@ -111,9 +103,9 @@ python populate_packages:prepend () {
 
     mlprefix = d.getVar('MLPREFIX') or ''
     dvar = d.expand('${WORKDIR}/package')
-    pam_libdir = d.expand('${base_libdir}/security')
+    pam_libdir = d.expand('${libdir}/security')
     pam_sbindir = d.expand('${sbindir}')
-    pam_filterdir = d.expand('${base_libdir}/security/pam_filter')
+    pam_filterdir = d.expand('${libdir}/security/pam_filter')
     pam_pkgname = mlprefix + 'pam-plugin%s'
 
     do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname,
@@ -121,16 +113,7 @@ python populate_packages:prepend () {
     do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM 
filter for %s', extra_depends='')
 }
 
-do_compile_ptest() {
-        cd tests
-        sed -i -e 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//' Makefile
-        oe_runmake check-am
-        cd -
-}
-
-do_install() {
-       autotools_do_install
-
+do_install:append() {
        # don't install /var/run when populating rootfs. Do it through volatile
        rm -rf ${D}${localstatedir}
 
@@ -155,16 +138,6 @@ do_install() {
        if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; 
then
                echo "session optional pam_systemd.so" >> 
${D}${sysconfdir}/pam.d/common-session
        fi
-       if [ "${base_libdir}" != "${libdir}" ]; then
-               install -d ${D}/${libdir}/
-               mv ${D}/${base_libdir}/pkgconfig ${D}/${libdir}/
-       fi
-}
-
-do_install_ptest() {
-    mkdir -p ${D}${PTEST_PATH}/tests
-    install -m 0755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests
-    install -m 0644 ${S}/tests/confdir ${D}${PTEST_PATH}/tests
 }
 
 pkg_postinst:${PN}() {
-- 
2.39.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#208260): 
https://lists.openembedded.org/g/openembedded-core/message/208260
Mute This Topic: https://lists.openembedded.org/mt/109915765/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to