Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 1 | SUMMARY = "Linux-PAM (Pluggable Authentication Modules)" |
| 2 | DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users" |
| 3 | HOMEPAGE = "https://fedorahosted.org/linux-pam/" |
| 4 | BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket" |
| 5 | SECTION = "base" |
| 6 | # PAM is dual licensed under GPL and BSD. |
| 7 | # /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time |
| 8 | # libpam-runtime-1.0.1 is GPLv2+), by openembedded |
| 9 | LICENSE = "GPLv2+ | BSD" |
| 10 | LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3" |
| 11 | |
| 12 | SRC_URI = "http://linux-pam.org/library/Linux-PAM-${PV}.tar.bz2 \ |
| 13 | file://99_pam \ |
| 14 | file://pam.d/common-account \ |
| 15 | file://pam.d/common-auth \ |
| 16 | file://pam.d/common-password \ |
| 17 | file://pam.d/common-session \ |
| 18 | file://pam.d/common-session-noninteractive \ |
| 19 | file://pam.d/other \ |
| 20 | file://libpam-xtests.patch \ |
| 21 | file://fixsepbuild.patch \ |
| 22 | file://pam-security-abstract-securetty-handling.patch \ |
| 23 | file://pam-unix-nullok-secure.patch \ |
| 24 | file://libpam-xtests-remove-bash-dependency.patch \ |
| 25 | file://crypt_configure.patch \ |
| 26 | " |
| 27 | |
| 28 | SRC_URI[md5sum] = "da4b2289b7cfb19583d54e9eaaef1c3a" |
| 29 | SRC_URI[sha256sum] = "241aed1ef522f66ed672719ecf2205ec513fd0075ed80cda8e086a5b1a01d1bb" |
| 30 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 31 | SRC_URI_append_libc-musl = " file://0001-Add-support-for-defining-missing-funcitonality.patch \ |
| 32 | file://include_paths_header.patch \ |
| 33 | " |
| 34 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | DEPENDS = "bison-native flex flex-native cracklib libxml2-native virtual/crypt" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 36 | |
| 37 | EXTRA_OECONF = "--with-db-uniquename=_pam \ |
| 38 | --includedir=${includedir}/security \ |
| 39 | --libdir=${base_libdir} \ |
| 40 | --disable-nis \ |
| 41 | --disable-regenerate-docu \ |
| 42 | --disable-prelude" |
| 43 | |
| 44 | CFLAGS_append = " -fPIC " |
| 45 | |
| 46 | PR = "r5" |
| 47 | |
| 48 | S = "${WORKDIR}/Linux-PAM-${PV}" |
| 49 | |
| 50 | inherit autotools gettext pkgconfig |
| 51 | |
| 52 | PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," |
| 53 | |
| 54 | PACKAGES += "${PN}-runtime ${PN}-xtests" |
| 55 | FILES_${PN} = "${base_libdir}/lib*${SOLIBS}" |
| 56 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" |
| 57 | FILES_${PN}-runtime = "${sysconfdir}" |
| 58 | FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests" |
| 59 | |
| 60 | PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*" |
| 61 | |
| 62 | def get_multilib_bit(d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 63 | baselib = d.getVar('baselib') or '' |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 64 | return baselib.replace('lib', '') |
| 65 | |
| 66 | libpam_suffix = "suffix${@get_multilib_bit(d)}" |
| 67 | |
| 68 | RPROVIDES_${PN} += "${PN}-${libpam_suffix}" |
| 69 | RPROVIDES_${PN}-runtime += "${PN}-runtime-${libpam_suffix}" |
| 70 | |
| 71 | RDEPENDS_${PN}-runtime = "${PN}-${libpam_suffix} \ |
| 72 | ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \ |
| 73 | ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \ |
| 74 | ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \ |
| 75 | ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \ |
| 76 | " |
| 77 | RDEPENDS_${PN}-xtests = "${PN}-${libpam_suffix} \ |
| 78 | ${MLPREFIX}pam-plugin-access-${libpam_suffix} \ |
| 79 | ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \ |
| 80 | ${MLPREFIX}pam-plugin-cracklib-${libpam_suffix} \ |
| 81 | ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \ |
| 82 | ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \ |
| 83 | ${MLPREFIX}pam-plugin-time-${libpam_suffix} \ |
| 84 | coreutils" |
| 85 | |
| 86 | # FIXME: Native suffix breaks here, disable it for now |
| 87 | RRECOMMENDS_${PN} = "${PN}-runtime-${libpam_suffix}" |
| 88 | RRECOMMENDS_${PN}_class-native = "" |
| 89 | |
| 90 | python populate_packages_prepend () { |
| 91 | def pam_plugin_append_file(pn, dir, file): |
| 92 | nf = os.path.join(dir, file) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 93 | of = d.getVar('FILES_' + pn) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 94 | if of: |
| 95 | nf = of + " " + nf |
| 96 | d.setVar('FILES_' + pn, nf) |
| 97 | |
| 98 | def pam_plugin_hook(file, pkg, pattern, format, basename): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 99 | pn = d.getVar('PN') |
| 100 | libpam_suffix = d.getVar('libpam_suffix') |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 101 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 102 | rdeps = d.getVar('RDEPENDS_' + pkg) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 103 | if rdeps: |
| 104 | rdeps = rdeps + " " + pn + "-" + libpam_suffix |
| 105 | else: |
| 106 | rdeps = pn + "-" + libpam_suffix |
| 107 | d.setVar('RDEPENDS_' + pkg, rdeps) |
| 108 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 109 | provides = d.getVar('RPROVIDES_' + pkg) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 110 | if provides: |
| 111 | provides = provides + " " + pkg + "-" + libpam_suffix |
| 112 | else: |
| 113 | provides = pkg + "-" + libpam_suffix |
| 114 | d.setVar('RPROVIDES_' + pkg, provides) |
| 115 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 116 | mlprefix = d.getVar('MLPREFIX') or '' |
| 117 | dvar = d.expand('${WORKDIR}/package') |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 118 | pam_libdir = d.expand('${base_libdir}/security') |
| 119 | pam_sbindir = d.expand('${sbindir}') |
| 120 | pam_filterdir = d.expand('${base_libdir}/security/pam_filter') |
| 121 | pam_pkgname = mlprefix + 'pam-plugin%s' |
| 122 | |
| 123 | do_split_packages(d, pam_libdir, '^pam(.*)\.so$', pam_pkgname, |
| 124 | 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='') |
| 125 | pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_chkpwd') |
| 126 | pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_update') |
| 127 | pam_plugin_append_file('%spam-plugin-tally' % mlprefix, pam_sbindir, 'pam_tally') |
| 128 | pam_plugin_append_file('%spam-plugin-tally2' % mlprefix, pam_sbindir, 'pam_tally2') |
| 129 | pam_plugin_append_file('%spam-plugin-timestamp' % mlprefix, pam_sbindir, 'pam_timestamp_check') |
| 130 | pam_plugin_append_file('%spam-plugin-mkhomedir' % mlprefix, pam_sbindir, 'mkhomedir_helper') |
| 131 | pam_plugin_append_file('%spam-plugin-console' % mlprefix, pam_sbindir, 'pam_console_apply') |
| 132 | do_split_packages(d, pam_filterdir, '^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') |
| 133 | } |
| 134 | |
| 135 | do_install() { |
| 136 | autotools_do_install |
| 137 | |
| 138 | # don't install /var/run when populating rootfs. Do it through volatile |
| 139 | rm -rf ${D}${localstatedir} |
| 140 | install -d ${D}${sysconfdir}/default/volatiles |
| 141 | install -m 0644 ${WORKDIR}/99_pam ${D}${sysconfdir}/default/volatiles |
| 142 | |
| 143 | install -d ${D}${sysconfdir}/pam.d/ |
| 144 | install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ |
| 145 | |
| 146 | # The lsb requires unix_chkpwd has setuid permission |
| 147 | chmod 4755 ${D}${sbindir}/unix_chkpwd |
| 148 | |
| 149 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 150 | echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session |
| 151 | fi |
| 152 | } |
| 153 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 154 | inherit distro_features_check |
| 155 | REQUIRED_DISTRO_FEATURES = "pam" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 156 | |
| 157 | BBCLASSEXTEND = "nativesdk native" |
| 158 | |
| 159 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session" |
| 160 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth" |
| 161 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password" |
| 162 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive" |
| 163 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account" |
| 164 | CONFFILES_${PN}-runtime += "${sysconfdir}/security/limits.conf" |