[packages] dovecot: update to 2.2.12
[packages.git] / mail / msmtp / Makefile
1 #
2 # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
3 # Copyright (C) 2009-2012 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.27
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/msmtp
17 PKG_MD5SUM:=2d6d10d9c59ed2b2635554ed35fb9226
18
19 PKG_FIXUP:=autoreconf
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/description
34  msmtp is an SMTP client. In the default mode, it transmits a mail to
35  an SMTP server (for example at a free mail provider) which does the
36  delivery. To use this program with your mail user agent (MUA), create
37  a configuration file with your mail account(s) and tell your MUA to
38  call msmtp instead of /usr/sbin/sendmail.
39 endef
40
41 define Package/msmtp
42 $(call Package/msmtp/Default)
43   DEPENDS+= +libopenssl
44   TITLE+= (with SSL support)
45   VARIANT:=ssl
46 endef
47
48 define Package/msmtp/conffiles
49 /etc/msmtprc
50 endef
51
52 define Package/msmtp/description
53 $(call Package/msmtp/Default/description)
54  This package is built with SSL support.
55 endef
56
57 define Package/msmtp-nossl
58 $(call Package/msmtp/Default)
59   TITLE+= (without SSL support)
60   VARIANT:=nossl
61 endef
62
63 define Package/msmtp-nossl/description
64 $(call Package/msmtp/Default/description)
65  This package is built without SSL support.
66 endef
67
68 define Package/msmtp-queue
69 $(call Package/msmtp/Default)
70   DEPENDS+= +bash
71   TITLE+= (queue scripts)
72 endef
73
74 define Package/msmtp-queue/description
75 $(call Package/msmtp/Default/description)
76  This package contains the msmtp queue scripts.
77 endef
78
79 CONFIGURE_ARGS += \
80         --disable-rpath \
81         --without-libintl-prefix \
82         --without-libgsasl \
83         --without-libidn
84
85 MAKE_FLAGS :=
86
87 ifeq ($(BUILD_VARIANT),ssl)
88         CONFIGURE_ARGS += \
89                 --with-ssl=openssl
90 endif
91
92 ifeq ($(BUILD_VARIANT),nossl)
93         CONFIGURE_ARGS += \
94                 --with-ssl=no
95 endif
96
97 define Package/msmtp/install
98         $(INSTALL_DIR) $(1)/etc
99         $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
100                 $(1)/etc/msmtprc
101         $(INSTALL_DIR) $(1)/usr/bin
102         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(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/conffiles = $(Package/msmtp/conffiles)
111 Package/msmtp-nossl/install = $(Package/msmtp/install)
112 Package/msmtp-nossl/postinst = $(Package/msmtp/postinst)
113
114 define Package/msmtp-queue/install
115         $(INSTALL_DIR) $(1)/usr/bin
116         $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpq/msmtp{q,-queue} $(1)/usr/bin/
117         $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpqueue/msmtp-{en,list,run}queue.sh $(1)/usr/bin/
118 endef
119
120 $(eval $(call BuildPackage,msmtp))
121 $(eval $(call BuildPackage,msmtp-nossl))
122 $(eval $(call BuildPackage,msmtp-queue))