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.

85 lines
2.6 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:=1
  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+
  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 '#define VERSION_STRING_1 "built on '`hostname`', '`date +"%d.%m.%Y %H:%M:%S %Z"`'"' >> config.h; \
  46. echo '' >> config.h; \
  47. echo '#define TARGET "linux"' >> config.h; \
  48. echo '#define PREFIX "/usr"' >> config.h; \
  49. echo '#define BINDIR "/usr/bin"' >> config.h; \
  50. echo '#define SYSTEMDDIR "/tmp"' >> config.h; \
  51. echo '#define ETCDIR "/etc"' >> config.h; \
  52. echo '#define CONFFILE "/etc/tcpproxy.conf"' >> config.h; \
  53. echo '' >> config.h; \
  54. echo '#endif' >> config.h \
  55. )
  56. endef
  57. define Build/Compile
  58. $(MAKE) -C $(PKG_BUILD_DIR)/src \
  59. $(TARGET_CONFIGURE_OPTS) \
  60. TARGET=Linux \
  61. CFLAGS="$(TARGET_CFLAGS)" \
  62. LDFLAGS="$(TARGET_LDFLAGS)"
  63. $(STRIP) $(PKG_BUILD_DIR)/src/tcpproxy
  64. endef
  65. define Package/tcpproxy/install
  66. $(INSTALL_DIR) $(1)/etc/config
  67. $(INSTALL_DATA) ./files/tcpproxy.config $(1)/etc/config/tcpproxy
  68. $(INSTALL_DIR) $(1)/usr/bin
  69. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(2)/src/tcpproxy $(1)/usr/bin/tcpproxy
  70. $(INSTALL_DIR) $(1)/etc/init.d
  71. $(INSTALL_BIN) ./files/tcpproxy.init $(1)/etc/init.d/tcpproxy
  72. endef
  73. $(eval $(call BuildPackage,tcpproxy))