Merge pull request #18472 from sotux/master
[feed/packages.git] / mail / dovecot / Makefile
1 #
2 # Copyright (C) 2006-2018 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=dovecot
11 PKG_VERSION:=2.3.18
12 PKG_RELEASE:=$(AUTORELEASE)
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://dovecot.org/releases/2.3
16 PKG_HASH:=06e73f668c6c093c45bdeeeb7c20398ab8dc49317234f4b5781ac5e2cc5d6c33
17
18 PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
19 PKG_LICENSE:=LGPL-2.1-only MIT BSD-3-Clause
20 PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
21 PKG_CPE_ID:=cpe:/a:dovecot:dovecot
22
23 PKG_CONFIG_DEPENDS:= \
24 CONFIG_DOVECOT_GSSAPI \
25 CONFIG_DOVECOT_LDAP \
26 CONFIG_DOVECOT_MYSQL \
27 CONFIG_DOVECOT_PGSQL \
28 CONFIG_DOVECOT_SQLITE \
29 CONFIG_DOVECOT_ICU
30
31 PKG_FIXUP:=autoreconf
32 PKG_INSTALL:=1
33 PKG_BUILD_PARALLEL:=1
34
35 include $(INCLUDE_DIR)/package.mk
36 # iconv is needed when compiling with MySQL support. iconv will also be used by
37 # dovecot itself.
38 include $(INCLUDE_DIR)/nls.mk
39
40 define Package/dovecot
41 SECTION:=mail
42 CATEGORY:=Mail
43 TITLE:=An IMAP and POP3 daemon
44 URL:=https://www.dovecot.org/
45 DEPENDS:=+DOVECOT_GSSAPI:krb5-libs +DOVECOT_LDAP:libopenldap +DOVECOT_MYSQL:libmysqlclient +DOVECOT_PGSQL:libpq +DOVECOT_SQLITE:libsqlite3 +libopenssl +librt +zlib +libbz2 +libcap +DOVECOT_ICU:icu $(ICONV_DEPENDS)
46 USERID:=dovecot=59:dovecot=59 dovenull=60:dovenull=60
47 ABI_VERSION:=$(PKG_VERSION)
48 endef
49
50 define Package/dovecot/description
51 Dovecot is a program which provides POP3 and IMAP services.
52 endef
53
54 define Package/dovecot/config
55 source "$(SOURCE)/Config.in"
56 endef
57
58 define Package/dovecot/conffiles
59 /etc/dovecot/
60 endef
61
62 define Package/dovecot-utils
63 SECTION:=mail
64 CATEGORY:=Mail
65 DEPENDS:=+dovecot
66 TITLE:=doveadm and dsync utilities for Dovecot
67 endef
68
69 CONFIGURE_ARGS += \
70 --libexecdir=/usr/libexec \
71 --without-libunwind \
72 --without-pam \
73 --with-notify=dnotify \
74 --without-lzma \
75 --without-lz4 \
76 --without-sodium \
77 --without-zstd \
78 $(if $(CONFIG_DOVECOT_GSSAPI),--with-gssapi=yes,--with-gssapi=no) \
79 $(if $(CONFIG_DOVECOT_LDAP),--with-ldap=yes,--with-ldap=no) \
80 $(if $(CONFIG_DOVECOT_MYSQL),--with-mysql=yes,--with-mysql=no) \
81 $(if $(CONFIG_DOVECOT_PGSQL),--with-pgsql=yes,--with-pgsql=no) \
82 $(if $(CONFIG_DOVECOT_SQLITE),--with-sqlite=yes,--with-sqlite=no) \
83 $(if $(CONFIG_DOVECOT_ICU),--with-icu=yes,--with-icu=no)
84
85 CONFIGURE_VARS += \
86 RPCGEN= \
87 i_cv_signed_size_t=no \
88 i_cv_signed_time_t=no \
89 i_cv_gmtime_max_time_t=32 \
90 i_cv_mmap_plays_with_write=yes \
91 i_cv_fd_passing=yes \
92 i_cv_c99_vsnprintf=yes \
93 lib_cv_va_copy=yes \
94 lib_cv_va_copy=yes \
95 lib_cv___va_copy=yes \
96 lib_cv_va_val_copy=yes \
97 ac_cv_prog_KRB5CONFIG="krb5-config"
98
99 define Build/InstallDev
100 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
101 $(CP) $(PKG_INSTALL_DIR)/usr/include/dovecot $(1)/usr/include/
102 $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot $(1)/usr/lib/
103 $(call libtool_remove_files,$(1))
104 endef
105
106
107 define Package/dovecot/install
108 $(INSTALL_DIR) $(1)/etc/init.d
109 $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot
110
111 $(INSTALL_DIR) $(1)/etc/dovecot
112 $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/dovecot/example-config/* $(1)/etc/dovecot/
113
114 $(INSTALL_DIR) $(1)/usr/lib/dovecot
115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
116 rm $(1)/usr/lib/dovecot/dovecot-config
117 find $(1)/usr/lib/dovecot/ -name "*.a" -o -name "*.la" | $(XARGS) rm -f
118
119 $(INSTALL_DIR) $(1)/usr/libexec/dovecot
120 $(CP) $(PKG_INSTALL_DIR)/usr/libexec/dovecot/* $(1)/usr/libexec/dovecot/
121
122 $(INSTALL_DIR) $(1)/usr/bin
123 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveconf $(1)/usr/bin/
124
125 $(INSTALL_DIR) $(1)/usr/sbin
126 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
127 endef
128
129 define Package/dovecot-utils/install
130 $(INSTALL_DIR) $(1)/usr/bin
131 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveadm $(1)/usr/bin/
132 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dsync $(1)/usr/bin/
133 endef
134
135 $(eval $(call BuildPackage,dovecot))
136 $(eval $(call BuildPackage,dovecot-utils))