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.

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