noddos: Noddos v0.5.0 with mDNS / DNS-SD support
[feed/packages.git] / mail / fdm / Makefile
1 #
2 # Copyright (C) 2007-2014 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:=fdm
11 PKG_VERSION:=1.7
12 PKG_RELEASE:=1
13 PKG_LICENSE:=BSD-2-Clause
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/fdm
17 PKG_MD5SUM:=aea0421571e8f3ec8f747a5d72c84348
18
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/fdm
24 SECTION:=mail
25 CATEGORY:=Mail
26 TITLE:=fetch mail and deliver
27 URL:=http://fdm.sourceforge.net/
28 MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
29 MENU:=1
30 DEPENDS:=+tdb +zlib +libopenssl +FDM_WITH_PCRE:libpcre
31 USERID:=_fdm=99:_fdm=99
32 endef
33
34 define Package/fdm/description
35 fdm is a simple, lightweight replacement for mail fetch, filter
36 and delivery programs such as fetchmail and procmail. It can
37 fetch using POP3 or IMAP (with SSL) or from stdin, and deliver
38 to a pipe, file, maildir, mbox or SMTP server, based on $(if $(CONFIG_FDM_WITH_PCRE),PCRE,POSIX regexp)
39 endef
40
41 MAKE_FLAGS += \
42 PREFIX="/usr"\
43 $(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
44
45 define Build/Prepare
46 $(call Build/Prepare/Default)
47 $(CP) ./src/compat/* $(PKG_BUILD_DIR)/
48 endef
49
50 define Package/fdm/config
51 source "$(SOURCE)/Config.in"
52 endef
53
54 define Package/fdm/conffiles
55 /etc/fdm.conf
56 endef
57
58 define Package/fdm/install
59 $(INSTALL_DIR) $(1)/usr/bin
60 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
61 $(INSTALL_DIR) $(1)/etc
62 $(INSTALL_DATA) ./files/etc/* $(1)/etc/
63 $(INSTALL_DIR) $(1)/opt/fdm
64 chmod a+rwx $(1)/opt/fdm
65 endef
66
67 define Package/fdm/postinst
68 #!/bin/sh
69 if [ -z "$${IPKG_INSTROOT}" ]; then
70 echo "Creating cron job template for user _fdm..."
71 (crontab -l -u _fdm 2>/dev/null; echo "# */13 * * * * fdm -q fetch") | crontab -u _fdm -
72 echo "Please, edit file /etc/fdm.conf and enable cron job!"
73 fi
74 exit 0
75 endef
76
77 define Package/fdm/prerm
78 #!/bin/sh
79 if [ -z "$${IPKG_INSTROOT}" ]; then
80 echo "Don't forget disable cron job!"
81 echo "# crontab -r -u _fdm"
82 fi
83 exit 0
84 endef
85
86 $(eval $(call BuildPackage,fdm))