1
0

Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.3
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://security.appspot.com/downloads/
  13. PKG_HASH:=9d4d2bf6e6e2884852ba4e69e157a2cecd68c5a7635d66a3a8cf8d898c955ef7
  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:=Fast and secure FTP server
  22. URL:=https://security.appspot.com/vsftpd.html
  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. /etc/vsftpd
  39. endef
  40. Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
  41. ifneq ($(CONFIG_USE_MUSL),)
  42. NLSSTRING:=-lcrypt
  43. else
  44. NLSSTRING:=-lcrypt -lnsl
  45. endif
  46. TARGET_CFLAGS += -D_GNU_SOURCE -include fcntl.h
  47. ifeq ($(BUILD_VARIANT),notls)
  48. define Build/Compile
  49. $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
  50. $(MAKE) -C $(PKG_BUILD_DIR) \
  51. CC="$(TARGET_CC)" \
  52. CFLAGS="$(TARGET_CFLAGS)" \
  53. LDFLAGS="$(TARGET_LDFLAGS)" \
  54. vsftpd
  55. endef
  56. endif
  57. ifeq ($(BUILD_VARIANT),tls)
  58. define Build/Compile
  59. $(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
  60. $(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
  61. $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
  62. $(MAKE) -C $(PKG_BUILD_DIR) \
  63. CC="$(TARGET_CC)" \
  64. CFLAGS="$(TARGET_CFLAGS)" \
  65. LDFLAGS="$(TARGET_LDFLAGS)" \
  66. vsftpd
  67. endef
  68. endif
  69. define Package/vsftpd/install
  70. $(INSTALL_DIR) $(1)/usr/sbin
  71. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
  72. $(INSTALL_DIR) $(1)/etc
  73. $(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
  74. $(INSTALL_DIR) $(1)/etc/init.d
  75. $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
  76. $(INSTALL_DIR) $(1)/etc/vsftpd
  77. endef
  78. Package/vsftpd-tls/install=$(Package/vsftpd/install)
  79. $(eval $(call BuildPackage,vsftpd))
  80. $(eval $(call BuildPackage,vsftpd-tls))