dovecot.mk 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. ################################################################################
  2. #
  3. # dovecot
  4. #
  5. ################################################################################
  6. DOVECOT_VERSION_MAJOR = 2.3
  7. DOVECOT_VERSION = $(DOVECOT_VERSION_MAJOR).21.1
  8. DOVECOT_SITE = https://dovecot.org/releases/$(DOVECOT_VERSION_MAJOR)
  9. DOVECOT_INSTALL_STAGING = YES
  10. DOVECOT_LICENSE = LGPL-2.1, MIT, Public Domain, BSD-3-Clause, Unicode-DFS-2015
  11. DOVECOT_LICENSE_FILES = COPYING COPYING.LGPL COPYING.MIT
  12. DOVECOT_CPE_ID_VENDOR = dovecot
  13. DOVECOT_SELINUX_MODULES = dovecot
  14. DOVECOT_AUTORECONF = YES
  15. # add host-gettext for AM_ICONV macro needed for autoreconf
  16. DOVECOT_DEPENDENCIES = \
  17. host-gettext \
  18. host-pkgconf \
  19. $(if $(BR2_PACKAGE_LIBICONV),libiconv) \
  20. openssl
  21. # CVE-2016-4983 is an issue in a postinstall script in the dovecot rpm, which
  22. # is part of the Red Hat packaging and not part of upstream dovecot
  23. DOVECOT_IGNORE_CVES += CVE-2016-4983
  24. # 0001-auth-Fix-handling-passdbs-with-identical-driver-args.patch
  25. # Note: this ignore CVE entry is reported as stale by pkg-stats, but
  26. # the NVD database is incorrect:
  27. # https://lore.kernel.org/buildroot/20250517181815.02ce0393@windsurf/
  28. DOVECOT_IGNORE_CVES += CVE-2022-30550
  29. DOVECOT_CONF_ENV = \
  30. RPCGEN=__disable_RPCGEN_rquota \
  31. i_cv_epoll_works=yes \
  32. i_cv_inotify_works=yes \
  33. i_cv_posix_fallocate_works=no \
  34. i_cv_signed_size_t=no \
  35. i_cv_gmtime_max_time_t=32 \
  36. i_cv_signed_time_t=yes \
  37. i_cv_mmap_plays_with_write=yes \
  38. i_cv_fd_passing=yes \
  39. i_cv_c99_vsnprintf=yes \
  40. lib_cv_va_copy=yes \
  41. lib_cv___va_copy=yes \
  42. lib_cv_va_val_copy=yes
  43. DOVECOT_CONF_OPTS = --without-docs --with-ssl=openssl
  44. ifeq ($(BR2_PACKAGE_DOVECOT_MYSQL)$(BR2_PACKAGE_DOVECOT_SQLITE),)
  45. DOVECOT_CONF_OPTS += --without-sql
  46. endif
  47. ifeq ($(BR2_PACKAGE_BZIP2),y)
  48. DOVECOT_CONF_OPTS += --with-bzlib
  49. DOVECOT_DEPENDENCIES += bzip2
  50. else
  51. DOVECOT_CONF_OPTS += --without-bzlib
  52. endif
  53. ifeq ($(BR2_PACKAGE_ICU),y)
  54. DOVECOT_CONF_OPTS += --with-icu
  55. DOVECOT_DEPENDENCIES += icu
  56. else
  57. DOVECOT_CONF_OPTS += --without-icu
  58. endif
  59. ifeq ($(BR2_PACKAGE_LIBCAP),y)
  60. DOVECOT_CONF_OPTS += --with-libcap
  61. DOVECOT_DEPENDENCIES += libcap
  62. else
  63. DOVECOT_CONF_OPTS += --without-libcap
  64. endif
  65. ifeq ($(BR2_PACKAGE_LIBSODIUM),y)
  66. DOVECOT_CONF_OPTS += --with-sodium
  67. DOVECOT_DEPENDENCIES += libsodium
  68. else
  69. DOVECOT_CONF_OPTS += --without-sodium
  70. endif
  71. ifeq ($(BR2_PACKAGE_LIBXCRYPT),y)
  72. DOVECOT_DEPENDENCIES += libxcrypt
  73. endif
  74. ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
  75. DOVECOT_CONF_OPTS += --with-pam
  76. DOVECOT_DEPENDENCIES += linux-pam
  77. else
  78. DOVECOT_CONF_OPTS += --without-pam
  79. endif
  80. ifeq ($(BR2_PACKAGE_DOVECOT_MYSQL),y)
  81. DOVECOT_CONF_ENV += MYSQL_CONFIG="$(STAGING_DIR)/usr/bin/mysql_config"
  82. DOVECOT_CONF_OPTS += --with-mysql
  83. DOVECOT_DEPENDENCIES += mariadb
  84. else
  85. DOVECOT_CONF_OPTS += --without-mysql
  86. endif
  87. ifeq ($(BR2_PACKAGE_DOVECOT_SQLITE),y)
  88. DOVECOT_CONF_OPTS += --with-sqlite
  89. DOVECOT_DEPENDENCIES += sqlite
  90. else
  91. DOVECOT_CONF_OPTS += --without-sqlite
  92. endif
  93. ifeq ($(BR2_PACKAGE_LZ4),y)
  94. DOVECOT_CONF_OPTS += --with-lz4
  95. DOVECOT_DEPENDENCIES += lz4
  96. else
  97. DOVECOT_CONF_OPTS += --without-lz4
  98. endif
  99. ifeq ($(BR2_PACKAGE_XZ),y)
  100. DOVECOT_CONF_OPTS += --with-lzma
  101. DOVECOT_DEPENDENCIES += xz
  102. else
  103. DOVECOT_CONF_OPTS += --without-lzma
  104. endif
  105. ifeq ($(BR2_PACKAGE_ZLIB),y)
  106. DOVECOT_CONF_OPTS += --with-zlib
  107. DOVECOT_DEPENDENCIES += zlib
  108. else
  109. DOVECOT_CONF_OPTS += --without-zlib
  110. endif
  111. # fix paths to avoid using /usr/lib/dovecot
  112. define DOVECOT_POST_CONFIGURE
  113. for i in $$(find $(@D) -name "Makefile"); do \
  114. $(SED) 's%^pkglibdir =.*%pkglibdir = \$$(libdir)%' $$i; \
  115. $(SED) 's%^pkglibexecdir =.*%pkglibexecdir = \$$(libexecdir)%' $$i; \
  116. done
  117. endef
  118. DOVECOT_POST_CONFIGURE_HOOKS += DOVECOT_POST_CONFIGURE
  119. # dovecot installs dovecot-config in usr/lib/, therefore
  120. # DOVECOT_CONFIG_SCRIPTS can not be used to rewrite paths
  121. define DOVECOT_FIX_STAGING_DOVECOT_CONFIG
  122. $(SED) 's,^LIBDOVECOT_INCLUDE=.*$$,LIBDOVECOT_INCLUDE=\"-I$(STAGING_DIR)/usr/include/dovecot\",' $(STAGING_DIR)/usr/lib/dovecot-config
  123. $(SED) 's,^LIBDOVECOT=.*$$,LIBDOVECOT=\"-L$(STAGING_DIR)/usr/lib -ldovecot\",' $(STAGING_DIR)/usr/lib/dovecot-config
  124. endef
  125. DOVECOT_POST_INSTALL_STAGING_HOOKS += DOVECOT_FIX_STAGING_DOVECOT_CONFIG
  126. $(eval $(autotools-package))