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 | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 29 | SRC_URI[sha256sum] = "8eebd541a640aec95ed4b2da89713f0cbe8e4edf96895fbb972c0b9d570635c3" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 30 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 31 | inherit autotools pkgconfig gettext python3-dir features_check systemd |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 32 | |
| 33 | REQUIRED_DISTRO_FEATURES = "pam" |
| 34 | |
| 35 | SSSD_UID ?= "root" |
| 36 | SSSD_GID ?= "root" |
| 37 | |
| 38 | CACHED_CONFIGUREVARS = "ac_cv_member_struct_ldap_conncb_lc_arg=no \ |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 39 | ac_cv_prog_HAVE_PYTHON3=${PYTHON_DIR} \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | " |
| 41 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 42 | PACKAGECONFIG ?="nss autofs sudo infopipe" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 43 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}" |
| 44 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" |
| 45 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 46 | PACKAGECONFIG[autofs] = "--with-autofs, --with-autofs=no" |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 47 | PACKAGECONFIG[crypto] = ", , libcrypto" |
Andrew Geissler | 064f75b | 2020-06-27 00:14:46 -0500 | [diff] [blame] | 48 | PACKAGECONFIG[curl] = "--with-kcm, --without-kcm, curl jansson" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 49 | PACKAGECONFIG[infopipe] = "--with-infopipe, --with-infopipe=no, " |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 50 | 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] | 51 | PACKAGECONFIG[nl] = "--with-libnl, --with-libnl=no, libnl" |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 52 | PACKAGECONFIG[nss] = ", ,nss," |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 53 | PACKAGECONFIG[oidc_child] = "--with-oidc-child, --without-oidc-child" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 54 | PACKAGECONFIG[python3] = "--with-python3-bindings, --without-python3-bindings" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 55 | PACKAGECONFIG[samba] = "--with-samba, --with-samba=no, samba" |
| 56 | PACKAGECONFIG[selinux] = "--with-selinux, --with-selinux=no --with-semanage=no, libselinux" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 57 | PACKAGECONFIG[ssh] = "--with-ssh, --with-ssh=no, " |
| 58 | PACKAGECONFIG[sudo] = "--with-sudo, --with-sudo=no, " |
| 59 | PACKAGECONFIG[systemd] = "--with-initscript=systemd,--with-initscript=sysv" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 60 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 61 | EXTRA_OECONF += " \ |
| 62 | --disable-cifs-idmap-plugin \ |
| 63 | --without-nfsv4-idmapd-plugin \ |
| 64 | --without-ipa-getkeytab \ |
| 65 | --without-python2-bindings \ |
| 66 | --enable-pammoddir=${base_libdir}/security \ |
| 67 | --without-python2-bindings \ |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 68 | --with-xml-catalog-path=${STAGING_ETCDIR_NATIVE}/xml/catalog \ |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 69 | --with-pid-path=/run \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 70 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | do_configure:prepend() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 73 | mkdir -p ${AUTOTOOLS_AUXDIR}/build |
| 74 | cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/build/ |
| 75 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 76 | # additional_libdir defaults to /usr/lib so replace with staging_libdir globally |
| 77 | 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] | 78 | } |
| 79 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 80 | do_compile:prepend () { |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 81 | echo '#define NSUPDATE_PATH "${bindir}"' >> ${B}/config.h |
| 82 | } |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 83 | do_install () { |
| 84 | oe_runmake install DESTDIR="${D}" |
| 85 | rmdir --ignore-fail-on-non-empty "${D}/${bindir}" |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 86 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 87 | install -d ${D}/${sysconfdir}/${BPN} |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 88 | install -d ${D}/${PYTHON_SITEPACKAGES_DIR} |
| 89 | mv ${D}/${BPN} ${D}/${PYTHON_SITEPACKAGES_DIR} |
| 90 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 91 | install -m 600 ${WORKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN} |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 92 | |
| 93 | # /var/log/sssd needs to be created in runtime. Use rmdir to catch if |
| 94 | # upstream stops creating /var/log/sssd, or adds something else in |
| 95 | # /var/log. |
| 96 | rmdir ${D}${localstatedir}/log/${BPN} ${D}${localstatedir}/log |
| 97 | rmdir --ignore-fail-on-non-empty ${D}${localstatedir} |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 98 | |
| 99 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 100 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 101 | echo "d /var/log/sssd 0750 - - - -" > ${D}${sysconfdir}/tmpfiles.d/sss.conf |
| 102 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 103 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 104 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then |
| 105 | install -d ${D}${sysconfdir}/default/volatiles |
| 106 | echo "d ${SSSD_UID}:${SSSD_GID} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN} |
| 107 | fi |
| 108 | |
Andrew Geissler | a1a6aef | 2021-06-25 14:23:58 -0500 | [diff] [blame] | 109 | # Remove /run as it is created on startup |
| 110 | rm -rf ${D}/run |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 111 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 112 | # rm -fr ${D}/sssd |
Andrew Geissler | 064f75b | 2020-06-27 00:14:46 -0500 | [diff] [blame] | 113 | rm -f ${D}${systemd_system_unitdir}/sssd-secrets.* |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 114 | } |
| 115 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 116 | pkg_postinst_ontarget:${PN} () { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 117 | if [ -e /etc/init.d/populate-volatile.sh ] ; then |
| 118 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 119 | fi |
| 120 | chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf |
| 121 | } |
| 122 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 123 | CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 124 | |
| 125 | INITSCRIPT_NAME = "sssd" |
| 126 | INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 127 | SYSTEMD_SERVICE:${PN} = " \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 128 | ${@bb.utils.contains('PACKAGECONFIG', 'autofs', 'sssd-autofs.service sssd-autofs.socket', '', d)} \ |
| 129 | ${@bb.utils.contains('PACKAGECONFIG', 'curl', 'sssd-kcm.service sssd-kcm.socket', '', d)} \ |
| 130 | ${@bb.utils.contains('PACKAGECONFIG', 'infopipe', 'sssd-ifp.service ', '', d)} \ |
| 131 | ${@bb.utils.contains('PACKAGECONFIG', 'ssh', 'sssd-ssh.service sssd-ssh.socket', '', d)} \ |
| 132 | ${@bb.utils.contains('PACKAGECONFIG', 'sudo', 'sssd-sudo.service sssd-sudo.socket', '', d)} \ |
| 133 | sssd-nss.service \ |
| 134 | sssd-nss.socket \ |
| 135 | sssd-pam-priv.socket \ |
| 136 | sssd-pam.service \ |
| 137 | sssd-pam.socket \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 138 | sssd.service \ |
| 139 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 140 | SYSTEMD_AUTO_ENABLE = "disable" |
| 141 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 142 | PACKAGES =+ "libsss-sudo" |
| 143 | ALLOW_EMPTY:libsss-sudo = "1" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 144 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 145 | FILES:${PN} += "${base_libdir}/security/pam_sss*.so \ |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 146 | ${nonarch_libdir}/tmpfiles.d \ |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 147 | ${datadir}/dbus-1/system-services/*.service \ |
| 148 | ${libdir}/krb5/* \ |
| 149 | ${libdir}/ldb/* \ |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 150 | ${PYTHON_SITEPACKAGES_DIR}/sssd \ |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 151 | " |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 152 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 153 | FILES:libsss-sudo = "${libdir}/libsss_sudo.so" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 154 | |
Patrick Williams | 53961c2 | 2022-01-20 11:06:23 -0600 | [diff] [blame] | 155 | RDEPENDS:${PN} = "bind bind-utils dbus libldb libpam libsss-sudo" |