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