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.16.1
  9. PKG_RELEASE:=1
  10. PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tar.gz
  11. PKG_SOURCE_URL:=ftp://ftp.sendmail.org/pub/sendmail
  12. PKG_HASH:=7886d5dc4b436b86175f32b5b9c7305c80787749847e2909bf99123ecc4e64ba
  13. PKG_MAINTAINER:=Val Kulkov <val.kulkov@gmail.com>
  14. PKG_LICENSE:=Sendmail
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_CPE_ID:=cpe:/a:sendmail:sendmail
  17. PKG_INSTALL:=1
  18. PKG_BUILD_DEPENDS:=openssl
  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. $(SED) 's@STAGING_DIR@$(STAGING_DIR)@g' $(PKG_BUILD_DIR)/devtools/OS/$(TARGET_OS)
  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))