New Package -- msmtp
[openwrt/svn-archive/archive.git] / mail / msmtp / Makefile
1 #
2 # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
3 # Copyright (C) 2009 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=msmtp
12 PKG_VERSION:=1.4.17
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/msmtp
17
18 PKG_MD5SUM:=b0b74f1144812b60688f590c62a0d3dd
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/msmtp/Default
23 SECTION:=mail
24 CATEGORY:=Mail
25 TITLE:=Simple sendmail SMTP forwarding
26 URL:=http://msmtp.sourceforge.net/
27 endef
28
29 define Package/msmtp/Default/description
30 msmtp is an SMTP client. In the default mode, it transmits a mail to
31 an SMTP server (for example at a free mail provider) which does the
32 delivery. To use this program with your mail user agent (MUA), create
33 a configuration file with your mail account(s) and tell your MUA to
34 call msmtp instead of /usr/sbin/sendmail.
35 endef
36
37 define Package/msmtp
38 $(call Package/msmtp/Default)
39 DEPENDS+= +libopenssl
40 TITLE+= (with SSL support)
41 endef
42
43 define Package/msmtp/description
44 $(call Package/msmtp/Default/description)
45 This package is built with SSL support.
46 endef
47
48 define Package/msmtp-nossl
49 $(call Package/msmtp/Default)
50 TITLE+= (without SSL support)
51 endef
52
53 define Package/msmtp-nossl/description
54 $(call Package/msmtp/Default/description)
55 This package is built without SSL support.
56 endef
57
58 define Build/Template
59
60 $(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
61 -$(MAKE) -C $(PKG_BUILD_DIR) clean
62 $(call Build/Configure/Default,$(3))
63 $(MAKE) -C $(PKG_BUILD_DIR)
64 ( cd $(PKG_BUILD_DIR)/src; mv -f msmtp msmtp-$(2) )
65 touch $$@
66
67 $(STAMP_BUILT): $(STAMP_BUILT)-$(2)
68
69 define Package/$(1)/install
70 $(INSTALL_DIR) $$(1)/etc
71 $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
72 $$(1)/etc/msmtprc
73 $(INSTALL_DIR) $$(1)/usr/bin
74 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/msmtp-$(2) $$(1)/usr/bin/msmtp
75 $(INSTALL_DIR) $$(1)/usr/sbin
76 ln -sf /usr/bin/msmtp $$(1)/usr/sbin/sendmail
77 endef
78
79 endef
80
81 CONFIGURE_ARGS += \
82 --without-libssl32 \
83 --without-libintl \
84 --without-libgsasl \
85 --without-libidn
86
87 ifneq ($(SDK)$(CONFIG_PACKAGE_msmtp),)
88 define Build/with-ssl
89 $(call Build/Template,msmtp,with-ssl, \
90 --with-ssl=openssl \
91 --with-libssl-prefix="$(STAGING_DIR)/usr/include" \
92 )
93 endef
94 endif
95 $(eval $(Build/with-ssl))
96
97 ifneq ($(SDK)$(CONFIG_PACKAGE_msmtp-nossl),)
98 define Build/without-ssl
99 $(call Build/Template,msmtp-nossl,without-ssl, \
100 --with-ssl=no \
101 )
102 endef
103 endif
104 $(eval $(Build/without-ssl))
105
106 $(eval $(call BuildPackage,msmtp))
107 $(eval $(call BuildPackage,msmtp-nossl))
108