0bb48b1271b7b9e4e948d704ea535d43f2082ec9
[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.24
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:=bd6644b1aaab17d61b86647993e3efad860b23c54283b00ddc579c1f5110aa59
18
19 PKG_MAINTAINER:=
20 PKG_LICENSE:=GPL-3.0-or-later
21 PKG_LICENSE_FILES:=COPYING
22 PKG_CPE_ID:=cpe:/a:marlam:msmtp
23
24 PKG_INSTALL:=1
25 PKG_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/nls.mk
29
30 define Package/msmtp/Default
31 SECTION:=mail
32 CATEGORY:=Mail
33 DEPENDS:=$(INTL_DEPENDS)
34 TITLE:=Simple sendmail SMTP forwarding
35 URL:=https://marlam.de/msmtp
36 endef
37
38 define Package/msmtp/Default/description
39 msmtp is an SMTP client. In the default mode, it transmits a mail to
40 an SMTP server (for example at a free mail provider) which does the
41 delivery. To use this program with your mail user agent (MUA), create
42 a configuration file with your mail account(s) and tell your MUA to
43 call msmtp instead of /usr/sbin/sendmail.
44 endef
45
46 define Package/msmtp
47 $(call Package/msmtp/Default)
48 DEPENDS+= +libgnutls +ca-bundle
49 TITLE+= (with SSL support)
50 VARIANT:=ssl
51 DEFAULT_VARIANT:=1
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 PROVIDES:=msmtp
68 endef
69
70 define Package/msmtp-nossl/description
71 $(call Package/msmtp/Default/description)
72 This package is built without SSL support.
73 endef
74
75 define Package/msmtp-mta
76 $(call Package/msmtp/Default)
77 TITLE+= (as MTA)
78 DEPENDS+=+msmtp
79 ALTERNATIVES:=\
80 100:/usr/sbin/sendmail:/usr/bin/msmtp \
81 100:/usr/lib/sendmail:/usr/bin/msmtp
82 endef
83
84 define Package/msmtp-mta/description
85 $(call Package/msmtp/Default/description)
86 This package add a link from sendmail to msmtp
87 and is built with SSL support.
88 endef
89
90 define Package/msmtp-queue
91 $(call Package/msmtp/Default)
92 DEPENDS+= +bash +msmtp
93 TITLE+= (queue scripts)
94 endef
95
96 define Package/msmtp-queue/description
97 $(call Package/msmtp/Default/description)
98 This package contains the msmtp queue scripts.
99 endef
100
101 CONFIGURE_ARGS += \
102 --disable-rpath \
103 --without-libintl-prefix \
104 --without-libgsasl \
105 --without-libidn \
106 --without-libsecret \
107 --without-macosx-keyring \
108 --without-msmtpd
109
110 ifeq ($(BUILD_VARIANT),ssl)
111 CONFIGURE_ARGS += --with-tls=gnutls
112 else
113 CONFIGURE_ARGS += --without-tls
114 endif
115
116 define Package/msmtp/install
117 $(INSTALL_DIR) $(1)/etc
118 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/msmtprc-system.example \
119 $(1)/etc/msmtprc
120 $(INSTALL_DIR) $(1)/usr/bin
121 $(CP) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/
122 endef
123
124 define Package/msmtp-mta/install
125 $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/lib
126 endef
127
128 Package/msmtp-nossl/conffiles = $(Package/msmtp/conffiles)
129 Package/msmtp-nossl/install = $(Package/msmtp/install)
130
131 define Package/msmtp-queue/install
132 $(INSTALL_DIR) $(1)/usr/bin
133 $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpq/msmtp{q,-queue} $(1)/usr/bin/
134 $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/msmtpqueue/msmtp-{en,list,run}queue.sh $(1)/usr/bin/
135 endef
136
137 $(eval $(call BuildPackage,msmtp))
138 $(eval $(call BuildPackage,msmtp-nossl))
139 $(eval $(call BuildPackage,msmtp-queue))
140 $(eval $(call BuildPackage,msmtp-mta))