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.

71 lines
2.0 KiB

  1. #
  2. # Copyright (C) 2014 OpenWrt.org
  3. #
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=mac-telnet
  6. PKG_VERSION:=2014-09-23
  7. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  8. PKG_SOURCE_PROTO:=git
  9. PKG_SOURCE_URL:=https://github.com/jow-/MAC-Telnet.git
  10. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  11. PKG_SOURCE_VERSION:=269a5d7d53b59a2e4657ad3689e46ac057c22e28
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  13. PKG_LICENSE:=GPL-2.0+
  14. PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
  15. include $(INCLUDE_DIR)/package.mk
  16. TARGET_CFLAGS += -ffunction-sections -fdata-sections $(if $(CONFIG_MACTELNET_PLAIN_SUPPORT),-DTELNET_SUPPORT)
  17. TARGET_LDFLAGS += -Wl,--gc-sections
  18. # 1: name
  19. # 2: executable
  20. define BuildPlugin
  21. define Package/mac-telnet-$(1)
  22. SECTION:=net
  23. CATEGORY:=Network
  24. DEPENDS:=+libubox
  25. TITLE:=MAC-Telnet / MAC-SSH $(1)
  26. URL:=https://github.com/jow-/MAC-Telnet
  27. endef
  28. define Package/mac-telnet-$(1)/description
  29. Open source MAC Telnet client and server utilities for connecting to
  30. Mikrotik RouterOS routers and Linux machines via MAC address.
  31. endef
  32. define Package/mac-telnet-$(1)/install
  33. $(INSTALL_DIR) $$(1)/usr/sbin
  34. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(2) $$(1)/usr/sbin/
  35. $(call Package/mac-telnet-$(1)/install-extra)
  36. endef
  37. $$(eval $$(call BuildPackage,mac-telnet-$(1)))
  38. endef
  39. define Package/mac-telnet-server/config
  40. config MACTELNET_PLAIN_SUPPORT
  41. bool "Include support for plain telnet connections"
  42. depends on PACKAGE_mac-telnet-server
  43. default y
  44. help
  45. Disable this option to only support SSH logins to the
  46. MAC-Telnet server.
  47. endef
  48. define Package/mac-telnet-server/install-extra
  49. $(INSTALL_DIR) $$(1)/etc/init.d
  50. $(INSTALL_BIN) ./files/mactelnet.init $$(1)/etc/init.d/mactelnet
  51. $(INSTALL_DIR) $$(1)/etc/config
  52. $(INSTALL_DATA) ./files/mactelnet.config $$(1)/etc/config/mactelnet
  53. endef
  54. $(eval $(call BuildPlugin,server,mactelnetd))
  55. $(eval $(call BuildPlugin,client,mactelnet))
  56. $(eval $(call BuildPlugin,ping,macping))
  57. $(eval $(call BuildPlugin,discover,mndp))