Merge pull request #18400 from nmav/tmp-tang-self-contained
[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:=2
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 # need iconv.m4, otherwise error during autoreconf
41 PKG_BUILD_DEPENDS:=gettext-full
42
43 define Package/dovecot
44 SECTION:=mail
45 CATEGORY:=Mail
46 TITLE:=An IMAP and POP3 daemon
47 URL:=https://www.dovecot.org/
48 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)
49 USERID:=dovecot=59:dovecot=59 dovenull=60:dovenull=60
50 ABI_VERSION:=$(PKG_VERSION)
51 endef
52
53 define Package/dovecot/description
54 Dovecot is a program which provides POP3 and IMAP services.
55 endef
56
57 define Package/dovecot/config
58 source "$(SOURCE)/Config.in"
59 endef
60
61 define Package/dovecot/conffiles
62 /etc/dovecot/
63 endef
64
65 define Package/dovecot-utils
66 SECTION:=mail
67 CATEGORY:=Mail
68 DEPENDS:=+dovecot
69 TITLE:=doveadm and dsync utilities for Dovecot
70 endef
71
72 CONFIGURE_ARGS += \
73 --libexecdir=/usr/libexec \
74 --without-libunwind \
75 --without-pam \
76 --with-notify=dnotify \
77 --without-lzma \
78 --without-lz4 \
79 --without-sodium \
80 --without-zstd \
81 $(if $(CONFIG_DOVECOT_GSSAPI),--with-gssapi=yes,--with-gssapi=no) \
82 $(if $(CONFIG_DOVECOT_LDAP),--with-ldap=yes,--with-ldap=no) \
83 $(if $(CONFIG_DOVECOT_MYSQL),--with-mysql=yes,--with-mysql=no) \
84 $(if $(CONFIG_DOVECOT_PGSQL),--with-pgsql=yes,--with-pgsql=no) \
85 $(if $(CONFIG_DOVECOT_SQLITE),--with-sqlite=yes,--with-sqlite=no) \
86 $(if $(CONFIG_DOVECOT_ICU),--with-icu=yes,--with-icu=no)
87
88 CONFIGURE_VARS += \
89 RPCGEN= \
90 i_cv_signed_size_t=no \
91 i_cv_signed_time_t=no \
92 i_cv_gmtime_max_time_t=32 \
93 i_cv_mmap_plays_with_write=yes \
94 i_cv_fd_passing=yes \
95 i_cv_c99_vsnprintf=yes \
96 lib_cv_va_copy=yes \
97 lib_cv_va_copy=yes \
98 lib_cv___va_copy=yes \
99 lib_cv_va_val_copy=yes \
100 ac_cv_prog_KRB5CONFIG="krb5-config"
101
102 define Build/InstallDev
103 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
104 $(CP) $(PKG_INSTALL_DIR)/usr/include/dovecot $(1)/usr/include/
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot $(1)/usr/lib/
106 $(call libtool_remove_files,$(1))
107 endef
108
109
110 define Package/dovecot/install
111 $(INSTALL_DIR) $(1)/etc/init.d
112 $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot
113
114 $(INSTALL_DIR) $(1)/etc/dovecot
115 $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/dovecot/example-config/* $(1)/etc/dovecot/
116
117 $(INSTALL_DIR) $(1)/usr/lib/dovecot
118 $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
119 rm $(1)/usr/lib/dovecot/dovecot-config
120 find $(1)/usr/lib/dovecot/ -name "*.a" -o -name "*.la" | $(XARGS) rm -f
121
122 $(INSTALL_DIR) $(1)/usr/libexec/dovecot
123 $(CP) $(PKG_INSTALL_DIR)/usr/libexec/dovecot/* $(1)/usr/libexec/dovecot/
124
125 $(INSTALL_DIR) $(1)/usr/bin
126 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveconf $(1)/usr/bin/
127
128 $(INSTALL_DIR) $(1)/usr/sbin
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
130 endef
131
132 define Package/dovecot-utils/install
133 $(INSTALL_DIR) $(1)/usr/bin
134 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveadm $(1)/usr/bin/
135 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dsync $(1)/usr/bin/
136 endef
137
138 $(eval $(call BuildPackage,dovecot))
139 $(eval $(call BuildPackage,dovecot-utils))