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.

96 lines
2.2 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:=3
  11. PKG_LICENSE:=BSD-2-Clause
  12. PKG_SOURCE:=$(PKG_VERSION).zip
  13. PKG_SOURCE_URL:=https://github.com/nicm/fdm/archive
  14. PKG_HASH:=ee08f9133657c8c959b738079c2e4f556cf5cca2daa8343feaf4f07698ad6086
  15. PKG_INSTALL:=1
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/fdm
  18. SECTION:=mail
  19. CATEGORY:=Mail
  20. TITLE:=fetch mail and deliver
  21. URL:=http://fdm.sourceforge.net/
  22. MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
  23. MENU:=1
  24. DEPENDS:=+tdb +zlib +libopenssl +FDM_WITH_PCRE:libpcre
  25. USERID:=_fdm=99:_fdm=99
  26. endef
  27. define Package/fdm/description
  28. fdm is a simple, lightweight replacement for mail fetch, filter
  29. and delivery programs such as fetchmail and procmail. It can
  30. fetch using POP3 or IMAP (with SSL) or from stdin, and deliver
  31. to a pipe, file, maildir, mbox or SMTP server, based on $(if $(CONFIG_FDM_WITH_PCRE),PCRE,POSIX regexp)
  32. endef
  33. ifdef CONFIG_FDM_WITH_PCRE
  34. EXTRA_CFLAGS := -DPCRE
  35. EXTRA_LDFLAGS += -lpcre
  36. endif
  37. MAKE_FLAGS += \
  38. PREFIX="/usr" \
  39. $(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
  40. define Build/Prepare
  41. $(call Build/Prepare/Default)
  42. $(CP) ./src/compat/* $(PKG_BUILD_DIR)/
  43. endef
  44. define Build/Configure
  45. ( cd $(PKG_BUILD_DIR); ./autogen.sh )
  46. $(call Build/Configure/Default)
  47. endef
  48. define Package/fdm/config
  49. source "$(SOURCE)/Config.in"
  50. endef
  51. define Package/fdm/conffiles
  52. /etc/fdm.conf
  53. endef
  54. define Package/fdm/install
  55. $(INSTALL_DIR) $(1)/usr/bin
  56. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  57. $(INSTALL_DIR) $(1)/etc
  58. $(INSTALL_DATA) ./files/etc/* $(1)/etc/
  59. $(INSTALL_DIR) $(1)/opt/fdm
  60. chmod a+rwx $(1)/opt/fdm
  61. endef
  62. define Package/fdm/postinst
  63. #!/bin/sh
  64. if [ -z "$${IPKG_INSTROOT}" ]; then
  65. echo "Creating cron job template for user _fdm..."
  66. (crontab -l -u _fdm 2>/dev/null; echo "# */13 * * * * fdm -q fetch") | crontab -u _fdm -
  67. echo "Please, edit file /etc/fdm.conf and enable cron job!"
  68. fi
  69. exit 0
  70. endef
  71. define Package/fdm/prerm
  72. #!/bin/sh
  73. if [ -z "$${IPKG_INSTROOT}" ]; then
  74. echo "Don't forget disable cron job!"
  75. echo "# crontab -r -u _fdm"
  76. fi
  77. exit 0
  78. endef
  79. $(eval $(call BuildPackage,fdm))