2 # Copyright (C) 2010 Christian Pointner,
3 # <equinox@spreadspace.org>
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
8 # This Makefile builds tcpproxy Package for OpenWRT
12 include $(TOPDIR
)/rules.mk
18 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
19 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
20 PKG_SOURCE_URL
:=http
://www.spreadspace.org
/tcpproxy
/releases
/
21 PKG_MD5SUM
:=55126473bcde635f9ee019c6caf19bb7
22 PKG_MAINTAINER
:=Christian Pointner
<equinox@spreadspace.org
>
24 PKG_LICENSE_FILES
:=LICENSE
25 include $(INCLUDE_DIR
)/package.mk
28 define Package
/tcpproxy
31 SUBMENU
:=Routing and Redirection
32 TITLE
:=IPv4
/IPv6 tcp connection proxy
33 URL
:=http
://www.spreadspace.org
/tcpproxy
/
36 define Package
/tcpproxy
/conffiles
40 define Package
/tcpproxy
/description
41 tcpproxy is a simple tcp connection proxy which combines the features of rinetd and
6tunnel.
42 tcpproxy supports IPv4 and IPv6 and also supports connections from IPv6 to IPv4 endpoints and vice versa.
45 define Package
/tcpproxy
/configure
48 define Build
/Configure
49 (cd
$(PKG_BUILD_DIR
)/src
; \
51 echo
'#ifndef TCPPROXY_config_h_INCLUDED' > config.h
; \
52 echo
'#define TCPPROXY_config_h_INCLUDED' >> config.h
; \
53 echo
'' >> config.h
; \
54 echo
'#define VERSION_STRING_0 "tcpproxy version '`cat $(PKG_BUILD_DIR)/version`'"' >> config.h
; \
55 echo
'#define VERSION_STRING_1 "built on '`hostname`', '`date +"%d.%m.%Y %H:%M:%S %Z"`'"' >> config.h
; \
56 echo
'' >> config.h
; \
57 echo
'#define TARGET "linux"' >> config.h
; \
58 echo
'#define PREFIX "/usr"' >> config.h
; \
59 echo
'#define BINDIR "/usr/bin"' >> config.h
; \
60 echo
'#define ETCDIR "/etc"' >> config.h
; \
61 echo
'#define CONFFILE "/etc/tcpproxy.conf"' >> config.h
; \
62 echo
'' >> config.h
; \
63 echo
'#endif' >> config.h \
68 $(MAKE
) -C
$(PKG_BUILD_DIR
)/src \
69 $(TARGET_CONFIGURE_OPTS
) \
71 CFLAGS
="$(TARGET_CFLAGS)" \
72 LDFLAGS
="$(TARGET_LDFLAGS)"
73 $(STRIP
) $(PKG_BUILD_DIR
)/src
/tcpproxy
76 define Package
/tcpproxy
/install
77 $(INSTALL_DIR
) $(1)/etc
/config
78 $(INSTALL_DATA
) .
/files
/tcpproxy.config
$(1)/etc
/config
/tcpproxy
79 $(INSTALL_DIR
) $(1)/usr
/bin
80 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/$(2)/src
/tcpproxy
$(1)/usr
/bin
/tcpproxy
81 $(INSTALL_DIR
) $(1)/etc
/init.d
82 $(INSTALL_BIN
) .
/files
/tcpproxy.init
$(1)/etc
/init.d
/tcpproxy
85 $(eval
$(call BuildPackage
,tcpproxy
))