[packages] dovecot: update to 1.2.10
[packages.git] / mail / dovecot / Makefile
1 #
2 # Copyright (C) 2006-2010 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:=1.2.10
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.dovecot.org/releases/1.2
16 PKG_MD5SUM:=b7d0081b17ff6afae85e8dc14157fa57
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/dovecot
23   SECTION:=mail
24   CATEGORY:=Mail
25   DEPENDS:=+libopenssl +librt
26   TITLE:=An IMAP and POP3 daemon
27   URL:=http://www.dovecot.org/
28 endef
29
30 define Package/dovecot/description
31  Dovecot is a program which provides POP3 and IMAP services.
32 endef
33
34 CONFIGURE_ARGS += \
35         --without-gssapi \
36         --without-pam \
37         --with-moduledir=/usr/lib/dovecot/modules \
38         --with-notify=dnotify \
39
40 CONFIGURE_VARS += \
41         RPCGEN= \
42         i_cv_signed_size_t=no \
43         i_cv_signed_time_t=no \
44         i_cv_gmtime_max_time_t=32 \
45         i_cv_mmap_plays_with_write=yes \
46         i_cv_fd_passing=yes \
47         i_cv_c99_vsnprintf=yes \
48         lib_cv_va_copy=yes \
49         lib_cv_va_copy=yes \
50         lib_cv___va_copy=yes \
51         lib_cv_va_val_copy=yes \
52
53 define Build/Configure
54         (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
55                 autoconf \
56         );
57         $(call Build/Configure/Default)
58 endef
59
60 define Package/dovecot/install
61         $(INSTALL_DIR) $(1)/etc/init.d
62         $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot
63         $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/dovecot-example.conf $(1)/etc/dovecot.conf
64         $(INSTALL_DIR) $(1)/usr/lib/dovecot
65         $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
66         $(INSTALL_DIR) $(1)/usr/sbin
67         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
68         find $(1)/usr/lib/dovecot/modules/ \
69                 -name "*.a" -o -name "*.la" | xargs rm
70 endef
71
72 define Package/dovecot/conffiles
73 /etc/dovecot.conf
74 endef
75
76 define Package/dovecot/postinst
77 #!/bin/sh
78
79 id=59
80 name=dovecot
81 home=/var/run/dovecot
82 shell=/bin/false
83
84 # do not change below
85 # check if we are on real system
86 if [ -z "$${IPKG_INSTROOT}" ]; then
87         # create copies of passwd and group, if we use squashfs
88         rootfs=`mount |awk '/root/ { print $$5 }'`
89         if [ "$$rootfs" = "squashfs" ]; then
90                 if [ -h /etc/group ]; then
91                         rm /etc/group
92                         cp -p /rom/etc/group /etc/group
93                 fi
94                 if [ -h /etc/passwd ]; then
95                         rm /etc/passwd
96                         cp -p /rom/etc/passwd /etc/passwd
97                 fi
98         fi
99 fi
100
101 echo ""
102 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
103         echo "adding group $$name to /etc/group"
104         echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
105 fi
106 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
107         echo "adding user $$name to /etc/passwd"
108         echo "$${name}:x:$${id}:$${id}:$${name}:$${home}:$${shell}" >> $${IPKG_INSTROOT}/etc/passwd
109 fi
110 endef
111
112
113 $(eval $(call BuildPackage,dovecot))