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.

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