2 # Copyright (C) 2007-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://github.com
/nicm
/fdm
/releases
/download
/$(PKG_VERSION
)
16 PKG_HASH
:=53aad117829834e21c1b9bf20496a1aa1c0e0fb98fe7735e1e73314266fb6c16
18 PKG_MAINTAINER
:=Dmitry V. Zimin
<pfzim@mail.ru
>
19 PKG_LICENSE
:=BSD-2-Clause
25 include $(INCLUDE_DIR
)/package.mk
30 TITLE
:=fetch mail and deliver
31 URL
:=https
://github.com
/nicm
/fdm
33 DEPENDS
:=+tdb
+zlib
+libopenssl
+FDM_WITH_PCRE
:libpcre2
34 USERID
:=_fdm
=99:_fdm
=99
37 define Package
/fdm
/description
38 fdm is a simple
, lightweight replacement for mail fetch
, filter
39 and delivery programs such
as fetchmail and procmail. It can
40 fetch using POP3 or IMAP
(with SSL
) or from stdin
, and deliver
41 to a pipe
, file
, maildir
, mbox or SMTP server
, based on
$(if
$(CONFIG_FDM_WITH_PCRE
),PCRE
,POSIX regexp
)
44 ifdef CONFIG_FDM_WITH_PCRE
45 CONFIGURE_ARGS
+= --enable-pcre2
48 define Package
/fdm
/config
49 source
"$(SOURCE)/Config.in"
52 define Package
/fdm
/conffiles
56 define Package
/fdm
/install
57 $(INSTALL_DIR
) $(1)/usr
/bin
58 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/* $(1)/usr
/bin
/
59 $(INSTALL_DIR
) $(1)/etc
60 $(INSTALL_DATA
) .
/files
/etc
/* $(1)/etc
/
61 $(INSTALL_DIR
) $(1)/opt
/fdm
62 chmod a
+rwx
$(1)/opt
/fdm
65 define Package
/fdm
/postinst
67 if
[ -z
"$${IPKG_INSTROOT}" ]; then
68 echo
"Creating cron job template for user _fdm..."
69 (crontab
-l
-u _fdm
2>/dev
/null
; echo
"# */13 * * * * fdm -q fetch") | crontab
-u _fdm
-
70 echo
"Please, edit file /etc/fdm.conf and enable cron job!"
75 define Package
/fdm
/prerm
77 if
[ -z
"$${IPKG_INSTROOT}" ]; then
78 echo
"Don't forget disable cron job!"
79 echo
"# crontab -r -u _fdm"
84 $(eval
$(call BuildPackage
,fdm
))