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.1
  14. PKG_RELEASE:=1
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  17. PKG_SOURCE_URL:=http://www.spreadspace.org/tcpproxy/releases/
  18. PKG_MD5SUM:=55126473bcde635f9ee019c6caf19bb7
  19. PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
  20. PKG_LICENSE:=GPL-3.0+
  21. PKG_LICENSE_FILES:=LICENSE
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/tcpproxy
  24. SECTION:=net
  25. CATEGORY:=Network
  26. SUBMENU:=Routing and Redirection
  27. TITLE:=IPv4/IPv6 tcp connection proxy
  28. URL:=http://www.spreadspace.org/tcpproxy/
  29. endef
  30. define Package/tcpproxy/conffiles
  31. /etc/config/tcpproxy
  32. endef
  33. define Package/tcpproxy/description
  34. tcpproxy is a simple tcp connection proxy which combines the features of rinetd and 6tunnel.
  35. tcpproxy supports IPv4 and IPv6 and also supports connections from IPv6 to IPv4 endpoints and vice versa.
  36. endef
  37. define Package/tcpproxy/configure
  38. endef
  39. define Build/Configure
  40. (cd $(PKG_BUILD_DIR)/src; \
  41. touch include.mk; \
  42. echo '#ifndef TCPPROXY_config_h_INCLUDED' > config.h; \
  43. echo '#define TCPPROXY_config_h_INCLUDED' >> config.h; \
  44. echo '' >> config.h; \
  45. echo '#define VERSION_STRING_0 "tcpproxy version '`cat $(PKG_BUILD_DIR)/version`'"' >> config.h; \
  46. echo '#define VERSION_STRING_1 "built on '`hostname`', '`date +"%d.%m.%Y %H:%M:%S %Z"`'"' >> config.h; \
  47. echo '' >> config.h; \
  48. echo '#define TARGET "linux"' >> config.h; \
  49. echo '#define PREFIX "/usr"' >> config.h; \
  50. echo '#define BINDIR "/usr/bin"' >> 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))