Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "system security services daemon" |
| 2 | DESCRIPTION = "SSSD is a system security services daemon" |
| 3 | HOMEPAGE = "https://pagure.io/SSSD/sssd/" |
| 4 | SECTION = "base" |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 5 | LICENSE = "GPL-3.0-or-later" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
| 7 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 8 | DEPENDS = "acl attr cyrus-sasl libtdb ding-libs libpam c-ares krb5 autoconf-archive" |
| 9 | DEPENDS:append = " libldb dbus libtalloc libpcre2 glib-2.0 popt e2fsprogs libtevent" |
| 10 | DEPENDS:append = " openldap bind p11-kit jansson softhsm openssl libunistring" |
Andrew Geissler | d1d22e6 | 2020-10-16 10:14:32 -0500 | [diff] [blame] | 11 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 12 | DEPENDS:append:libc-musl = " musl-nscd" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 13 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 14 | # If no crypto has been selected, default to DEPEND on nss, since that's what |
| 15 | # sssd will pick if no active choice is made during configure |
| 16 | DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'nss', '', \ |
| 17 | bb.utils.contains('PACKAGECONFIG', 'crypto', '', 'nss', d), d)}" |
| 18 | |
Andrew Geissler | 59125e0 | 2021-07-23 12:56:22 -0400 | [diff] [blame] | 19 | SRC_URI = "https://github.com/SSSD/sssd/releases/download/${PV}/sssd-${PV}.tar.gz \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 20 | file://sssd.conf \ |
| 21 | file://volatiles.99_sssd \ |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 22 | file://no_gen.patch \ |
| 23 | file://fix_gid.patch \ |
| 24 | file://drop_ntpdate_chk.patch \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 25 | file://fix-ldblibdir.patch \ |
Andrew Geissler | 59125e0 | 2021-07-23 12:56:22 -0400 | [diff] [blame] | 26 | file://musl_fixup.patch \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 27 | " |
Andrew Geissler | 59125e0 | 2021-07-23 12:56:22 -0400 | [diff] [blame] | 28 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 29 | SRC_URI[sha256sum] = "10ef90c63fdbfda905145077679035bd5ad16b24daad13160de8d0ff82ea9950" |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 30 | |
| 31 | UPSTREAM_CHECK_URI = "https://github.com/SSSD/${BPN}/releases" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 32 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 33 | inherit autotools pkgconfig gettext python3-dir features_check systemd |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 34 | |
| 35 | REQUIRED_DISTRO_FEATURES = "pam" |
| 36 | |
| 37 | SSSD_UID ?= "root" |
| 38 | SSSD_GID ?= "root" |
| 39 | |
| 40 | CACHED_CONFIGUREVARS = "ac_cv_member_struct_ldap_conncb_lc_arg=no \ |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 41 | ac_cv_prog_HAVE_PYTHON3=${PYTHON_DIR} \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 42 | " |
| 43 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 44 | PACKAGECONFIG ?="nss autofs sudo infopipe" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 45 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}" |
| 46 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" |
| 47 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 48 | PACKAGECONFIG[autofs] = "--with-autofs, --with-autofs=no" |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 49 | PACKAGECONFIG[crypto] = ", , libcrypto" |
Andrew Geissler | 064f75b | 2020-06-27 00:14:46 -0500 | [diff] [blame] | 50 | PACKAGECONFIG[curl] = "--with-kcm, --without-kcm, curl jansson" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 51 | PACKAGECONFIG[infopipe] = "--with-infopipe, --with-infopipe=no, " |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 52 | PACKAGECONFIG[manpages] = "--with-manpages, --with-manpages=no, libxslt-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 53 | PACKAGECONFIG[nl] = "--with-libnl, --with-libnl=no, libnl" |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 54 | PACKAGECONFIG[nss] = ", ,nss," |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 55 | PACKAGECONFIG[oidc_child] = "--with-oidc-child, --without-oidc-child" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 56 | PACKAGECONFIG[python3] = "--with-python3-bindings, --without-python3-bindings" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 57 | PACKAGECONFIG[samba] = "--with-samba, --with-samba=no, samba" |
| 58 | PACKAGECONFIG[selinux] = "--with-selinux, --with-selinux=no --with-semanage=no, libselinux" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 59 | PACKAGECONFIG[ssh] = "--with-ssh, --with-ssh=no, " |
| 60 | PACKAGECONFIG[sudo] = "--with-sudo, --with-sudo=no, " |
| 61 | PACKAGECONFIG[systemd] = "--with-initscript=systemd,--with-initscript=sysv" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 62 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 63 | EXTRA_OECONF += " \ |
| 64 | --disable-cifs-idmap-plugin \ |
| 65 | --without-nfsv4-idmapd-plugin \ |
| 66 | --without-ipa-getkeytab \ |
| 67 | --without-python2-bindings \ |
| 68 | --enable-pammoddir=${base_libdir}/security \ |
| 69 | --without-python2-bindings \ |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 70 | --with-xml-catalog-path=${STAGING_ETCDIR_NATIVE}/xml/catalog \ |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 71 | --with-pid-path=/run \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 72 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 73 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 74 | do_configure:prepend() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 75 | mkdir -p ${AUTOTOOLS_AUXDIR}/build |
| 76 | cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/build/ |
| 77 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 78 | # additional_libdir defaults to /usr/lib so replace with staging_libdir globally |
| 79 | sed -i -e "s#\$additional_libdir#\${STAGING_LIBDIR}#" ${S}/src/build_macros.m4 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 80 | } |
| 81 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 82 | do_compile:prepend () { |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 83 | echo '#define NSUPDATE_PATH "${bindir}"' >> ${B}/config.h |
| 84 | } |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 85 | do_install () { |
| 86 | oe_runmake install DESTDIR="${D}" |
| 87 | rmdir --ignore-fail-on-non-empty "${D}/${bindir}" |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 88 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 89 | install -d ${D}/${sysconfdir}/${BPN} |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 90 | install -d ${D}/${PYTHON_SITEPACKAGES_DIR} |
| 91 | mv ${D}/${BPN} ${D}/${PYTHON_SITEPACKAGES_DIR} |
| 92 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 93 | install -m 600 ${WORKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN} |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 94 | |
| 95 | # /var/log/sssd needs to be created in runtime. Use rmdir to catch if |
| 96 | # upstream stops creating /var/log/sssd, or adds something else in |
| 97 | # /var/log. |
| 98 | rmdir ${D}${localstatedir}/log/${BPN} ${D}${localstatedir}/log |
| 99 | rmdir --ignore-fail-on-non-empty ${D}${localstatedir} |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 100 | |
| 101 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 102 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 103 | echo "d /var/log/sssd 0750 - - - -" > ${D}${sysconfdir}/tmpfiles.d/sss.conf |
| 104 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 105 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 106 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then |
| 107 | install -d ${D}${sysconfdir}/default/volatiles |
| 108 | echo "d ${SSSD_UID}:${SSSD_GID} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN} |
| 109 | fi |
| 110 | |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 111 | # Remove /run as it is created on startup |
| 112 | rm -rf ${D}/run |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 113 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 114 | # rm -fr ${D}/sssd |
Andrew Geissler | 064f75b | 2020-06-27 00:14:46 -0500 | [diff] [blame] | 115 | rm -f ${D}${systemd_system_unitdir}/sssd-secrets.* |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 116 | } |
| 117 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 118 | pkg_postinst_ontarget:${PN} () { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 119 | if [ -e /etc/init.d/populate-volatile.sh ] ; then |
| 120 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 121 | fi |
| 122 | chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf |
| 123 | } |
| 124 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 125 | CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 126 | |
| 127 | INITSCRIPT_NAME = "sssd" |
| 128 | INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 129 | SYSTEMD_SERVICE:${PN} = " \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 130 | ${@bb.utils.contains('PACKAGECONFIG', 'autofs', 'sssd-autofs.service sssd-autofs.socket', '', d)} \ |
| 131 | ${@bb.utils.contains('PACKAGECONFIG', 'curl', 'sssd-kcm.service sssd-kcm.socket', '', d)} \ |
| 132 | ${@bb.utils.contains('PACKAGECONFIG', 'infopipe', 'sssd-ifp.service ', '', d)} \ |
| 133 | ${@bb.utils.contains('PACKAGECONFIG', 'ssh', 'sssd-ssh.service sssd-ssh.socket', '', d)} \ |
| 134 | ${@bb.utils.contains('PACKAGECONFIG', 'sudo', 'sssd-sudo.service sssd-sudo.socket', '', d)} \ |
| 135 | sssd-nss.service \ |
| 136 | sssd-nss.socket \ |
| 137 | sssd-pam-priv.socket \ |
| 138 | sssd-pam.service \ |
| 139 | sssd-pam.socket \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 140 | sssd.service \ |
| 141 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 142 | SYSTEMD_AUTO_ENABLE = "disable" |
| 143 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 144 | PACKAGES =+ "libsss-sudo" |
| 145 | ALLOW_EMPTY:libsss-sudo = "1" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 146 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 147 | FILES:${PN} += "${base_libdir}/security/pam_sss*.so \ |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 148 | ${nonarch_libdir}/tmpfiles.d \ |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 149 | ${datadir}/dbus-1/system-services/*.service \ |
| 150 | ${libdir}/krb5/* \ |
| 151 | ${libdir}/ldb/* \ |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 152 | ${PYTHON_SITEPACKAGES_DIR}/sssd \ |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 153 | " |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 154 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 155 | FILES:libsss-sudo = "${libdir}/libsss_sudo.so" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 156 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 157 | RDEPENDS:${PN} = "bind bind-utils dbus libldb libpam libsss-sudo" |