fwknop: init script improvements
[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:=2.0
12 PKG_RELEASE:=1
13
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:=06b28cb6b792570bc61d7e29b13d2af46b92fea77e058b2b17e11e8f7ed0cea4
17
18 PKG_MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
19 PKG_LICENSE:=BSD-2-Clause
20
21 PKG_FIXUP:=autoreconf
22 PKG_BUILD_PARALLEL:=1
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/fdm
28 SECTION:=mail
29 CATEGORY:=Mail
30 TITLE:=fetch mail and deliver
31 URL:=https://github.com/nicm/fdm
32 MENU:=1
33 DEPENDS:=+tdb +zlib +libopenssl +FDM_WITH_PCRE:libpcre
34 USERID:=_fdm=99:_fdm=99
35 endef
36
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)
42 endef
43
44 ifdef CONFIG_FDM_WITH_PCRE
45 CONFIGURE_ARGS += --enable-pcre
46 endif
47
48 define Package/fdm/config
49 source "$(SOURCE)/Config.in"
50 endef
51
52 define Package/fdm/conffiles
53 /etc/fdm.conf
54 endef
55
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
63 endef
64
65 define Package/fdm/postinst
66 #!/bin/sh
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!"
71 fi
72 exit 0
73 endef
74
75 define Package/fdm/prerm
76 #!/bin/sh
77 if [ -z "$${IPKG_INSTROOT}" ]; then
78 echo "Don't forget disable cron job!"
79 echo "# crontab -r -u _fdm"
80 fi
81 exit 0
82 endef
83
84 $(eval $(call BuildPackage,fdm))