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.

143 lines
3.5 KiB

  1. #
  2. # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
  3. # Copyright (C) 2009-2016 OpenWrt.org
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=msmtp
  10. PKG_VERSION:=1.6.2
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=@SF/msmtp
  14. PKG_MD5SUM:=3baca93c7e5f1aa9d36a2e5b38739ab9
  15. PKG_LICENSE:=GPL-3.0+
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/nls.mk
  23. define Package/msmtp/Default
  24. SECTION:=mail
  25. CATEGORY:=Mail
  26. DEPENDS:=$(INTL_DEPENDS)
  27. TITLE:=Simple sendmail SMTP forwarding
  28. URL:=http://msmtp.sourceforge.net/
  29. endef
  30. define Package/msmtp/Default/description
  31. msmtp is an SMTP client. In the default mode, it transmits a mail to
  32. an SMTP server (for example at a free mail provider) which does the
  33. delivery. To use this program with your mail user agent (MUA), create
  34. a configuration file with your mail account(s) and tell your MUA to
  35. call msmtp instead of /usr/sbin/sendmail.
  36. endef
  37. define Package/msmtp
  38. $(call Package/msmtp/Default)
  39. DEPENDS+= +libopenssl +ca-bundle
  40. TITLE+= (with SSL support)
  41. VARIANT:=ssl
  42. endef
  43. define Package/msmtp/conffiles
  44. /etc/msmtprc
  45. endef
  46. define Package/msmtp/description
  47. $(call Package/msmtp/Default/description)
  48. This package is built with SSL support.
  49. endef
  50. define Package/msmtp-nossl
  51. $(call Package/msmtp/Default)
  52. TITLE+= (without SSL support)
  53. VARIANT:=nossl
  54. endef
  55. define Package/msmtp-nossl/description
  56. $(call Package/msmtp/Default/description)
  57. This package is built without SSL support.
  58. endef
  59. define Package/msmtp-queue
  60. $(call Package/msmtp/Default)
  61. DEPENDS+= +bash
  62. TITLE+= (queue scripts)
  63. endef
  64. define Package/msmtp-queue/description
  65. $(call Package/msmtp/Default/description)
  66. This package contains the msmtp queue scripts.
  67. endef
  68. CONFIGURE_ARGS += \
  69. --disable-rpath \
  70. --without-libintl-prefix \
  71. --without-libgsasl \
  72. --without-libidn \
  73. --without-libsecret \
  74. --without-macosx-keyring \
  75. ifneq ($(CONFIG_USE_UCLIBC),)
  76. CONFIGURE_ARGS += --disable-gai-idn
  77. endif
  78. MAKE_FLAGS :=
  79. ifeq ($(BUILD_VARIANT),ssl)
  80. CONFIGURE_ARGS += \
  81. --with-tls=openssl
  82. endif
  83. ifeq ($(BUILD_VARIANT),nossl)
  84. CONFIGURE_ARGS += \
  85. --with-tls=no
  86. endif
  87. define Package/msmtp/install
  88. $(INSTALL_DIR) $(1)/etc
  89. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
  90. $(1)/etc/msmtprc
  91. $(INSTALL_DIR) $(1)/usr/bin
  92. $(CP) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/
  93. endef
  94. define Package/msmtp/postinst
  95. [ -e $${IPKG_INSTROOT}/usr/sbin/sendmail ] || {
  96. mkdir -p $${IPKG_INSTROOT}/usr/sbin
  97. ln -sf ../bin/msmtp $${IPKG_INSTROOT}/usr/sbin/sendmail
  98. }
  99. endef
  100. define Package/msmtp/prerm
  101. [ "../bin/msmtp" = "$(readlink -qs $${IPKG_INSTROOT}/usr/sbin/sendmail)" ] && {
  102. rm -f $${IPKG_INSTROOT}/usr/sbin/sendmail
  103. }
  104. endef
  105. Package/msmtp-nossl/conffiles = $(Package/msmtp/conffiles)
  106. Package/msmtp-nossl/install = $(Package/msmtp/install)
  107. Package/msmtp-nossl/postinst = $(Package/msmtp/postinst)
  108. Package/msmtp-nossl/prerm = $(Package/msmtp/prerm)
  109. define Package/msmtp-queue/install
  110. $(INSTALL_DIR) $(1)/usr/bin
  111. $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpq/msmtp{q,-queue} $(1)/usr/bin/
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpqueue/msmtp-{en,list,run}queue.sh $(1)/usr/bin/
  113. endef
  114. $(eval $(call BuildPackage,msmtp))
  115. $(eval $(call BuildPackage,msmtp-nossl))
  116. $(eval $(call BuildPackage,msmtp-queue))