blob: 9f1d627e1b96b21648c9eb102008ffe9a319c921 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "system security services daemon"
2DESCRIPTION = "SSSD is a system security services daemon"
3HOMEPAGE = "https://pagure.io/SSSD/sssd/"
4SECTION = "base"
Patrick Williamsde0582f2022-04-08 10:23:27 -05005LICENSE = "GPL-3.0-or-later"
Brad Bishop19323692019-04-05 15:28:33 -04006LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
7
Andrew Geisslera1a6aef2021-06-25 14:23:58 -05008DEPENDS = "acl attr openldap cyrus-sasl libtdb ding-libs libpam c-ares krb5 autoconf-archive"
Patrick Williams213cb262021-08-07 19:21:33 -05009DEPENDS:append = " libldb dbus libtalloc libpcre glib-2.0 popt e2fsprogs libtevent bind p11-kit"
Andrew Geisslerd1d22e62020-10-16 10:14:32 -050010
Patrick Williams213cb262021-08-07 19:21:33 -050011DEPENDS:append:libc-musl = " musl-nscd"
Brad Bishop19323692019-04-05 15:28:33 -040012
Andrew Geissler1fe918a2020-05-15 14:16:47 -050013# If no crypto has been selected, default to DEPEND on nss, since that's what
14# sssd will pick if no active choice is made during configure
15DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'nss', '', \
16 bb.utils.contains('PACKAGECONFIG', 'crypto', '', 'nss', d), d)}"
17
Andrew Geissler59125e02021-07-23 12:56:22 -040018SRC_URI = "https://github.com/SSSD/sssd/releases/download/${PV}/sssd-${PV}.tar.gz \
Andrew Geissler1fe918a2020-05-15 14:16:47 -050019 file://sssd.conf \
20 file://volatiles.99_sssd \
Andrew Geisslera1a6aef2021-06-25 14:23:58 -050021 file://no_gen.patch \
22 file://fix_gid.patch \
23 file://drop_ntpdate_chk.patch \
Andrew Geissler1fe918a2020-05-15 14:16:47 -050024 file://fix-ldblibdir.patch \
Andrew Geissler59125e02021-07-23 12:56:22 -040025 file://musl_fixup.patch \
Andrew Geissler5199d832021-09-24 16:47:35 -050026 file://CVE-2021-3621.patch \
Andrew Geissler1fe918a2020-05-15 14:16:47 -050027 "
Andrew Geissler59125e02021-07-23 12:56:22 -040028
Andrew Geissler5199d832021-09-24 16:47:35 -050029SRC_URI[sha256sum] = "5e21b3c7b4a2f1063d0fbdd3216d29886b6eaba153b44fb5961698367f399a0f"
Brad Bishop19323692019-04-05 15:28:33 -040030
Andrew Geissler1fe918a2020-05-15 14:16:47 -050031inherit autotools pkgconfig gettext python3-dir features_check systemd
Brad Bishop19323692019-04-05 15:28:33 -040032
33REQUIRED_DISTRO_FEATURES = "pam"
34
35SSSD_UID ?= "root"
36SSSD_GID ?= "root"
37
38CACHED_CONFIGUREVARS = "ac_cv_member_struct_ldap_conncb_lc_arg=no \
Andrew Geisslera1a6aef2021-06-25 14:23:58 -050039 ac_cv_prog_HAVE_PYTHON3=${PYTHON_DIR} \
Brad Bishop19323692019-04-05 15:28:33 -040040 "
41
Andrew Geissler1fe918a2020-05-15 14:16:47 -050042PACKAGECONFIG ?="nss nscd autofs sudo infopipe"
Brad Bishop19323692019-04-05 15:28:33 -040043PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
44PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
45
Andrew Geissler1fe918a2020-05-15 14:16:47 -050046PACKAGECONFIG[autofs] = "--with-autofs, --with-autofs=no"
Andrew Geisslera1a6aef2021-06-25 14:23:58 -050047PACKAGECONFIG[crypto] = ", , libcrypto"
Andrew Geissler064f75b2020-06-27 00:14:46 -050048PACKAGECONFIG[curl] = "--with-kcm, --without-kcm, curl jansson"
Andrew Geissler1fe918a2020-05-15 14:16:47 -050049PACKAGECONFIG[infopipe] = "--with-infopipe, --with-infopipe=no, "
Andrew Geisslercc589282020-09-18 13:34:40 -050050PACKAGECONFIG[manpages] = "--with-manpages, --with-manpages=no, libxslt-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
Andrew Geissler1fe918a2020-05-15 14:16:47 -050051PACKAGECONFIG[nl] = "--with-libnl, --with-libnl=no, libnl"
52PACKAGECONFIG[nscd] = "--with-nscd=${sbindir}, --with-nscd=no "
Andrew Geisslera1a6aef2021-06-25 14:23:58 -050053PACKAGECONFIG[nss] = ", ,nss,"
Andrew Geissler1fe918a2020-05-15 14:16:47 -050054PACKAGECONFIG[python3] = "--with-python3-bindings, --without-python3-bindings"
Brad Bishop19323692019-04-05 15:28:33 -040055PACKAGECONFIG[samba] = "--with-samba, --with-samba=no, samba"
56PACKAGECONFIG[selinux] = "--with-selinux, --with-selinux=no --with-semanage=no, libselinux"
Andrew Geissler1fe918a2020-05-15 14:16:47 -050057PACKAGECONFIG[ssh] = "--with-ssh, --with-ssh=no, "
58PACKAGECONFIG[sudo] = "--with-sudo, --with-sudo=no, "
59PACKAGECONFIG[systemd] = "--with-initscript=systemd,--with-initscript=sysv"
Brad Bishop19323692019-04-05 15:28:33 -040060
Andrew Geissler1fe918a2020-05-15 14:16:47 -050061EXTRA_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 Geissler064f75b2020-06-27 00:14:46 -050068 --without-secrets \
Andrew Geisslercc589282020-09-18 13:34:40 -050069 --with-xml-catalog-path=${STAGING_ETCDIR_NATIVE}/xml/catalog \
Andrew Geisslera1a6aef2021-06-25 14:23:58 -050070 --with-pid-path=/run \
Andrew Geissler1fe918a2020-05-15 14:16:47 -050071"
Brad Bishop19323692019-04-05 15:28:33 -040072
Patrick Williams213cb262021-08-07 19:21:33 -050073do_configure:prepend() {
Brad Bishop19323692019-04-05 15:28:33 -040074 mkdir -p ${AUTOTOOLS_AUXDIR}/build
75 cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/build/
76
77 # libresove has host path, remove it
78 sed -i -e "s#\$sss_extra_libdir##" ${S}/src/external/libresolv.m4
79}
80
Patrick Williams213cb262021-08-07 19:21:33 -050081do_compile:prepend () {
Andrew Geisslera1a6aef2021-06-25 14:23:58 -050082 echo '#define NSUPDATE_PATH "${bindir}"' >> ${B}/config.h
83}
Brad Bishop19323692019-04-05 15:28:33 -040084do_install () {
85 oe_runmake install DESTDIR="${D}"
86 rmdir --ignore-fail-on-non-empty "${D}/${bindir}"
87 install -d ${D}/${sysconfdir}/${BPN}
88 install -m 600 ${WORKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN}
Patrick Williams53961c22022-01-20 11:06:23 -060089
90 # /var/log/sssd needs to be created in runtime. Use rmdir to catch if
91 # upstream stops creating /var/log/sssd, or adds something else in
92 # /var/log.
93 rmdir ${D}${localstatedir}/log/${BPN} ${D}${localstatedir}/log
94 rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
Andrew Geissler1fe918a2020-05-15 14:16:47 -050095
96 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
97 install -d ${D}${sysconfdir}/tmpfiles.d
98 echo "d /var/log/sssd 0750 - - - -" > ${D}${sysconfdir}/tmpfiles.d/sss.conf
99 fi
Brad Bishop19323692019-04-05 15:28:33 -0400100
Patrick Williams53961c22022-01-20 11:06:23 -0600101 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
102 install -d ${D}${sysconfdir}/default/volatiles
103 echo "d ${SSSD_UID}:${SSSD_GID} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
104 fi
105
Andrew Geisslera1a6aef2021-06-25 14:23:58 -0500106 # Remove /run as it is created on startup
107 rm -rf ${D}/run
Brad Bishop19323692019-04-05 15:28:33 -0400108
Andrew Geissler064f75b2020-06-27 00:14:46 -0500109 rm -f ${D}${systemd_system_unitdir}/sssd-secrets.*
Brad Bishop19323692019-04-05 15:28:33 -0400110}
111
Patrick Williams213cb262021-08-07 19:21:33 -0500112pkg_postinst_ontarget:${PN} () {
Brad Bishop19323692019-04-05 15:28:33 -0400113if [ -e /etc/init.d/populate-volatile.sh ] ; then
114 ${sysconfdir}/init.d/populate-volatile.sh update
115fi
116 chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf
117}
118
Patrick Williams53961c22022-01-20 11:06:23 -0600119FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"
120
Patrick Williams213cb262021-08-07 19:21:33 -0500121CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf"
Brad Bishop19323692019-04-05 15:28:33 -0400122
123INITSCRIPT_NAME = "sssd"
124INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
Patrick Williams213cb262021-08-07 19:21:33 -0500125SYSTEMD_SERVICE:${PN} = " \
Andrew Geissler1fe918a2020-05-15 14:16:47 -0500126 ${@bb.utils.contains('PACKAGECONFIG', 'autofs', 'sssd-autofs.service sssd-autofs.socket', '', d)} \
127 ${@bb.utils.contains('PACKAGECONFIG', 'curl', 'sssd-kcm.service sssd-kcm.socket', '', d)} \
128 ${@bb.utils.contains('PACKAGECONFIG', 'infopipe', 'sssd-ifp.service ', '', d)} \
129 ${@bb.utils.contains('PACKAGECONFIG', 'ssh', 'sssd-ssh.service sssd-ssh.socket', '', d)} \
130 ${@bb.utils.contains('PACKAGECONFIG', 'sudo', 'sssd-sudo.service sssd-sudo.socket', '', d)} \
131 sssd-nss.service \
132 sssd-nss.socket \
133 sssd-pam-priv.socket \
134 sssd-pam.service \
135 sssd-pam.socket \
Andrew Geissler1fe918a2020-05-15 14:16:47 -0500136 sssd.service \
137"
Brad Bishop19323692019-04-05 15:28:33 -0400138SYSTEMD_AUTO_ENABLE = "disable"
139
Patrick Williams53961c22022-01-20 11:06:23 -0600140PACKAGES =+ "libsss-sudo"
141ALLOW_EMPTY:libsss-sudo = "1"
Brad Bishop19323692019-04-05 15:28:33 -0400142
Patrick Williams53961c22022-01-20 11:06:23 -0600143FILES:${PN} += "${base_libdir}/security/pam_sss*.so \
144 ${datadir}/dbus-1/system-services/*.service \
145 ${libdir}/krb5/* \
146 ${libdir}/ldb/* \
147 "
148FILES:libsss-sudo = "${libdir}/libsss_sudo.so"
Brad Bishop19323692019-04-05 15:28:33 -0400149
Patrick Williams53961c22022-01-20 11:06:23 -0600150RDEPENDS:${PN} = "bind bind-utils dbus libldb libpam libsss-sudo"