blob: 7a6243b10b1f7df18061bee63907b8e3e2617c8c [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
Andrew Geissler595f6302022-01-24 19:11:47 +000010SRC_URI = "git://github.com/cyrusimap/cyrus-sasl;protocol=https;branch=master \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011 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
Patrick Williams213cb262021-08-07 19:21:33 -050044do_configure:prepend () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080045 # 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
Patrick Williams213cb262021-08-07 19:21:33 -050052do_compile:prepend () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080053 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
Patrick Williams213cb262021-08-07 19:21:33 -050059do_install:append() {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080060 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"
Patrick Williams213cb262021-08-07 19:21:33 -050078USERADD_PARAM:${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080079
80SYSTEMD_PACKAGES = "${PN}-bin"
Patrick Williams213cb262021-08-07 19:21:33 -050081SYSTEMD_SERVICE:${PN}-bin = "saslauthd.service"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080082SYSTEMD_AUTO_ENABLE = "disable"
83
84SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425"
85SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
86
87PACKAGES =+ "${PN}-bin"
88
Patrick Williams213cb262021-08-07 19:21:33 -050089FILES:${PN} += "${libdir}/sasl2/*.so*"
90FILES:${PN}-bin += "${bindir} \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080091 ${sysconfdir}/default/saslauthd \
92 ${systemd_unitdir}/system/saslauthd.service \
93 ${sysconfdir}/tmpfiles.d/saslauthd.conf"
Patrick Williams213cb262021-08-07 19:21:33 -050094FILES:${PN}-dev += "${libdir}/sasl2/*.la"
95FILES:${PN}-dbg += "${libdir}/sasl2/.debug"
96FILES:${PN}-staticdev += "${libdir}/sasl2/*.a"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080097
Patrick Williams213cb262021-08-07 19:21:33 -050098INSANE_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"