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.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. include $(INCLUDE_DIR)/package.mk
  20. define Package/tcpproxy
  21. SECTION:=net
  22. CATEGORY:=Network
  23. SUBMENU:=Routing and Redirection
  24. TITLE:=IPv4/IPv6 tcp connection proxy
  25. URL:=http://www.spreadspace.org/tcpproxy/
  26. MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
  27. endef
  28. define Package/tcpproxy/conffiles
  29. /etc/config/tcpproxy
  30. endef
  31. define Package/tcpproxy/description
  32. tcpproxy is a simple tcp connection proxy which combines the features of rinetd and 6tunnel.
  33. tcpproxy supports IPv4 and IPv6 and also supports connections from IPv6 to IPv4 endpoints and vice versa.
  34. endef
  35. define Package/tcpproxy/configure
  36. endef
  37. define Build/Configure
  38. (cd $(PKG_BUILD_DIR)/src; \
  39. touch include.mk; \
  40. echo '#ifndef TCPPROXY_config_h_INCLUDED' > config.h; \
  41. echo '#define TCPPROXY_config_h_INCLUDED' >> config.h; \
  42. echo '' >> config.h; \
  43. echo '#define VERSION_STRING_0 "tcpproxy version '`cat $(PKG_BUILD_DIR)/version`'"' >> config.h; \
  44. echo '#define VERSION_STRING_1 "built on '`hostname`', '`date +"%d.%m.%Y %H:%M:%S %Z"`'"' >> 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 ETCDIR "/etc"' >> config.h; \
  50. echo '#define CONFFILE "/etc/tcpproxy.conf"' >> config.h; \
  51. echo '' >> config.h; \
  52. echo '#endif' >> config.h \
  53. )
  54. endef
  55. define Build/Compile
  56. $(MAKE) -C $(PKG_BUILD_DIR)/src \
  57. $(TARGET_CONFIGURE_OPTS) \
  58. TARGET=Linux \
  59. CFLAGS="$(TARGET_CFLAGS)" \
  60. LDFLAGS="$(TARGET_LDFLAGS)"
  61. $(STRIP) $(PKG_BUILD_DIR)/src/tcpproxy
  62. endef
  63. define Package/tcpproxy/install
  64. $(INSTALL_DIR) $(1)/etc/config
  65. $(INSTALL_DATA) ./files/tcpproxy.config $(1)/etc/config/tcpproxy
  66. $(INSTALL_DIR) $(1)/usr/bin
  67. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(2)/src/tcpproxy $(1)/usr/bin/tcpproxy
  68. $(INSTALL_DIR) $(1)/etc/init.d
  69. $(INSTALL_BIN) ./files/tcpproxy.init $(1)/etc/init.d/tcpproxy
  70. endef
  71. $(eval $(call BuildPackage,tcpproxy))