usbmuxd: Update to latest git
[feed/packages.git] / mail / msmtp / Makefile
1 #
2 # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
3 # Copyright (C) 2009-2016 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.8.3
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_SOURCE_URL:=https://marlam.de/msmtp/releases
17 PKG_HASH:=3cb2eefd33d048f0f82de100ef39a494e44fd1485e376ead31f733d2f36b92b4
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19
20 PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
21 PKG_LICENSE:=GPL-3.0+
22 PKG_LICENSE_FILES:=COPYING
23 PKG_CPE_ID:=cpe:/a:marlam:msmtp
24
25 PKG_BUILD_PARALLEL:=1
26 PKG_INSTALL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29 include $(INCLUDE_DIR)/nls.mk
30
31 define Package/msmtp/Default
32 SECTION:=mail
33 CATEGORY:=Mail
34 DEPENDS:=$(INTL_DEPENDS)
35 TITLE:=Simple sendmail SMTP forwarding
36 URL:=https://marlam.de/msmtp
37 endef
38
39 define Package/msmtp/Default/description
40 msmtp is an SMTP client. In the default mode, it transmits a mail to
41 an SMTP server (for example at a free mail provider) which does the
42 delivery. To use this program with your mail user agent (MUA), create
43 a configuration file with your mail account(s) and tell your MUA to
44 call msmtp instead of /usr/sbin/sendmail.
45 endef
46
47 define Package/msmtp
48 $(call Package/msmtp/Default)
49 DEPENDS+= +libgnutls +ca-bundle
50 TITLE+= (with SSL support)
51 VARIANT:=ssl
52 endef
53
54 define Package/msmtp/conffiles
55 /etc/msmtprc
56 endef
57
58 define Package/msmtp/description
59 $(call Package/msmtp/Default/description)
60 This package is built with SSL support.
61 endef
62
63 define Package/msmtp-nossl
64 $(call Package/msmtp/Default)
65 TITLE+= (without SSL support)
66 VARIANT:=nossl
67 endef
68
69 define Package/msmtp-nossl/description
70 $(call Package/msmtp/Default/description)
71 This package is built without SSL support.
72 endef
73
74 define Package/msmtp-mta
75 $(call Package/msmtp/Default)
76 TITLE+= (as MTA)
77 DEPENDS+=@(PACKAGE_msmtp||PACKAGE_msmtp-nossl)
78 endef
79
80 define Package/msmtp-mta/description
81 $(call Package/msmtp/Default/description)
82 This package add a link from sendmail to msmtp
83 and is built with SSL support.
84 endef
85
86 define Package/msmtp-queue
87 $(call Package/msmtp/Default)
88 DEPENDS+= +bash @(PACKAGE_msmtp||PACKAGE_msmtp-nossl)
89 TITLE+= (queue scripts)
90 endef
91
92 define Package/msmtp-queue/description
93 $(call Package/msmtp/Default/description)
94 This package contains the msmtp queue scripts.
95 endef
96
97 CONFIGURE_ARGS += \
98 --disable-rpath \
99 --without-libintl-prefix \
100 --without-libgsasl \
101 --without-libidn \
102 --without-libsecret \
103 --without-macosx-keyring \
104 --without-msmtpd
105
106 ifneq ($(CONFIG_USE_UCLIBC),)
107 CONFIGURE_ARGS += --disable-gai-idn
108 endif
109
110 MAKE_FLAGS :=
111
112 ifeq ($(BUILD_VARIANT),ssl)
113 CONFIGURE_ARGS += \
114 --with-tls=gnutls
115 endif
116
117 ifeq ($(BUILD_VARIANT),nossl)
118 CONFIGURE_ARGS += \
119 --with-tls=no
120 endif
121
122 define Package/msmtp/install
123 $(INSTALL_DIR) $(1)/etc
124 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
125 $(1)/etc/msmtprc
126 $(INSTALL_DIR) $(1)/usr/bin
127 $(CP) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/
128 endef
129
130 define Package/msmtp-mta/install
131 $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/lib
132 ln -sf ../bin/msmtp $(1)/usr/sbin/sendmail
133 ln -sf ../bin/msmtp $(1)/usr/lib/sendmail
134 endef
135
136 Package/msmtp-nossl/conffiles = $(Package/msmtp/conffiles)
137 Package/msmtp-nossl/install = $(Package/msmtp/install)
138
139 define Package/msmtp-queue/install
140 $(INSTALL_DIR) $(1)/usr/bin
141 $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpq/msmtp{q,-queue} $(1)/usr/bin/
142 $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpqueue/msmtp-{en,list,run}queue.sh $(1)/usr/bin/
143 endef
144
145 $(eval $(call BuildPackage,msmtp))
146 $(eval $(call BuildPackage,msmtp-nossl))
147 $(eval $(call BuildPackage,msmtp-queue))
148 $(eval $(call BuildPackage,msmtp-mta))