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