summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2024-12-04 07:49:14 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-12-05 17:07:10 +0000
commit377066dabd5eb8545645195ee231eb1017517fe4 (patch)
tree1a08bcbb7c487b09229e3281464e23279bd78dba
parent240cd29b3ced645ce0f3ea17de840a42a517d33d (diff)
downloadpoky-377066dabd5eb8545645195ee231eb1017517fe4.tar.gz
libpam: update 1.6.1 -> 1.7.0
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 /. (From OE-Core rev: 00eb730291f9630eb70480d37ed48fbadecc547a) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch40
-rw-r--r--meta/recipes-extended/pam/libpam/libpam-xtests.patch45
-rw-r--r--meta/recipes-extended/pam/libpam_1.7.0.bb (renamed from meta/recipes-extended/pam/libpam_1.6.1.bb)51
3 files changed, 52 insertions, 84 deletions
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 0000000000..ef087ffc06
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch
@@ -0,0 +1,40 @@
1From 9b5182d4781bcd6fb37a4030faf325965fde3e93 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Thu, 28 Nov 2024 20:32:17 +0100
4Subject: [PATCH] meson: correct check for existence of two preprocessor
5 defines
6
7sizeof is meant for *types*, and in case of cross compiling
8the test program produced by it has incorrect syntax
9 __NR_keyctl something;
10and will always fail to compile.
11
12* meson.build: Use cc.get_define() instead of cc.sizeof() to check for
13preprocessor symbols.
14
15Co-authored-by: Dmitry V. Levin <ldv@strace.io>
16Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/pull/861]
17Signed-off-by: Alexander Kanavin <alex@linutronix.de>
18---
19 meson.build | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22diff --git a/meson.build b/meson.build
23index f6a7dafe9..307fed0aa 100644
24--- a/meson.build
25+++ b/meson.build
26@@ -198,12 +198,12 @@ foreach ident: check_functions
27 endif
28 endforeach
29
30-enable_pam_keyinit = cc.sizeof('__NR_keyctl', prefix: '#include <sys/syscall.h>') > 0
31+enable_pam_keyinit = cc.get_define('__NR_keyctl', prefix: '#include <sys/syscall.h>') != ''
32
33 if get_option('mailspool') != ''
34 cdata.set_quoted('PAM_PATH_MAILDIR', get_option('mailspool'))
35 else
36- have = cc.sizeof('_PATH_MAILDIR', prefix: '#include <paths.h>') > 0
37+ have = cc.get_define('_PATH_MAILDIR', prefix: '#include <paths.h>') != ''
38 cdata.set('PAM_PATH_MAILDIR', have ? '_PATH_MAILDIR' : '"/var/spool/mail"')
39 endif
40
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 f2dafa72a5..0000000000
--- a/meta/recipes-extended/pam/libpam/libpam-xtests.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1From 060726f7e60c8ecb5bf50fd776910b290d9a0a69 Mon Sep 17 00:00:00 2001
2From: Kang Kai <kai.kang@windriver.com>
3Date: Tue, 19 Jul 2011 17:08:31 +0800
4Subject: [PATCH] This patch is used to create a new sub package libpam-xtests
5 to do more checks.
6
7Upstream-Status: Pending
8
9Signed-off-by: Kang Kai <kai.kang@windriver.com>
10---
11 xtests/Makefile.am | 17 ++++++++++++++++-
12 1 file changed, 16 insertions(+), 1 deletion(-)
13
14diff --git a/xtests/Makefile.am b/xtests/Makefile.am
15index acf9746..9826c9f 100644
16--- a/xtests/Makefile.am
17+++ b/xtests/Makefile.am
18@@ -8,7 +8,7 @@ AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_srcdir)/libpam/include \
19 LDADD = $(top_builddir)/libpam/libpam.la \
20 $(top_builddir)/libpam_misc/libpam_misc.la
21
22-CLEANFILES = *~ $(XTESTS)
23+CLEANFILES = *~
24
25 EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \
26 tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \
27@@ -55,3 +55,18 @@ EXTRA_PROGRAMS = $(XTESTS)
28
29 xtests: $(XTESTS) run-xtests.sh
30 "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS}
31+
32+all: $(XTESTS)
33+
34+install: install_xtests
35+
36+install_xtests:
37+ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests
38+ for file in $(EXTRA_DIST) ; do \
39+ $(INSTALL) $(srcdir)/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
40+ done
41+ for file in $(XTESTS); do \
42+ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
43+ done
44+
45+.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
index a48f78187b..ec1c868d21 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 \
20 file://pam.d/common-session \ 20 file://pam.d/common-session \
21 file://pam.d/common-session-noninteractive \ 21 file://pam.d/common-session-noninteractive \
22 file://pam.d/other \ 22 file://pam.d/other \
23 file://libpam-xtests.patch \
24 file://run-ptest \ 23 file://run-ptest \
25 file://pam-volatiles.conf \ 24 file://pam-volatiles.conf \
25 file://0001-meson.build-correct-check-for-existence-of-two-prepr.patch \
26 " 26 "
27 27
28SRC_URI[sha256sum] = "f8923c740159052d719dbfc2a2f81942d68dd34fcaf61c706a02c9b80feeef8e" 28SRC_URI[sha256sum] = "57dcd7a6b966ecd5bbd95e1d11173734691e16b68692fa59661cdae9b13b1697"
29 29
30DEPENDS = "bison-native flex-native libxml2-native virtual/crypt" 30DEPENDS = "bison-native flex-native libxml2-native virtual/crypt"
31 31
32EXTRA_OECONF = "--includedir=${includedir}/security \ 32EXTRA_OEMESON = "-Ddocs=disabled"
33 --libdir=${base_libdir} \
34 --with-systemdunitdir=${systemd_system_unitdir} \
35 --disable-nis \
36 --disable-regenerate-docu \
37 --disable-doc \
38 --disable-prelude"
39
40CFLAGS += "-fPIC "
41 33
42S = "${WORKDIR}/Linux-PAM-${PV}" 34S = "${WORKDIR}/Linux-PAM-${PV}"
43 35
44inherit autotools gettext pkgconfig systemd ptest github-releases 36inherit meson gettext pkgconfig systemd ptest github-releases
45 37
46PACKAGECONFIG ??= "" 38PACKAGECONFIG ??= ""
47PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," 39PACKAGECONFIG[audit] = "-Daudit=enabled,-Daudit=disabled,audit,"
48PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db," 40PACKAGECONFIG[userdb] = "-Dpam_userdb=enabled -Ddb=gdbm,-Dpam_userdb=disabled,gdbm,"
49 41
50PACKAGES += "${PN}-runtime ${PN}-xtests" 42PACKAGES += "${PN}-runtime ${PN}-xtests"
51FILES:${PN} = " \ 43FILES:${PN} = " \
52 ${base_libdir}/lib*${SOLIBS} \ 44 ${libdir}/lib*${SOLIBS} \
53 ${nonarch_libdir}/tmpfiles.d/*.conf \ 45 ${nonarch_libdir}/tmpfiles.d/*.conf \
54" 46"
55FILES:${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" 47FILES:${PN}-dev += "${libdir}/security/*.la ${libdir}/*.la ${libdir}/lib*${SOLIBSDEV}"
56FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${systemd_system_unitdir}" 48FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${nonarch_libdir}/systemd/system"
57FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests" 49FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests"
58 50
59# libpam installs /etc/environment for use with the pam_env plugin. Make sure it is 51# libpam installs /etc/environment for use with the pam_env plugin. Make sure it is
@@ -111,9 +103,9 @@ python populate_packages:prepend () {
111 103
112 mlprefix = d.getVar('MLPREFIX') or '' 104 mlprefix = d.getVar('MLPREFIX') or ''
113 dvar = d.expand('${WORKDIR}/package') 105 dvar = d.expand('${WORKDIR}/package')
114 pam_libdir = d.expand('${base_libdir}/security') 106 pam_libdir = d.expand('${libdir}/security')
115 pam_sbindir = d.expand('${sbindir}') 107 pam_sbindir = d.expand('${sbindir}')
116 pam_filterdir = d.expand('${base_libdir}/security/pam_filter') 108 pam_filterdir = d.expand('${libdir}/security/pam_filter')
117 pam_pkgname = mlprefix + 'pam-plugin%s' 109 pam_pkgname = mlprefix + 'pam-plugin%s'
118 110
119 do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname, 111 do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname,
@@ -121,16 +113,7 @@ python populate_packages:prepend () {
121 do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') 113 do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
122} 114}
123 115
124do_compile_ptest() { 116do_install:append() {
125 cd tests
126 sed -i -e 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//' Makefile
127 oe_runmake check-am
128 cd -
129}
130
131do_install() {
132 autotools_do_install
133
134 # don't install /var/run when populating rootfs. Do it through volatile 117 # don't install /var/run when populating rootfs. Do it through volatile
135 rm -rf ${D}${localstatedir} 118 rm -rf ${D}${localstatedir}
136 119
@@ -155,16 +138,6 @@ do_install() {
155 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 138 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
156 echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session 139 echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session
157 fi 140 fi
158 if [ "${base_libdir}" != "${libdir}" ]; then
159 install -d ${D}/${libdir}/
160 mv ${D}/${base_libdir}/pkgconfig ${D}/${libdir}/
161 fi
162}
163
164do_install_ptest() {
165 mkdir -p ${D}${PTEST_PATH}/tests
166 install -m 0755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests
167 install -m 0644 ${S}/tests/confdir ${D}${PTEST_PATH}/tests
168} 141}
169 142
170pkg_postinst:${PN}() { 143pkg_postinst:${PN}() {