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

  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:=1.9
  10. PKG_RELEASE:=4
  11. PKG_LICENSE:=BSD-2-Clause
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://github.com/nicm/fdm/releases/download/$(PKG_VERSION)
  14. PKG_HASH:=16416c38a9a7e32d187220cc5ae61a51463d5e4e47419c5c513f422523d39914
  15. PKG_FIXUP:=autoreconf
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/fdm
  20. SECTION:=mail
  21. CATEGORY:=Mail
  22. TITLE:=fetch mail and deliver
  23. URL:=https://github.com/nicm/fdm
  24. MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
  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. EXTRA_CFLAGS := -DPCRE
  37. EXTRA_LDFLAGS += -lpcre
  38. endif
  39. MAKE_FLAGS += \
  40. PREFIX="/usr" \
  41. $(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
  42. define Package/fdm/config
  43. source "$(SOURCE)/Config.in"
  44. endef
  45. define Package/fdm/conffiles
  46. /etc/fdm.conf
  47. endef
  48. define Package/fdm/install
  49. $(INSTALL_DIR) $(1)/usr/bin
  50. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  51. $(INSTALL_DIR) $(1)/etc
  52. $(INSTALL_DATA) ./files/etc/* $(1)/etc/
  53. $(INSTALL_DIR) $(1)/opt/fdm
  54. chmod a+rwx $(1)/opt/fdm
  55. endef
  56. define Package/fdm/postinst
  57. #!/bin/sh
  58. if [ -z "$${IPKG_INSTROOT}" ]; then
  59. echo "Creating cron job template for user _fdm..."
  60. (crontab -l -u _fdm 2>/dev/null; echo "# */13 * * * * fdm -q fetch") | crontab -u _fdm -
  61. echo "Please, edit file /etc/fdm.conf and enable cron job!"
  62. fi
  63. exit 0
  64. endef
  65. define Package/fdm/prerm
  66. #!/bin/sh
  67. if [ -z "$${IPKG_INSTROOT}" ]; then
  68. echo "Don't forget disable cron job!"
  69. echo "# crontab -r -u _fdm"
  70. fi
  71. exit 0
  72. endef
  73. $(eval $(call BuildPackage,fdm))