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.

136 lines
3.3 KiB

  1. #
  2. # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
  3. # Copyright (C) 2009-2015 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.1
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=@SF/msmtp
  14. PKG_MD5SUM:=6ebba4809bbc665b8a665a018d1a5ee1
  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. define Package/msmtp/Default
  23. SECTION:=mail
  24. CATEGORY:=Mail
  25. TITLE:=Simple sendmail SMTP forwarding
  26. URL:=http://msmtp.sourceforge.net/
  27. endef
  28. define Package/msmtp/Default/description
  29. msmtp is an SMTP client. In the default mode, it transmits a mail to
  30. an SMTP server (for example at a free mail provider) which does the
  31. delivery. To use this program with your mail user agent (MUA), create
  32. a configuration file with your mail account(s) and tell your MUA to
  33. call msmtp instead of /usr/sbin/sendmail.
  34. endef
  35. define Package/msmtp
  36. $(call Package/msmtp/Default)
  37. DEPENDS+= +libopenssl
  38. TITLE+= (with SSL support)
  39. VARIANT:=ssl
  40. endef
  41. define Package/msmtp/conffiles
  42. /etc/msmtprc
  43. endef
  44. define Package/msmtp/description
  45. $(call Package/msmtp/Default/description)
  46. This package is built with SSL support.
  47. endef
  48. define Package/msmtp-nossl
  49. $(call Package/msmtp/Default)
  50. TITLE+= (without SSL support)
  51. VARIANT:=nossl
  52. endef
  53. define Package/msmtp-nossl/description
  54. $(call Package/msmtp/Default/description)
  55. This package is built without SSL support.
  56. endef
  57. define Package/msmtp-queue
  58. $(call Package/msmtp/Default)
  59. DEPENDS+= +bash
  60. TITLE+= (queue scripts)
  61. endef
  62. define Package/msmtp-queue/description
  63. $(call Package/msmtp/Default/description)
  64. This package contains the msmtp queue scripts.
  65. endef
  66. CONFIGURE_ARGS += \
  67. --disable-rpath \
  68. --without-libintl-prefix \
  69. --without-libgsasl \
  70. --without-libidn \
  71. --without-gnome-keyring \
  72. --without-macosx-keyring \
  73. MAKE_FLAGS :=
  74. ifeq ($(BUILD_VARIANT),ssl)
  75. CONFIGURE_ARGS += \
  76. --with-ssl=openssl
  77. endif
  78. ifeq ($(BUILD_VARIANT),nossl)
  79. CONFIGURE_ARGS += \
  80. --with-ssl=no
  81. endif
  82. define Package/msmtp/install
  83. $(INSTALL_DIR) $(1)/etc
  84. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
  85. $(1)/etc/msmtprc
  86. $(INSTALL_DIR) $(1)/usr/bin
  87. $(CP) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/
  88. endef
  89. define Package/msmtp/postinst
  90. [ -e $${IPKG_INSTROOT}/usr/sbin/sendmail ] || {
  91. mkdir -p $${IPKG_INSTROOT}/usr/sbin
  92. ln -sf ../bin/msmtp $${IPKG_INSTROOT}/usr/sbin/sendmail
  93. }
  94. endef
  95. define Package/msmtp/prerm
  96. [ "../bin/msmtp" = "$(readlink -qs $${IPKG_INSTROOT}/usr/sbin/sendmail)" ] && {
  97. rm -f $${IPKG_INSTROOT}/usr/sbin/sendmail
  98. }
  99. endef
  100. Package/msmtp-nossl/conffiles = $(Package/msmtp/conffiles)
  101. Package/msmtp-nossl/install = $(Package/msmtp/install)
  102. Package/msmtp-nossl/postinst = $(Package/msmtp/postinst)
  103. define Package/msmtp-queue/install
  104. $(INSTALL_DIR) $(1)/usr/bin
  105. $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpq/msmtp{q,-queue} $(1)/usr/bin/
  106. $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpqueue/msmtp-{en,list,run}queue.sh $(1)/usr/bin/
  107. endef
  108. $(eval $(call BuildPackage,msmtp))
  109. $(eval $(call BuildPackage,msmtp-nossl))
  110. $(eval $(call BuildPackage,msmtp-queue))