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
4.9 KiB

  1. #
  2. # Copyright (C) 2017 Val Kulkov <val.kulkov@gmail.com>
  3. #
  4. # This is free software, licensed under the GNU General Public License v3.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=sendmail
  8. PKG_VERSION:=8.15.2
  9. PKG_RELEASE:=3
  10. PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tar.gz
  11. PKG_SOURCE_URL:=http://artfiles.org/sendmail.org/pub/sendmail/ \
  12. ftp://ftp.cs.berkeley.edu/ucb/sendmail/ \
  13. http://www.netgull.com/sendmail/
  14. PKG_HASH:=24f94b5fd76705f15897a78932a5f2439a32b1a2fdc35769bb1a5f5d9b4db439
  15. PKG_MAINTAINER:=Val Kulkov <val.kulkov@gmail.com>
  16. PKG_LICENSE:=Sendmail
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_CPE_ID:=cpe:/a:sendmail:sendmail
  19. PKG_INSTALL:=1
  20. PKG_BUILD_DEPENDS:=openssl
  21. include $(INCLUDE_DIR)/package.mk
  22. TARGET_OS:=OpenWrt
  23. SITECONFIG:=site.$(TARGET_OS).m4
  24. #
  25. # Uncomment the following sections that are currently commented out
  26. # to enable building and packaging Sendmail executables and default
  27. # configuration files into the "sendmail" package.
  28. #
  29. # Note that in this edition of the "sendmail" package:
  30. # 1. No init script is provided to start the Sendmail daemon.
  31. # 2. The initial configuration files in /etc/mail are likely inadequate
  32. # for running the Sendmail daemon on your LEDE/OpenWrt device.
  33. # 3. You may have to "opkg install m4" to build Sendmail configuration files
  34. # from customized mc files on your LEDE/OpenWrt device using m4, or
  35. # alternatively you may use a Linux computer to build configuration
  36. # files from customized mc files.
  37. # 4. Compiling and building the "sendmail" package will likely fail at
  38. # the packaging stage if you have already selected and built the "ssmtp"
  39. # package. "ssmtp" installs /usr/sbin/sendmail in the form of a symlink
  40. # to /usr/sbin/ssmtp. Where /usr/sbin/sendmail is already present,
  41. # copying the sendmail executable into /usr/sbin/sendmail results in
  42. # an error:
  43. # cp: not writing through dangling symlink
  44. # ...
  45. # lede/source/include/toplevel.mk:206: recipe for target 'package/feeds/packages/libmilter/compile' failed
  46. #
  47. # ANYONE WHO IS READING THIS MAKEFILE AND WHO HAS THE KNOWLEDGE AND DESIRE
  48. # TO COMPLETE PORTING OF SENDMAIL TO LEDE/OPENWRT PLATFORM IS ENCOURAGED
  49. # TO DO SO AND TAKE OVER THE MAINTAINERSHIP OF THIS PACKAGE FROM VAL KULKOV.
  50. #
  51. #define Package/sendmail
  52. # SECTION:=mail
  53. # CATEGORY:=Mail
  54. # DEPENDS:=+libopenssl
  55. # TITLE:=A general purpose internetwork mail routing facility
  56. # URL:=http://sendmail.org/
  57. #endef
  58. #
  59. #define Package/sendmail/description
  60. # Sendmail is a general purpose internetwork email routing facility that
  61. # supports many kinds of mail-transfer and delivery methods, including
  62. # the Simple Mail Transfer Protocol (SMTP) used for email transport over
  63. # the Internet.
  64. #endef
  65. #
  66. #define Package/sendmail/conffiles
  67. #/etc/mail/helpfile
  68. #/etc/mail/sendmail.cf
  69. #/etc/mail/submit.cf
  70. #/etc/mail/statistics
  71. #endef
  72. define Package/libmilter-sendmail
  73. SECTION:=libs
  74. CATEGORY:=Libraries
  75. DEPENDS:=+libpthread
  76. TITLE:=The sendmail Mail Filter API (Milter) library
  77. URL:=http://sendmail.org/
  78. endef
  79. define Package/libmilter-sendmail/description
  80. The sendmail Mail Filter API (Milter) is designed to allow third-party
  81. programs access to mail messages as they are being processed in order to
  82. filter meta-information and content.
  83. endef
  84. TARGET_CFLAGS += $(FPIC)
  85. define Build/Prepare
  86. $(Build/Prepare/Default)
  87. $(CP) files/lm_getver.c $(PKG_BUILD_DIR)/libmilter/
  88. $(CP) files/$(SITECONFIG) $(PKG_BUILD_DIR)/devtools/Site/
  89. $(CP) files/$(TARGET_OS) $(PKG_BUILD_DIR)/devtools/OS/
  90. $(CP) files/sharedlibrary.m4 $(PKG_BUILD_DIR)/devtools/M4/UNIX/
  91. $(CP) $(PKG_BUILD_DIR)/cf/cf/generic-linux.mc $(PKG_BUILD_DIR)/cf/cf/sendmail.mc
  92. $(SED) 's@TARGET_CC@$(TARGET_CC)@g' $(PKG_BUILD_DIR)/devtools/Site/$(SITECONFIG)
  93. $(SED) 's@TARGET_CFLAGS@$(TARGET_CFLAGS)@g' $(PKG_BUILD_DIR)/devtools/Site/$(SITECONFIG)
  94. $(SED) 's@STAGING_DIR@$(STAGING_DIR)@g' $(PKG_BUILD_DIR)/devtools/OS/$(TARGET_OS)
  95. endef
  96. define Build/Compile
  97. $(call Build/Compile/Default,)
  98. $(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/libmilter $(MAKE_FLAGS) all
  99. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/libmilter $(MAKE_FLAGS) DESTDIR="$(PKG_INSTALL_DIR)" install
  100. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/cf/cf $(MAKE_FLAGS) DESTDIR="$(PKG_INSTALL_DIR)" install-cf
  101. endef
  102. define Build/InstallDev
  103. $(INSTALL_DIR) $(1)/usr/include/libmilter $(1)/usr/lib
  104. $(CP) $(PKG_INSTALL_DIR)/usr/include/libmilter/* $(1)/usr/include/libmilter/
  105. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmilter.so* $(1)/usr/lib/
  106. endef
  107. define Package/libmilter-sendmail/install
  108. $(INSTALL_DIR) $(1)/usr/lib
  109. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmilter.so* $(1)/usr/lib/
  110. endef
  111. #define Package/sendmail/install
  112. # $(INSTALL_DIR) $(1)/etc/mail $(1)/usr/bin $(1)/usr/sbin
  113. # $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/mail/* $(1)/etc/mail/
  114. # $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  115. # $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  116. #endef
  117. $(eval $(call BuildPackage,libmilter-sendmail))
  118. #$(eval $(call BuildPackage,sendmail))