Без опису

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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.2
  11. PKG_RELEASE:=1
  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. 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-libsecret \
  72. --without-macosx-keyring \
  73. ifneq ($(CONFIG_USE_UCLIBC),)
  74. CONFIGURE_ARGS += --disable-gai-idn
  75. endif
  76. MAKE_FLAGS :=
  77. ifeq ($(BUILD_VARIANT),ssl)
  78. CONFIGURE_ARGS += \
  79. --with-tls=openssl
  80. endif
  81. ifeq ($(BUILD_VARIANT),nossl)
  82. CONFIGURE_ARGS += \
  83. --with-tls=no
  84. endif
  85. define Package/msmtp/install
  86. $(INSTALL_DIR) $(1)/etc
  87. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
  88. $(1)/etc/msmtprc
  89. $(INSTALL_DIR) $(1)/usr/bin
  90. $(CP) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/
  91. endef
  92. define Package/msmtp/postinst
  93. [ -e $${IPKG_INSTROOT}/usr/sbin/sendmail ] || {
  94. mkdir -p $${IPKG_INSTROOT}/usr/sbin
  95. ln -sf ../bin/msmtp $${IPKG_INSTROOT}/usr/sbin/sendmail
  96. }
  97. endef
  98. define Package/msmtp/prerm
  99. [ "../bin/msmtp" = "$(readlink -qs $${IPKG_INSTROOT}/usr/sbin/sendmail)" ] && {
  100. rm -f $${IPKG_INSTROOT}/usr/sbin/sendmail
  101. }
  102. endef
  103. Package/msmtp-nossl/conffiles = $(Package/msmtp/conffiles)
  104. Package/msmtp-nossl/install = $(Package/msmtp/install)
  105. Package/msmtp-nossl/postinst = $(Package/msmtp/postinst)
  106. Package/msmtp-nossl/prerm = $(Package/msmtp/prerm)
  107. define Package/msmtp-queue/install
  108. $(INSTALL_DIR) $(1)/usr/bin
  109. $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpq/msmtp{q,-queue} $(1)/usr/bin/
  110. $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpqueue/msmtp-{en,list,run}queue.sh $(1)/usr/bin/
  111. endef
  112. $(eval $(call BuildPackage,msmtp))
  113. $(eval $(call BuildPackage,msmtp-nossl))
  114. $(eval $(call BuildPackage,msmtp-queue))