blob: 98899dfd5e587d3238e445100ff726095af657d9 [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 \
17 "
18
19UPSTREAM_CHECK_URI = "https://github.com/cyrusimap/cyrus-sasl/archives"
20
21S = "${WORKDIR}/git"
22
23inherit autotools pkgconfig useradd systemd
24
25EXTRA_OECONF += "--with-dblib=berkeley \
26 --with-plugindir='${libdir}/sasl2' \
27 andrew_cv_runpath_switch=none"
28
29PACKAGECONFIG ??= "\
30 ${@bb.utils.filter('DISTRO_FEATURES', 'ldap pam', d)} \
31"
32PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5,"
33PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
34PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie,"
35PACKAGECONFIG[des] = "--with-des,--without-des,,"
36PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap,"
37PACKAGECONFIG[ntlm] = "--enable-ntlm=yes,--enable-ntlm=no,,"
38
39CFLAGS += "-fPIC"
40
41do_configure:prepend () {
42 # make it be able to work with db 5.0 version
43 local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c"
44 for sed_file in $sed_files; do
45 sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' ${S}/$sed_file
46 done
47}
48
49do_compile:prepend () {
50 cd include
51 ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} ${S}/include/makemd5.c -o makemd5
52 touch makemd5.o makemd5.lo makemd5
53 cd ..
54}
55
56do_install:append() {
57 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
58 install -d ${D}${systemd_unitdir}/system
59 install -m 0644 ${WORKDIR}/saslauthd.service ${D}${systemd_unitdir}/system
60
61 sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
62 sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
63 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
64
65 install -d ${D}${sysconfdir}/tmpfiles.d
66 echo "d /run/saslauthd/ - - - -" > ${D}${sysconfdir}/tmpfiles.d/saslauthd.conf
67
68 install -d ${D}${sysconfdir}/default/
69 install -m 0644 ${WORKDIR}/saslauthd.conf ${D}${sysconfdir}/default/saslauthd
70 sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/default/saslauthd
71 fi
72}
73
74USERADD_PACKAGES = "${PN}-bin"
75USERADD_PARAM:${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus"
76
77SYSTEMD_PACKAGES = "${PN}-bin"
78SYSTEMD_SERVICE:${PN}-bin = "saslauthd.service"
79SYSTEMD_AUTO_ENABLE = "disable"
80
81SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425"
82SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
83
84PACKAGES =+ "${PN}-bin"
85
86FILES:${PN} += "${libdir}/sasl2/*.so*"
87FILES:${PN}-bin += "${bindir} \
88 ${sysconfdir}/default/saslauthd \
89 ${systemd_unitdir}/system/saslauthd.service \
90 ${sysconfdir}/tmpfiles.d/saslauthd.conf"
91FILES:${PN}-dev += "${libdir}/sasl2/*.la"
92FILES:${PN}-dbg += "${libdir}/sasl2/.debug"
93FILES:${PN}-staticdev += "${libdir}/sasl2/*.a"
94
95INSANE_SKIP:${PN} += "dev-so"
96
97# CVE-2020-8032 affects only openSUSE
98CVE_CHECK_IGNORE += "CVE-2020-8032"