1
0

Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.7
  10. PKG_RELEASE:=1
  11. PKG_LICENSE:=BSD-2-Clause
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=@SF/fdm
  14. PKG_MD5SUM:=aea0421571e8f3ec8f747a5d72c84348
  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. MAKE_FLAGS += \
  34. PREFIX="/usr"\
  35. $(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
  36. define Build/Prepare
  37. $(call Build/Prepare/Default)
  38. $(CP) ./src/compat/* $(PKG_BUILD_DIR)/
  39. endef
  40. define Package/fdm/config
  41. source "$(SOURCE)/Config.in"
  42. endef
  43. define Package/fdm/conffiles
  44. /etc/fdm.conf
  45. endef
  46. define Package/fdm/install
  47. $(INSTALL_DIR) $(1)/usr/bin
  48. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  49. $(INSTALL_DIR) $(1)/etc
  50. $(INSTALL_DATA) ./files/etc/* $(1)/etc/
  51. $(INSTALL_DIR) $(1)/opt/fdm
  52. chmod a+rwx $(1)/opt/fdm
  53. endef
  54. define Package/fdm/postinst
  55. #!/bin/sh
  56. if [ -z "$${IPKG_INSTROOT}" ]; then
  57. echo "Creating cron job template for user _fdm..."
  58. (crontab -l -u _fdm 2>/dev/null; echo "# */13 * * * * fdm -q fetch") | crontab -u _fdm -
  59. echo "Please, edit file /etc/fdm.conf and enable cron job!"
  60. fi
  61. exit 0
  62. endef
  63. define Package/fdm/prerm
  64. #!/bin/sh
  65. if [ -z "$${IPKG_INSTROOT}" ]; then
  66. echo "Don't forget disable cron job!"
  67. echo "# crontab -r -u _fdm"
  68. fi
  69. exit 0
  70. endef
  71. $(eval $(call BuildPackage,fdm))