You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
5.1 KiB

dovecot: Fix managesieve-login needs libdovecot-login When trying to use managesieve my MUA complained sieve wasn't supported. On investigation dovecot logs the following could be seen: Aug 16 00:28:44 managesieve-login: Fatal: master: service(managesieve-login): child 1430 returned error 127 Aug 16 00:31:32 managesieve-login: Error: Error loading shared library libdovecot-login.so.0: No such file or directory (needed by /usr/lib/dovecot/managesieve-login) Aug 16 00:31:32 managesieve-login: Error: Error loading shared library libdovecot.so.0: No such file or directory (needed by /usr/lib/dovecot/managesieve-login) Aug 16 00:31:32 managesieve-login: Error: Error relocating /usr/lib/dovecot/managesieve-login: net_ip2addr: symbol not found The issue (verified with readelf on non-working build and build with my fix) is that there is no RPATH information in the pigeonhole binaries (like managesieve-login). The dovecot-config that is 'installed' in the staging dir assumes that plugins will be built on the same host as the installed files. The 'installed' dovecot-config (partial) looks like: LIBDOVECOT='-L/usr/lib/dovecot -ldovecot' LIBDOVECOT_LOGIN='-ldovecot-login -L/home/user/Build/openwrt/openwrt-ath79/staging_dir/target-mips_24kc_musl/usr/lib -lssl -lcrypto' LIBDOVECOT_SQL=-ldovecot-sql LIBDOVECOT_COMPRESS=-ldovecot-compression LIBDOVECOT_LDA=-ldovecot-lda LIBDOVECOT_STORAGE='-ldovecot-storage ' LIBDOVECOT_DSYNC=-ldovecot-dsync LIBDOVECOT_LIBFTS=-ldovecot-fts The solution I used was to modify dovecot-config to add the rpath to DOVECOT_BINARY_LDFLAGS, and to replace references to host directories with staging_dir directories. This results in RPATH being added as it needs to be, and results in a working version of dovecot+pigeonhole. NB: I've also touched package version of pigeonhole as this change in dovecot results in (needed) binary changes for pigeonhole. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
  1. #
  2. # Copyright (C) 2006-2018 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=dovecot
  9. PKG_VERSION:=2.3.2.1
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://www.dovecot.org/releases/2.3
  13. PKG_HASH:=4a65118508dc7a562e5f90dd7c3f56219fff22367c496f17d77cd0c7e2724e34
  14. PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
  15. PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
  16. PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
  17. PKG_BUILD_DEPENDS:=libiconv
  18. PKG_CONFIG_DEPENDS:= \
  19. CONFIG_DOVECOT_GSSAPI \
  20. CONFIG_DOVECOT_LDAP \
  21. CONFIG_DOVECOT_MYSQL \
  22. CONFIG_DOVECOT_PGSQL \
  23. CONFIG_DOVECOT_SQLITE \
  24. CONFIG_DOVECOT_ICU
  25. PKG_FIXUP:=autoreconf
  26. PKG_INSTALL:=1
  27. include $(INCLUDE_DIR)/package.mk
  28. # iconv is needed when compiling with MySQL support. iconv will also be used by
  29. # dovecot itself.
  30. include $(INCLUDE_DIR)/nls.mk
  31. define Package/dovecot
  32. SECTION:=mail
  33. CATEGORY:=Mail
  34. DEPENDS:=+DOVECOT_GSSAPI:krb5-libs +DOVECOT_LDAP:libopenldap +DOVECOT_MYSQL:libmysqlclient +DOVECOT_PGSQL:libpq +DOVECOT_SQLITE:libsqlite3 +libopenssl +librt +zlib +libbz2 +libcap +DOVECOT_ICU:icu $(ICONV_DEPENDS)
  35. TITLE:=An IMAP and POP3 daemon
  36. URL:=https://www.dovecot.org/
  37. USERID:=dovecot=59:dovecot=59
  38. ABI_VERSION:=$(PKG_VERSION)
  39. endef
  40. define Package/dovecot/description
  41. Dovecot is a program which provides POP3 and IMAP services.
  42. endef
  43. define Package/dovecot/config
  44. menu "Select dovecot build options"
  45. depends on PACKAGE_dovecot
  46. config DOVECOT_GSSAPI
  47. bool "GSSAPI support"
  48. default n
  49. help
  50. Implements GSSAPI support in dovecot.
  51. config DOVECOT_LDAP
  52. bool "LDAP support"
  53. default n
  54. help
  55. Implements LDAP support in dovecot.
  56. config DOVECOT_MYSQL
  57. bool "MYSQL support"
  58. default n
  59. help
  60. Implements MYSQL support in dovecot.
  61. config DOVECOT_PGSQL
  62. bool "PostgreSQL support"
  63. default n
  64. help
  65. Implements PostgreSQL support in dovecot.
  66. config DOVECOT_SQLITE
  67. bool "SQLite support"
  68. default n
  69. help
  70. Implements SQLite DB support in dovecot.
  71. config DOVECOT_ICU
  72. bool "Enable i18n features"
  73. default n
  74. help
  75. Enable ICU (International Components for Unicode) support.
  76. endmenu
  77. endef
  78. define Package/dovecot/conffiles
  79. /etc/init.d/dovecot
  80. /etc/dovecot/
  81. endef
  82. define Package/dovecot-utils
  83. SECTION:=mail
  84. CATEGORY:=Mail
  85. DEPENDS:=+dovecot
  86. TITLE:=doveadm and dsync utilities for Dovecot
  87. endef
  88. CONFIGURE_ARGS += \
  89. --libexecdir=/usr/libexec \
  90. --without-pam \
  91. --with-notify=dnotify \
  92. --without-lzma \
  93. --without-lz4 \
  94. --without-sodium \
  95. $(if $(CONFIG_DOVECOT_GSSAPI),--with-gssapi=yes,--with-gssapi=no) \
  96. $(if $(CONFIG_DOVECOT_LDAP),--with-ldap=yes,--with-ldap=no) \
  97. $(if $(CONFIG_DOVECOT_MYSQL),--with-mysql=yes,--with-mysql=no) \
  98. $(if $(CONFIG_DOVECOT_PGSQL),--with-pgsql=yes,--with-pgsql=no) \
  99. $(if $(CONFIG_DOVECOT_SQLITE),--with-sqlite=yes,--with-sqlite=no) \
  100. $(if $(CONFIG_DOVECOT_ICU),--with-icu=yes,--with-icu=no)
  101. CONFIGURE_VARS += \
  102. RPCGEN= \
  103. i_cv_signed_size_t=no \
  104. i_cv_signed_time_t=no \
  105. i_cv_gmtime_max_time_t=32 \
  106. i_cv_mmap_plays_with_write=yes \
  107. i_cv_fd_passing=yes \
  108. i_cv_c99_vsnprintf=yes \
  109. lib_cv_va_copy=yes \
  110. lib_cv_va_copy=yes \
  111. lib_cv___va_copy=yes \
  112. lib_cv_va_val_copy=yes
  113. define Build/InstallDev
  114. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
  115. $(CP) $(PKG_INSTALL_DIR)/usr/include/dovecot $(1)/usr/include/
  116. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot $(1)/usr/lib/
  117. rm -f $(1)/usr/lib/dovecot/*.la
  118. endef
  119. define Package/dovecot/install
  120. $(INSTALL_DIR) $(1)/etc/init.d \
  121. $(1)/etc/dovecot \
  122. $(1)/usr/share/doc/dovecot \
  123. $(1)/usr/lib/dovecot \
  124. $(1)/usr/libexec/dovecot \
  125. $(1)/usr/bin \
  126. $(1)/usr/sbin
  127. $(CP) $(PKG_INSTALL_DIR)/etc/dovecot/* $(1)/etc/dovecot/
  128. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
  129. $(CP) $(PKG_INSTALL_DIR)/usr/libexec/dovecot/* $(1)/usr/libexec/dovecot/
  130. $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/dovecot/example-config $(1)/usr/share/doc/dovecot/
  131. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveconf $(1)/usr/bin/
  132. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  133. $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot
  134. rm $(1)/usr/lib/dovecot/dovecot-config
  135. find $(1)/usr/lib/dovecot/ -name "*.a" -o -name "*.la" | xargs rm
  136. endef
  137. define Package/dovecot-utils/install
  138. $(INSTALL_DIR) $(1)/usr/bin
  139. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveadm $(1)/usr/bin/
  140. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dsync $(1)/usr/bin/
  141. endef
  142. $(eval $(call BuildPackage,dovecot))
  143. $(eval $(call BuildPackage,dovecot-utils))