Merge pull request #8518 from neheb/i
[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.5.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://www.dovecot.org/releases/2.3
16 PKG_HASH:=ba14e41aefd81a868a35b83bcb54194116106424d37690519b50ea83c0f31bf2
17 PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
18 PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
19 PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
20
21 PKG_BUILD_DEPENDS:=libiconv
22 PKG_CONFIG_DEPENDS:= \
23 CONFIG_DOVECOT_GSSAPI \
24 CONFIG_DOVECOT_LDAP \
25 CONFIG_DOVECOT_MYSQL \
26 CONFIG_DOVECOT_PGSQL \
27 CONFIG_DOVECOT_SQLITE \
28 CONFIG_DOVECOT_ICU
29
30 PKG_FIXUP:=autoreconf
31 PKG_INSTALL:=1
32 PKG_BUILD_PARALLEL:=1
33
34 include $(INCLUDE_DIR)/package.mk
35 # iconv is needed when compiling with MySQL support. iconv will also be used by
36 # dovecot itself.
37 include $(INCLUDE_DIR)/nls.mk
38
39 define Package/dovecot
40 SECTION:=mail
41 CATEGORY:=Mail
42 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)
43 TITLE:=An IMAP and POP3 daemon
44 URL:=https://www.dovecot.org/
45 USERID:=dovecot=59:dovecot=59
46 ABI_VERSION:=$(PKG_VERSION)
47 endef
48
49 define Package/dovecot/description
50 Dovecot is a program which provides POP3 and IMAP services.
51 endef
52
53 define Package/dovecot/config
54 menu "Select dovecot build options"
55 depends on PACKAGE_dovecot
56 config DOVECOT_GSSAPI
57 bool "GSSAPI support"
58 default n
59 help
60 Implements GSSAPI support in dovecot.
61 config DOVECOT_LDAP
62 bool "LDAP support"
63 default n
64 help
65 Implements LDAP support in dovecot.
66 config DOVECOT_MYSQL
67 bool "MYSQL support"
68 default n
69 help
70 Implements MYSQL support in dovecot.
71 config DOVECOT_PGSQL
72 bool "PostgreSQL support"
73 default n
74 help
75 Implements PostgreSQL support in dovecot.
76 config DOVECOT_SQLITE
77 bool "SQLite support"
78 default n
79 help
80 Implements SQLite DB support in dovecot.
81 config DOVECOT_ICU
82 bool "Enable i18n features"
83 default n
84 help
85 Enable ICU (International Components for Unicode) support.
86 endmenu
87 endef
88
89 define Package/dovecot/conffiles
90 /etc/init.d/dovecot
91 /etc/dovecot/
92 endef
93
94 define Package/dovecot-utils
95 SECTION:=mail
96 CATEGORY:=Mail
97 DEPENDS:=+dovecot
98 TITLE:=doveadm and dsync utilities for Dovecot
99 endef
100
101 CONFIGURE_ARGS += \
102 --libexecdir=/usr/libexec \
103 --without-pam \
104 --with-notify=dnotify \
105 --without-lzma \
106 --without-lz4 \
107 --without-sodium \
108 $(if $(CONFIG_DOVECOT_GSSAPI),--with-gssapi=yes,--with-gssapi=no) \
109 $(if $(CONFIG_DOVECOT_LDAP),--with-ldap=yes,--with-ldap=no) \
110 $(if $(CONFIG_DOVECOT_MYSQL),--with-mysql=yes,--with-mysql=no) \
111 $(if $(CONFIG_DOVECOT_PGSQL),--with-pgsql=yes,--with-pgsql=no) \
112 $(if $(CONFIG_DOVECOT_SQLITE),--with-sqlite=yes,--with-sqlite=no) \
113 $(if $(CONFIG_DOVECOT_ICU),--with-icu=yes,--with-icu=no)
114
115 CONFIGURE_VARS += \
116 RPCGEN= \
117 i_cv_signed_size_t=no \
118 i_cv_signed_time_t=no \
119 i_cv_gmtime_max_time_t=32 \
120 i_cv_mmap_plays_with_write=yes \
121 i_cv_fd_passing=yes \
122 i_cv_c99_vsnprintf=yes \
123 lib_cv_va_copy=yes \
124 lib_cv_va_copy=yes \
125 lib_cv___va_copy=yes \
126 lib_cv_va_val_copy=yes \
127 ac_cv_prog_KRB5CONFIG="krb5-config"
128
129 define Build/InstallDev
130 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
131 $(CP) $(PKG_INSTALL_DIR)/usr/include/dovecot $(1)/usr/include/
132 $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot $(1)/usr/lib/
133 rm -f $(1)/usr/lib/dovecot/*.la
134 endef
135
136
137 define Package/dovecot/install
138 $(INSTALL_DIR) $(1)/etc/init.d \
139 $(1)/etc/dovecot \
140 $(1)/usr/share/doc/dovecot \
141 $(1)/usr/lib/dovecot \
142 $(1)/usr/libexec/dovecot \
143 $(1)/usr/bin \
144 $(1)/usr/sbin
145 $(CP) $(PKG_INSTALL_DIR)/etc/dovecot/* $(1)/etc/dovecot/
146 $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
147 $(CP) $(PKG_INSTALL_DIR)/usr/libexec/dovecot/* $(1)/usr/libexec/dovecot/
148 $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/dovecot/example-config $(1)/usr/share/doc/dovecot/
149 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveconf $(1)/usr/bin/
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
151 $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot
152 rm $(1)/usr/lib/dovecot/dovecot-config
153 find $(1)/usr/lib/dovecot/ -name "*.a" -o -name "*.la" | xargs rm
154 endef
155
156 define Package/dovecot-utils/install
157 $(INSTALL_DIR) $(1)/usr/bin
158 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveadm $(1)/usr/bin/
159 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dsync $(1)/usr/bin/
160 endef
161
162 $(eval $(call BuildPackage,dovecot))
163 $(eval $(call BuildPackage,dovecot-utils))