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