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.

100 lines
2.4 KiB

  1. #
  2. # Copyright (C) 2006-2015 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:=vsftpd
  9. PKG_VERSION:=3.0.4
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://security.appspot.com/downloads/
  13. PKG_HASH:=6b9421bd27e8a6cdeed5b31154f294a20b003a11a26c09500715a0a6b1b86a26
  14. PKG_MAINTAINER:=Cezary Jackiewicz <cezary@eko.one.pl>
  15. PKG_LICENSE:=GPLv2
  16. PKG_CPE_ID:=cpe:/a:beasts:vsftpd
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/vsftpd/Default
  19. SUBMENU:=File Transfer
  20. SECTION:=net
  21. CATEGORY:=Network
  22. TITLE:=Fast and secure FTP server
  23. URL:=https://security.appspot.com/vsftpd.html
  24. endef
  25. define Package/vsftpd
  26. $(call Package/vsftpd/Default)
  27. VARIANT:=notls
  28. TITLE+= (no TLS)
  29. endef
  30. define Package/vsftpd-tls
  31. $(call Package/vsftpd/Default)
  32. VARIANT:=tls
  33. TITLE+= (TLS)
  34. DEPENDS+=+libopenssl
  35. endef
  36. define Package/vsftpd/conffiles
  37. /etc/vsftpd.conf
  38. /etc/vsftpd
  39. endef
  40. Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
  41. ifneq ($(CONFIG_USE_MUSL),)
  42. NLSSTRING:=-lcrypt
  43. else ifneq ($(CONFIG_USE_GLIBC),)
  44. NLSSTRING:=-lcrypt
  45. else
  46. NLSSTRING:=-lcrypt -lnsl
  47. endif
  48. TARGET_CFLAGS += -D_GNU_SOURCE -include fcntl.h
  49. ifeq ($(BUILD_VARIANT),notls)
  50. define Build/Compile
  51. $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
  52. $(MAKE) -C $(PKG_BUILD_DIR) \
  53. CC="$(TARGET_CC)" \
  54. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  55. LDFLAGS="$(TARGET_LDFLAGS)" \
  56. vsftpd
  57. endef
  58. endif
  59. ifeq ($(BUILD_VARIANT),tls)
  60. define Build/Compile
  61. $(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
  62. $(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
  63. $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
  64. $(MAKE) -C $(PKG_BUILD_DIR) \
  65. CC="$(TARGET_CC)" \
  66. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  67. LDFLAGS="$(TARGET_LDFLAGS)" \
  68. vsftpd
  69. endef
  70. endif
  71. define Package/vsftpd/install
  72. $(INSTALL_DIR) $(1)/usr/sbin
  73. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
  74. $(INSTALL_DIR) $(1)/etc
  75. $(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
  76. $(INSTALL_DIR) $(1)/etc/init.d
  77. $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
  78. $(INSTALL_DIR) $(1)/etc/vsftpd
  79. endef
  80. Package/vsftpd-tls/install=$(Package/vsftpd/install)
  81. $(eval $(call BuildPackage,vsftpd))
  82. $(eval $(call BuildPackage,vsftpd-tls))