You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

89 lines
2.1 KiB

#
# Copyright (C) 2007-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=fdm
PKG_VERSION:=1.9
PKG_RELEASE:=4
PKG_LICENSE:=BSD-2-Clause
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/nicm/fdm/releases/download/$(PKG_VERSION)
PKG_HASH:=16416c38a9a7e32d187220cc5ae61a51463d5e4e47419c5c513f422523d39914
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/fdm
SECTION:=mail
CATEGORY:=Mail
TITLE:=fetch mail and deliver
URL:=https://github.com/nicm/fdm
MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
MENU:=1
DEPENDS:=+tdb +zlib +libopenssl +FDM_WITH_PCRE:libpcre
USERID:=_fdm=99:_fdm=99
endef
define Package/fdm/description
fdm is a simple, lightweight replacement for mail fetch, filter
and delivery programs such as fetchmail and procmail. It can
fetch using POP3 or IMAP (with SSL) or from stdin, and deliver
to a pipe, file, maildir, mbox or SMTP server, based on $(if $(CONFIG_FDM_WITH_PCRE),PCRE,POSIX regexp)
endef
ifdef CONFIG_FDM_WITH_PCRE
EXTRA_CFLAGS := -DPCRE
EXTRA_LDFLAGS += -lpcre
endif
MAKE_FLAGS += \
PREFIX="/usr" \
$(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
define Package/fdm/config
source "$(SOURCE)/Config.in"
endef
define Package/fdm/conffiles
/etc/fdm.conf
endef
define Package/fdm/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DATA) ./files/etc/* $(1)/etc/
$(INSTALL_DIR) $(1)/opt/fdm
chmod a+rwx $(1)/opt/fdm
endef
define Package/fdm/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Creating cron job template for user _fdm..."
(crontab -l -u _fdm 2>/dev/null; echo "# */13 * * * * fdm -q fetch") | crontab -u _fdm -
echo "Please, edit file /etc/fdm.conf and enable cron job!"
fi
exit 0
endef
define Package/fdm/prerm
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Don't forget disable cron job!"
echo "# crontab -r -u _fdm"
fi
exit 0
endef
$(eval $(call BuildPackage,fdm))