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