blob: c4b41ace8c80f67a4ce53398ca033abb42a44365 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "Generic client/server library for SASL authentication"
2SECTION = "libs"
3HOMEPAGE = "http://asg.web.cmu.edu/sasl/"
4DEPENDS = "openssl db groff-native"
Brad Bishop2d39a062019-10-28 08:33:36 -04005LICENSE = "BSD-4-Clause"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08006LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396"
7
8SRCREV = "e41cfb986c1b1935770de554872247453fdbb079"
9
10SRC_URI = "git://github.com/cyrusimap/cyrus-sasl;protocol=https \
11 file://avoid-to-call-AC_TRY_RUN.patch \
12 file://Fix-hardcoded-libdir.patch \
13 file://debian_patches_0014_avoid_pic_overwrite.diff \
14 file://saslauthd.service \
15 file://saslauthd.conf \
16 file://0004-configure.ac-fix-condition-for-suppliment-snprintf-i.patch \
17 file://0001-Allow-saslauthd-to-be-built-outside-of-source-tree-w.patch \
18 file://0001-makeinit.sh-fix-parallel-build-issue.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 file://CVE-2019-19906.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080020 "
21
22UPSTREAM_CHECK_URI = "https://github.com/cyrusimap/cyrus-sasl/archives"
23
24S = "${WORKDIR}/git"
25
26inherit autotools pkgconfig useradd systemd
27
28EXTRA_OECONF += "--with-dblib=berkeley \
29 --with-plugindir='${libdir}/sasl2' \
30 andrew_cv_runpath_switch=none"
31
Andrew Geissler72956ed2021-01-08 16:11:14 -060032PACKAGECONFIG ??= "\
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033 ${@bb.utils.filter('DISTRO_FEATURES', 'ldap pam', d)} \
34"
35PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5,"
36PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
37PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie,"
38PACKAGECONFIG[des] = "--with-des,--without-des,,"
39PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap,"
40PACKAGECONFIG[ntlm] = "--enable-ntlm=yes,--enable-ntlm=no,,"
41
42CFLAGS += "-fPIC"
43
44do_configure_prepend () {
45 # make it be able to work with db 5.0 version
46 local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c"
47 for sed_file in $sed_files; do
48 sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' ${S}/$sed_file
49 done
50}
51
52do_compile_prepend () {
53 cd include
54 ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} ${S}/include/makemd5.c -o makemd5
55 touch makemd5.o makemd5.lo makemd5
56 cd ..
57}
58
59do_install_append() {
60 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
61 install -d ${D}${systemd_unitdir}/system
62 install -m 0644 ${WORKDIR}/saslauthd.service ${D}${systemd_unitdir}/system
63
64 sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
65 sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
66 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
67
68 install -d ${D}${sysconfdir}/tmpfiles.d
69 echo "d /run/saslauthd/ - - - -" > ${D}${sysconfdir}/tmpfiles.d/saslauthd.conf
70
71 install -d ${D}${sysconfdir}/default/
72 install -m 0644 ${WORKDIR}/saslauthd.conf ${D}${sysconfdir}/default/saslauthd
73 sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/default/saslauthd
74 fi
75}
76
77USERADD_PACKAGES = "${PN}-bin"
78USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus"
79
80SYSTEMD_PACKAGES = "${PN}-bin"
81SYSTEMD_SERVICE_${PN}-bin = "saslauthd.service"
82SYSTEMD_AUTO_ENABLE = "disable"
83
84SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425"
85SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
86
87PACKAGES =+ "${PN}-bin"
88
89FILES_${PN} += "${libdir}/sasl2/*.so*"
90FILES_${PN}-bin += "${bindir} \
91 ${sysconfdir}/default/saslauthd \
92 ${systemd_unitdir}/system/saslauthd.service \
93 ${sysconfdir}/tmpfiles.d/saslauthd.conf"
94FILES_${PN}-dev += "${libdir}/sasl2/*.la"
95FILES_${PN}-dbg += "${libdir}/sasl2/.debug"
96FILES_${PN}-staticdev += "${libdir}/sasl2/*.a"
97
98INSANE_SKIP_${PN} += "dev-so"
Andrew Geissler69721092021-07-23 12:57:00 -040099
100# CVE-2020-8032 affects only openSUSE
101CVE_CHECK_WHITELIST += "CVE-2020-8032"