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.

84 lines
2.0 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=fdm
  9. PKG_VERSION:=2.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/nicm/fdm/releases/download/$(PKG_VERSION)
  13. PKG_HASH:=06b28cb6b792570bc61d7e29b13d2af46b92fea77e058b2b17e11e8f7ed0cea4
  14. PKG_MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
  15. PKG_LICENSE:=BSD-2-Clause
  16. PKG_FIXUP:=autoreconf
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/fdm
  21. SECTION:=mail
  22. CATEGORY:=Mail
  23. TITLE:=fetch mail and deliver
  24. URL:=https://github.com/nicm/fdm
  25. MENU:=1
  26. DEPENDS:=+tdb +zlib +libopenssl +FDM_WITH_PCRE:libpcre
  27. USERID:=_fdm=99:_fdm=99
  28. endef
  29. define Package/fdm/description
  30. fdm is a simple, lightweight replacement for mail fetch, filter
  31. and delivery programs such as fetchmail and procmail. It can
  32. fetch using POP3 or IMAP (with SSL) or from stdin, and deliver
  33. to a pipe, file, maildir, mbox or SMTP server, based on $(if $(CONFIG_FDM_WITH_PCRE),PCRE,POSIX regexp)
  34. endef
  35. ifdef CONFIG_FDM_WITH_PCRE
  36. CONFIGURE_ARGS += --enable-pcre
  37. endif
  38. define Package/fdm/config
  39. source "$(SOURCE)/Config.in"
  40. endef
  41. define Package/fdm/conffiles
  42. /etc/fdm.conf
  43. endef
  44. define Package/fdm/install
  45. $(INSTALL_DIR) $(1)/usr/bin
  46. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  47. $(INSTALL_DIR) $(1)/etc
  48. $(INSTALL_DATA) ./files/etc/* $(1)/etc/
  49. $(INSTALL_DIR) $(1)/opt/fdm
  50. chmod a+rwx $(1)/opt/fdm
  51. endef
  52. define Package/fdm/postinst
  53. #!/bin/sh
  54. if [ -z "$${IPKG_INSTROOT}" ]; then
  55. echo "Creating cron job template for user _fdm..."
  56. (crontab -l -u _fdm 2>/dev/null; echo "# */13 * * * * fdm -q fetch") | crontab -u _fdm -
  57. echo "Please, edit file /etc/fdm.conf and enable cron job!"
  58. fi
  59. exit 0
  60. endef
  61. define Package/fdm/prerm
  62. #!/bin/sh
  63. if [ -z "$${IPKG_INSTROOT}" ]; then
  64. echo "Don't forget disable cron job!"
  65. echo "# crontab -r -u _fdm"
  66. fi
  67. exit 0
  68. endef
  69. $(eval $(call BuildPackage,fdm))