libpam_1.3.1.bb 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. DISABLE_STATIC = ""
  2. SUMMARY = "Linux-PAM (Pluggable Authentication Modules)"
  3. DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users"
  4. HOMEPAGE = "https://fedorahosted.org/linux-pam/"
  5. BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket"
  6. SECTION = "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 GPLv2+), by openembedded
  10. LICENSE = "GPLv2+ | BSD"
  11. LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3 \
  12. file://libpamc/License;md5=a4da476a14c093fdc73be3c3c9ba8fb3 \
  13. "
  14. SRC_URI = "https://github.com/linux-pam/linux-pam/releases/download/v${PV}/Linux-PAM-${PV}.tar.xz \
  15. file://99_pam \
  16. file://pam.d/common-account \
  17. file://pam.d/common-auth \
  18. file://pam.d/common-password \
  19. file://pam.d/common-session \
  20. file://pam.d/common-session-noninteractive \
  21. file://pam.d/other \
  22. file://libpam-xtests.patch \
  23. file://pam-security-abstract-securetty-handling.patch \
  24. file://pam-unix-nullok-secure.patch \
  25. file://crypt_configure.patch \
  26. "
  27. SRC_URI[md5sum] = "558ff53b0fc0563ca97f79e911822165"
  28. SRC_URI[sha256sum] = "eff47a4ecd833fbf18de9686632a70ee8d0794b79aecb217ebd0ce11db4cd0db"
  29. SRC_URI_append_libc-musl = " file://0001-Add-support-for-defining-missing-funcitonality.patch \
  30. file://include_paths_header.patch \
  31. "
  32. DEPENDS = "bison-native flex flex-native cracklib libxml2-native virtual/crypt"
  33. EXTRA_OECONF = "--includedir=${includedir}/security \
  34. --libdir=${base_libdir} \
  35. --disable-nis \
  36. --disable-regenerate-docu \
  37. --disable-prelude"
  38. CFLAGS_append = " -fPIC "
  39. S = "${WORKDIR}/Linux-PAM-${PV}"
  40. inherit autotools gettext pkgconfig
  41. PACKAGECONFIG ??= ""
  42. PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
  43. PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db,"
  44. PACKAGES += "${PN}-runtime ${PN}-xtests"
  45. FILES_${PN} = "${base_libdir}/lib*${SOLIBS}"
  46. FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}"
  47. FILES_${PN}-runtime = "${sysconfdir}"
  48. FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests"
  49. PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*"
  50. def get_multilib_bit(d):
  51. baselib = d.getVar('baselib') or ''
  52. return baselib.replace('lib', '')
  53. libpam_suffix = "suffix${@get_multilib_bit(d)}"
  54. RPROVIDES_${PN} += "${PN}-${libpam_suffix}"
  55. RPROVIDES_${PN}-runtime += "${PN}-runtime-${libpam_suffix}"
  56. RDEPENDS_${PN}-runtime = "${PN}-${libpam_suffix} \
  57. ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \
  58. ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \
  59. ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \
  60. ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \
  61. "
  62. RDEPENDS_${PN}-xtests = "${PN}-${libpam_suffix} \
  63. ${MLPREFIX}pam-plugin-access-${libpam_suffix} \
  64. ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \
  65. ${MLPREFIX}pam-plugin-cracklib-${libpam_suffix} \
  66. ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \
  67. ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \
  68. ${MLPREFIX}pam-plugin-time-${libpam_suffix} \
  69. coreutils"
  70. # FIXME: Native suffix breaks here, disable it for now
  71. RRECOMMENDS_${PN} = "${PN}-runtime-${libpam_suffix}"
  72. RRECOMMENDS_${PN}_class-native = ""
  73. python populate_packages_prepend () {
  74. def pam_plugin_append_file(pn, dir, file):
  75. nf = os.path.join(dir, file)
  76. of = d.getVar('FILES_' + pn)
  77. if of:
  78. nf = of + " " + nf
  79. d.setVar('FILES_' + pn, nf)
  80. def pam_plugin_hook(file, pkg, pattern, format, basename):
  81. pn = d.getVar('PN')
  82. libpam_suffix = d.getVar('libpam_suffix')
  83. rdeps = d.getVar('RDEPENDS_' + pkg)
  84. if rdeps:
  85. rdeps = rdeps + " " + pn + "-" + libpam_suffix
  86. else:
  87. rdeps = pn + "-" + libpam_suffix
  88. d.setVar('RDEPENDS_' + pkg, rdeps)
  89. provides = d.getVar('RPROVIDES_' + pkg)
  90. if provides:
  91. provides = provides + " " + pkg + "-" + libpam_suffix
  92. else:
  93. provides = pkg + "-" + libpam_suffix
  94. d.setVar('RPROVIDES_' + pkg, provides)
  95. mlprefix = d.getVar('MLPREFIX') or ''
  96. dvar = d.expand('${WORKDIR}/package')
  97. pam_libdir = d.expand('${base_libdir}/security')
  98. pam_sbindir = d.expand('${sbindir}')
  99. pam_filterdir = d.expand('${base_libdir}/security/pam_filter')
  100. pam_pkgname = mlprefix + 'pam-plugin%s'
  101. do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname,
  102. 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='')
  103. pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_chkpwd')
  104. pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_update')
  105. pam_plugin_append_file('%spam-plugin-tally' % mlprefix, pam_sbindir, 'pam_tally')
  106. pam_plugin_append_file('%spam-plugin-tally2' % mlprefix, pam_sbindir, 'pam_tally2')
  107. pam_plugin_append_file('%spam-plugin-timestamp' % mlprefix, pam_sbindir, 'pam_timestamp_check')
  108. pam_plugin_append_file('%spam-plugin-mkhomedir' % mlprefix, pam_sbindir, 'mkhomedir_helper')
  109. pam_plugin_append_file('%spam-plugin-console' % mlprefix, pam_sbindir, 'pam_console_apply')
  110. do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
  111. }
  112. do_install() {
  113. autotools_do_install
  114. # don't install /var/run when populating rootfs. Do it through volatile
  115. rm -rf ${D}${localstatedir}
  116. install -d ${D}${sysconfdir}/default/volatiles
  117. install -m 0644 ${WORKDIR}/99_pam ${D}${sysconfdir}/default/volatiles
  118. install -d ${D}${sysconfdir}/pam.d/
  119. install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
  120. # The lsb requires unix_chkpwd has setuid permission
  121. chmod 4755 ${D}${sbindir}/unix_chkpwd
  122. if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
  123. echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session
  124. fi
  125. }
  126. inherit features_check
  127. REQUIRED_DISTRO_FEATURES = "pam"
  128. BBCLASSEXTEND = "nativesdk native"
  129. CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session"
  130. CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth"
  131. CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password"
  132. CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive"
  133. CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account"
  134. CONFFILES_${PN}-runtime += "${sysconfdir}/security/limits.conf"
  135. UPSTREAM_CHECK_URI = "https://github.com/linux-pam/linux-pam/releases"
  136. CVE_PRODUCT = "linux-pam"