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.

84 lines
2.5 KiB

  1. #
  2. # Copyright (C) 2010 Christian Pointner,
  3. # <equinox@spreadspace.org>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. # This Makefile builds tcpproxy Package for OpenWRT
  9. #
  10. # $Id: $
  11. include $(TOPDIR)/rules.mk
  12. PKG_NAME:=tcpproxy
  13. PKG_VERSION:=1.2
  14. PKG_RELEASE:=4
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:=http://www.spreadspace.org/tcpproxy/releases/
  17. PKG_HASH:=446104b3abefda73b1255e5197702acbeb36b3aada251ad39e1e5ab55292683b
  18. PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
  19. PKG_LICENSE:=GPL-3.0-or-later
  20. PKG_LICENSE_FILES:=LICENSE
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/tcpproxy
  23. SECTION:=net
  24. CATEGORY:=Network
  25. SUBMENU:=Routing and Redirection
  26. TITLE:=IPv4/IPv6 tcp connection proxy
  27. URL:=http://www.spreadspace.org/tcpproxy/
  28. endef
  29. define Package/tcpproxy/conffiles
  30. /etc/config/tcpproxy
  31. endef
  32. define Package/tcpproxy/description
  33. tcpproxy is a simple tcp connection proxy which combines the features of rinetd and 6tunnel.
  34. tcpproxy supports IPv4 and IPv6 and also supports connections from IPv6 to IPv4 endpoints and vice versa.
  35. endef
  36. define Package/tcpproxy/configure
  37. endef
  38. define Build/Configure
  39. (cd $(PKG_BUILD_DIR)/src; \
  40. touch include.mk; \
  41. echo '#ifndef TCPPROXY_config_h_INCLUDED' > config.h; \
  42. echo '#define TCPPROXY_config_h_INCLUDED' >> config.h; \
  43. echo '' >> config.h; \
  44. echo '#define VERSION_STRING_0 "tcpproxy version '`cat $(PKG_BUILD_DIR)/version`'"' >> config.h; \
  45. echo '' >> config.h; \
  46. echo '#define TARGET "linux"' >> config.h; \
  47. echo '#define PREFIX "/usr"' >> config.h; \
  48. echo '#define BINDIR "/usr/bin"' >> config.h; \
  49. echo '#define SYSTEMDDIR "/tmp"' >> config.h; \
  50. echo '#define ETCDIR "/etc"' >> config.h; \
  51. echo '#define CONFFILE "/etc/tcpproxy.conf"' >> config.h; \
  52. echo '' >> config.h; \
  53. echo '#endif' >> config.h \
  54. )
  55. endef
  56. define Build/Compile
  57. $(MAKE) -C $(PKG_BUILD_DIR)/src \
  58. $(TARGET_CONFIGURE_OPTS) \
  59. TARGET=Linux \
  60. CFLAGS="$(TARGET_CFLAGS)" \
  61. LDFLAGS="$(TARGET_LDFLAGS)"
  62. $(STRIP) $(PKG_BUILD_DIR)/src/tcpproxy
  63. endef
  64. define Package/tcpproxy/install
  65. $(INSTALL_DIR) $(1)/etc/config
  66. $(INSTALL_DATA) ./files/tcpproxy.config $(1)/etc/config/tcpproxy
  67. $(INSTALL_DIR) $(1)/usr/bin
  68. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(2)/src/tcpproxy $(1)/usr/bin/tcpproxy
  69. $(INSTALL_DIR) $(1)/etc/init.d
  70. $(INSTALL_BIN) ./files/tcpproxy.init $(1)/etc/init.d/tcpproxy
  71. endef
  72. $(eval $(call BuildPackage,tcpproxy))