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.

94 lines
2.2 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.2
  10. PKG_RELEASE:=6
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://security.appspot.com/downloads/
  13. PKG_MD5SUM:=8b00c749719089401315bd3c44dddbb2
  14. PKG_LICENSE:=GPLv2
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/vsftpd/Default
  18. SUBMENU:=File Transfer
  19. SECTION:=net
  20. CATEGORY:=Network
  21. TITLE:=A fast and secure FTP server
  22. URL:=http://vsftpd.beasts.org/
  23. MAINTAINER:=Cezary Jackiewicz <cezary@eko.one.pl>
  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. endef
  39. Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
  40. ifneq ($(CONFIG_USE_MUSL),)
  41. NLSSTRING:=-lcrypt
  42. else
  43. NLSSTRING:=-lcrypt -lnsl
  44. endif
  45. ifeq ($(BUILD_VARIANT),notls)
  46. define Build/Compile
  47. $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
  48. $(MAKE) -C $(PKG_BUILD_DIR) \
  49. CC="$(TARGET_CC)" \
  50. CFLAGS="$(TARGET_CFLAGS)" \
  51. LDFLAGS="$(TARGET_LDFLAGS)" \
  52. vsftpd
  53. endef
  54. endif
  55. ifeq ($(BUILD_VARIANT),tls)
  56. define Build/Compile
  57. $(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
  58. $(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
  59. $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
  60. $(MAKE) -C $(PKG_BUILD_DIR) \
  61. CC="$(TARGET_CC)" \
  62. CFLAGS="$(TARGET_CFLAGS)" \
  63. LDFLAGS="$(TARGET_LDFLAGS)" \
  64. vsftpd
  65. endef
  66. endif
  67. define Package/vsftpd/install
  68. $(INSTALL_DIR) $(1)/usr/sbin
  69. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
  70. $(INSTALL_DIR) $(1)/etc
  71. $(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
  72. $(INSTALL_DIR) $(1)/etc/init.d
  73. $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
  74. endef
  75. Package/vsftpd-tls/install=$(Package/vsftpd/install)
  76. $(eval $(call BuildPackage,vsftpd))
  77. $(eval $(call BuildPackage,vsftpd-tls))