fix package submenu.
[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.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 include $(INCLUDE_DIR)/package.mk
20
21 define Package/dovecot
22 SECTION:=mail
23 CATEGORY:=Mail
24 DEPENDS:=+libopenssl
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 , \
41 ignore_signed_size=1 \
42 )
43 endef
44
45 define Build/Compile
46 $(MAKE) -C $(PKG_BUILD_DIR) \
47 DESTDIR="$(PKG_INSTALL_DIR)" \
48 all install
49 endef
50
51 define Package/dovecot/install
52 $(INSTALL_DIR) $(1)/etc/init.d
53 $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot
54 $(INSTALL_DIR) $(1)/etc/dovecot
55 $(INSTALL_DATA) ./files/dovecot.conf $(1)/etc/dovecot.conf
56 $(INSTALL_DIR) $(1)/usr/lib/dovecot
57 $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
58 $(INSTALL_DIR) $(1)/usr/sbin
59 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
60 find $(1)/usr/lib/dovecot/modules/ \
61 -name "*.a" -o -name "*.la" | xargs rm
62 endef
63
64 define Package/dovecot/conffiles
65 /etc/dovecot.conf
66 endef
67
68 define Package/dovecot/postinst
69 #!/bin/sh
70
71 id=59
72 name=dovecot
73 home=/var/run/dovecot
74 shell=/bin/false
75
76 # do not change below
77 # check if we are on real system
78 if [ -z "$${IPKG_INSTROOT}" ]; then
79 # create copies of passwd and group, if we use squashfs
80 rootfs=`mount |awk '/root/ { print $$5 }'`
81 if [ "$$rootfs" = "squashfs" ]; then
82 if [ -h /etc/group ]; then
83 rm /etc/group
84 cp -p /rom/etc/group /etc/group
85 fi
86 if [ -h /etc/passwd ]; then
87 rm /etc/passwd
88 cp -p /rom/etc/passwd /etc/passwd
89 fi
90 fi
91 fi
92
93 echo ""
94 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
95 echo "adding group $$name to /etc/group"
96 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
97 fi
98 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
99 echo "adding user $$name to /etc/passwd"
100 echo "$${name}:x:$${id}:$${id}:$${name}:$${home}:$${shell}" >> $${IPKG_INSTROOT}/etc/passwd
101 fi
102 endef
103
104
105 $(eval $(call BuildPackage,dovecot))