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