blob: e344733ef4c2d0a0173a1165eed135fc73eeba03 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "Generic client/server library for SASL authentication"
2SECTION = "libs"
3HOMEPAGE = "http://asg.web.cmu.edu/sasl/"
4DEPENDS = "openssl db groff-native"
5LICENSE = "BSD-4-Clause"
6LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396"
7
8SRCREV = "7a6b45b177070198fed0682bea5fa87c18abb084"
9
10SRC_URI = "git://github.com/cyrusimap/cyrus-sasl;protocol=https;branch=cyrus-sasl-2.1 \
11 file://avoid-to-call-AC_TRY_RUN.patch \
12 file://debian_patches_0014_avoid_pic_overwrite.diff \
13 file://0001-sample-Rename-dprintf-to-cyrus_dprintf.patch \
14 file://saslauthd.service \
15 file://saslauthd.conf \
16 file://CVE-2019-19906.patch \
Andrew Geissler615f2f12022-07-15 14:00:58 -050017 file://CVE-2022-24407.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000018 "
19
20UPSTREAM_CHECK_URI = "https://github.com/cyrusimap/cyrus-sasl/archives"
21
22S = "${WORKDIR}/git"
23
24inherit autotools pkgconfig useradd systemd
25
26EXTRA_OECONF += "--with-dblib=berkeley \
27 --with-plugindir='${libdir}/sasl2' \
28 andrew_cv_runpath_switch=none"
29
30PACKAGECONFIG ??= "\
31 ${@bb.utils.filter('DISTRO_FEATURES', 'ldap pam', d)} \
32"
33PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5,"
34PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
35PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie,"
36PACKAGECONFIG[des] = "--with-des,--without-des,,"
37PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap,"
38PACKAGECONFIG[ntlm] = "--enable-ntlm=yes,--enable-ntlm=no,,"
39
40CFLAGS += "-fPIC"
41
42do_configure:prepend () {
43 # make it be able to work with db 5.0 version
44 local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c"
45 for sed_file in $sed_files; do
46 sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' ${S}/$sed_file
47 done
48}
49
50do_compile:prepend () {
51 cd include
52 ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} ${S}/include/makemd5.c -o makemd5
53 touch makemd5.o makemd5.lo makemd5
54 cd ..
55}
56
57do_install:append() {
58 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
59 install -d ${D}${systemd_unitdir}/system
60 install -m 0644 ${WORKDIR}/saslauthd.service ${D}${systemd_unitdir}/system
61
62 sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
63 sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
64 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
65
66 install -d ${D}${sysconfdir}/tmpfiles.d
67 echo "d /run/saslauthd/ - - - -" > ${D}${sysconfdir}/tmpfiles.d/saslauthd.conf
68
69 install -d ${D}${sysconfdir}/default/
70 install -m 0644 ${WORKDIR}/saslauthd.conf ${D}${sysconfdir}/default/saslauthd
71 sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/default/saslauthd
72 fi
73}
74
75USERADD_PACKAGES = "${PN}-bin"
76USERADD_PARAM:${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus"
77
78SYSTEMD_PACKAGES = "${PN}-bin"
79SYSTEMD_SERVICE:${PN}-bin = "saslauthd.service"
80SYSTEMD_AUTO_ENABLE = "disable"
81
82SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425"
83SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
84
85PACKAGES =+ "${PN}-bin"
86
87FILES:${PN} += "${libdir}/sasl2/*.so*"
88FILES:${PN}-bin += "${bindir} \
89 ${sysconfdir}/default/saslauthd \
90 ${systemd_unitdir}/system/saslauthd.service \
91 ${sysconfdir}/tmpfiles.d/saslauthd.conf"
92FILES:${PN}-dev += "${libdir}/sasl2/*.la"
93FILES:${PN}-dbg += "${libdir}/sasl2/.debug"
94FILES:${PN}-staticdev += "${libdir}/sasl2/*.a"
95
96INSANE_SKIP:${PN} += "dev-so"
97
98# CVE-2020-8032 affects only openSUSE
99CVE_CHECK_IGNORE += "CVE-2020-8032"