blob: 76d6e03e9b8849613b333d4ca7b5dbe8002df402 [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"
5LICENSE = "GPLv3+"
6LIC_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}
Andrew Geissler1fe918a2020-05-15 14:16:47 -050089 install -D -m 644 ${WORKDIR}/volatiles.99_sssd ${D}/${sysconfdir}/default/volatiles/99_sssd
90
91 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
92 install -d ${D}${sysconfdir}/tmpfiles.d
93 echo "d /var/log/sssd 0750 - - - -" > ${D}${sysconfdir}/tmpfiles.d/sss.conf
94 fi
Brad Bishop19323692019-04-05 15:28:33 -040095
Andrew Geisslera1a6aef2021-06-25 14:23:58 -050096 # Remove /run as it is created on startup
97 rm -rf ${D}/run
Brad Bishop19323692019-04-05 15:28:33 -040098
Andrew Geissler064f75b2020-06-27 00:14:46 -050099 rm -f ${D}${systemd_system_unitdir}/sssd-secrets.*
Brad Bishop19323692019-04-05 15:28:33 -0400100}
101
Patrick Williams213cb262021-08-07 19:21:33 -0500102pkg_postinst_ontarget:${PN} () {
Brad Bishop19323692019-04-05 15:28:33 -0400103if [ -e /etc/init.d/populate-volatile.sh ] ; then
104 ${sysconfdir}/init.d/populate-volatile.sh update
105fi
106 chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf
107}
108
Patrick Williams213cb262021-08-07 19:21:33 -0500109CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf"
Brad Bishop19323692019-04-05 15:28:33 -0400110
111INITSCRIPT_NAME = "sssd"
112INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
Patrick Williams213cb262021-08-07 19:21:33 -0500113SYSTEMD_SERVICE:${PN} = " \
Andrew Geissler1fe918a2020-05-15 14:16:47 -0500114 ${@bb.utils.contains('PACKAGECONFIG', 'autofs', 'sssd-autofs.service sssd-autofs.socket', '', d)} \
115 ${@bb.utils.contains('PACKAGECONFIG', 'curl', 'sssd-kcm.service sssd-kcm.socket', '', d)} \
116 ${@bb.utils.contains('PACKAGECONFIG', 'infopipe', 'sssd-ifp.service ', '', d)} \
117 ${@bb.utils.contains('PACKAGECONFIG', 'ssh', 'sssd-ssh.service sssd-ssh.socket', '', d)} \
118 ${@bb.utils.contains('PACKAGECONFIG', 'sudo', 'sssd-sudo.service sssd-sudo.socket', '', d)} \
119 sssd-nss.service \
120 sssd-nss.socket \
121 sssd-pam-priv.socket \
122 sssd-pam.service \
123 sssd-pam.socket \
Andrew Geissler1fe918a2020-05-15 14:16:47 -0500124 sssd.service \
125"
Brad Bishop19323692019-04-05 15:28:33 -0400126SYSTEMD_AUTO_ENABLE = "disable"
127
Patrick Williams213cb262021-08-07 19:21:33 -0500128FILES:${PN} += "${libdir} ${datadir} ${base_libdir}/security/pam_sss*.so"
129FILES:${PN}-dev = " ${includedir}/* ${libdir}/*la ${libdir}/*/*la"
Brad Bishop19323692019-04-05 15:28:33 -0400130
131# The package contains symlinks that trip up insane
Patrick Williams213cb262021-08-07 19:21:33 -0500132INSANE_SKIP:${PN} = "dev-so"
Brad Bishop19323692019-04-05 15:28:33 -0400133
Patrick Williams213cb262021-08-07 19:21:33 -0500134RDEPENDS:${PN} = "bind bind-utils dbus libldb libpam"