[packages] msmtp: update to 1.4.22
[packages.git] / mail / msmtp / Makefile
1 #
2 # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
3 # Copyright (C) 2009-2011 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.22
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/msmtp
17 PKG_MD5SUM:=de0a4e6f3133519b301fc114daf81f49
18
19 PKG_FIXUP:=libtool
20 PKG_INSTALL:=1
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/msmtp/Default
27   SECTION:=mail
28   CATEGORY:=Mail
29   TITLE:=Simple sendmail SMTP forwarding
30   URL:=http://msmtp.sourceforge.net/
31 endef
32
33 define Package/msmtp/Default/conffiles
34 /etc/msmtprc
35 endef
36
37 define Package/msmtp/Default/description
38  msmtp is an SMTP client. In the default mode, it transmits a mail to
39  an SMTP server (for example at a free mail provider) which does the
40  delivery. To use this program with your mail user agent (MUA), create
41  a configuration file with your mail account(s) and tell your MUA to
42  call msmtp instead of /usr/sbin/sendmail.
43 endef
44
45 define Package/msmtp
46 $(call Package/msmtp/Default)
47   DEPENDS+= +libopenssl
48   TITLE+= (with SSL support)
49   VARIANT:=ssl
50 endef
51
52 define Package/msmtp/conffiles
53 $(call Package/msmtp/Default/conffiles)
54 endef
55
56 define Package/msmtp/description
57 $(call Package/msmtp/Default/description)
58  This package is built with SSL support.
59 endef
60
61 define Package/msmtp-nossl
62 $(call Package/msmtp/Default)
63   TITLE+= (without SSL support)
64   VARIANT:=nossl
65 endef
66
67 define Package/msmtp-nossl/conffiles
68 $(call Package/msmtp/Default/conffiles)
69 endef
70
71 define Package/msmtp-nossl/description
72 $(call Package/msmtp/Default/description)
73  This package is built without SSL support.
74 endef
75
76 CONFIGURE_ARGS += \
77         --disable-rpath \
78         --without-libssl32-prefix \
79         --without-libintl-prefix \
80         --without-libgsasl \
81         --without-libidn
82
83 MAKE_FLAGS :=
84
85 ifeq ($(BUILD_VARIANT),ssl)
86         CONFIGURE_ARGS += \
87                 --with-ssl=openssl \
88                 --with-libssl-prefix="$(STAGING_DIR)/usr/include"
89 endif
90
91 ifeq ($(BUILD_VARIANT),nossl)
92         CONFIGURE_ARGS += \
93                 --with-ssl=no
94 endif
95
96 define Package/msmtp/install
97         $(INSTALL_DIR) $(1)/etc
98         $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
99                 $(1)/etc/msmtprc
100         $(INSTALL_DIR) $(1)/usr/bin
101         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/
102         $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpqueue/msmtp-{en,list,run}queue.sh $(1)/usr/bin/
103         $(INSTALL_DIR) $(1)/usr/sbin
104 endef
105
106 define Package/msmtp/postinst
107         ln -sf ../bin/msmtp $${IPKG_INSTROOT}/usr/sbin/sendmail
108 endef
109
110 Package/msmtp-nossl/install = $(Package/msmtp/install)
111 Package/msmtp-nossl/postinst = $(Package/msmtp/postinst)
112
113 $(eval $(call BuildPackage,msmtp))
114 $(eval $(call BuildPackage,msmtp-nossl))
115