summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/pam/libpam_1.6.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/pam/libpam_1.6.0.bb')
-rw-r--r--meta/recipes-extended/pam/libpam_1.6.0.bb191
1 files changed, 191 insertions, 0 deletions
diff --git a/meta/recipes-extended/pam/libpam_1.6.0.bb b/meta/recipes-extended/pam/libpam_1.6.0.bb
new file mode 100644
index 0000000000..e1ed940d1e
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam_1.6.0.bb
@@ -0,0 +1,191 @@
1DISABLE_STATIC = ""
2SUMMARY = "Linux-PAM (Pluggable Authentication Modules)"
3DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users"
4HOMEPAGE = "https://fedorahosted.org/linux-pam/"
5BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket"
6SECTION = "base"
7# PAM is dual licensed under GPL and BSD.
8# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time
9# libpam-runtime-1.0.1 is GPL-2.0-or-later), by openembedded
10LICENSE = "GPL-2.0-or-later | BSD-3-Clause"
11LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3 \
12 file://libpamc/License;md5=a4da476a14c093fdc73be3c3c9ba8fb3 \
13 "
14
15SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/Linux-PAM-${PV}.tar.xz \
16 file://99_pam \
17 file://pam.d/common-account \
18 file://pam.d/common-auth \
19 file://pam.d/common-password \
20 file://pam.d/common-session \
21 file://pam.d/common-session-noninteractive \
22 file://pam.d/other \
23 file://libpam-xtests.patch \
24 file://run-ptest \
25 file://pam-volatiles.conf \
26 file://0001-pam_namespace-include-stdint-h.patch \
27 "
28
29SRC_URI[sha256sum] = "fff4a34e5bbee77e2e8f1992f27631e2329bcbf8a0563ddeb5c3389b4e3169ad"
30
31DEPENDS = "bison-native flex-native cracklib libxml2-native virtual/crypt"
32
33EXTRA_OECONF = "--includedir=${includedir}/security \
34 --libdir=${base_libdir} \
35 --with-systemdunitdir=${systemd_system_unitdir} \
36 --disable-nis \
37 --disable-regenerate-docu \
38 --disable-doc \
39 --disable-prelude"
40
41CFLAGS:append = " -fPIC "
42
43S = "${WORKDIR}/Linux-PAM-${PV}"
44
45inherit autotools gettext pkgconfig systemd ptest github-releases
46
47PACKAGECONFIG ??= ""
48PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
49PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db,"
50
51PACKAGES += "${PN}-runtime ${PN}-xtests"
52FILES:${PN} = " \
53 ${base_libdir}/lib*${SOLIBS} \
54 ${nonarch_libdir}/tmpfiles.d/*.conf \
55"
56FILES:${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}"
57FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${systemd_system_unitdir}"
58FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests"
59
60# libpam installs /etc/environment for use with the pam_env plugin. Make sure it is
61# packaged with the pam-plugin-env package to avoid breaking installations which
62# install that file via other packages
63FILES:pam-plugin-env = "${sysconfdir}/environment"
64
65PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*"
66
67def get_multilib_bit(d):
68 baselib = d.getVar('baselib') or ''
69 return baselib.replace('lib', '')
70
71libpam_suffix = "suffix${@get_multilib_bit(d)}"
72
73RPROVIDES:${PN} += "${PN}-${libpam_suffix}"
74RPROVIDES:${PN}-runtime += "${PN}-runtime-${libpam_suffix}"
75
76RDEPENDS:${PN}-runtime = "${PN}-${libpam_suffix} \
77 ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \
78 ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \
79 ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \
80 ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \
81 "
82RDEPENDS:${PN}-xtests = "${PN}-${libpam_suffix} \
83 ${MLPREFIX}pam-plugin-access-${libpam_suffix} \
84 ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \
85 ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \
86 ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \
87 ${MLPREFIX}pam-plugin-time-${libpam_suffix} \
88 bash coreutils"
89
90# FIXME: Native suffix breaks here, disable it for now
91RRECOMMENDS:${PN} = "${PN}-runtime-${libpam_suffix}"
92RRECOMMENDS:${PN}:class-native = ""
93
94python populate_packages:prepend () {
95 def pam_plugin_hook(file, pkg, pattern, format, basename):
96 pn = d.getVar('PN')
97 libpam_suffix = d.getVar('libpam_suffix')
98
99 rdeps = d.getVar('RDEPENDS:' + pkg)
100 if rdeps:
101 rdeps = rdeps + " " + pn + "-" + libpam_suffix
102 else:
103 rdeps = pn + "-" + libpam_suffix
104 d.setVar('RDEPENDS:' + pkg, rdeps)
105
106 provides = d.getVar('RPROVIDES:' + pkg)
107 if provides:
108 provides = provides + " " + pkg + "-" + libpam_suffix
109 else:
110 provides = pkg + "-" + libpam_suffix
111 d.setVar('RPROVIDES:' + pkg, provides)
112
113 mlprefix = d.getVar('MLPREFIX') or ''
114 dvar = d.expand('${WORKDIR}/package')
115 pam_libdir = d.expand('${base_libdir}/security')
116 pam_sbindir = d.expand('${sbindir}')
117 pam_filterdir = d.expand('${base_libdir}/security/pam_filter')
118 pam_pkgname = mlprefix + 'pam-plugin%s'
119
120 do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname,
121 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='', prepend=True)
122 do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
123}
124
125do_compile_ptest() {
126 cd tests
127 sed -i -e 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//' Makefile
128 oe_runmake check-am
129 cd -
130}
131
132do_install() {
133 autotools_do_install
134
135 # don't install /var/run when populating rootfs. Do it through volatile
136 rm -rf ${D}${localstatedir}
137
138 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
139 rm -rf ${D}${sysconfdir}/init.d/
140 rm -rf ${D}${sysconfdir}/rc*
141 install -d ${D}${nonarch_libdir}/tmpfiles.d
142 install -m 0644 ${WORKDIR}/pam-volatiles.conf \
143 ${D}${nonarch_libdir}/tmpfiles.d/pam.conf
144 else
145 install -d ${D}${sysconfdir}/default/volatiles
146 install -m 0644 ${WORKDIR}/99_pam \
147 ${D}${sysconfdir}/default/volatiles/
148 fi
149
150 install -d ${D}${sysconfdir}/pam.d/
151 install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
152
153 # The lsb requires unix_chkpwd has setuid permission
154 chmod 4755 ${D}${sbindir}/unix_chkpwd
155
156 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
157 echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session
158 fi
159 if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
160 install -d ${D}/${libdir}/
161 mv ${D}/${base_libdir}/pkgconfig ${D}/${libdir}/
162 fi
163}
164
165do_install_ptest() {
166 mkdir -p ${D}${PTEST_PATH}/tests
167 install -m 0755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests
168 install -m 0644 ${S}/tests/confdir ${D}${PTEST_PATH}/tests
169}
170
171pkg_postinst:${PN}() {
172 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
173 /etc/init.d/populate-volatile.sh update
174 fi
175}
176
177inherit features_check
178ANY_OF_DISTRO_FEATURES = "pam systemd"
179
180BBCLASSEXTEND = "nativesdk native"
181
182CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-session"
183CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-auth"
184CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-password"
185CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive"
186CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-account"
187CONFFILES:${PN}-runtime += "${sysconfdir}/security/limits.conf"
188
189GITHUB_BASE_URI = "https://github.com/linux-pam/linux-pam/releases"
190
191CVE_PRODUCT = "linux-pam"