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