lxc: use generic autoreconf fixup
[feed/packages.git] / net / tcpproxy / Makefile
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
12 include $(TOPDIR)/rules.mk
13
14 PKG_NAME:=tcpproxy
15 PKG_VERSION:=1.1
16 PKG_RELEASE:=1
17
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>
23 PKG_LICENSE:=GPL-3.0+
24 PKG_LICENSE_FILES:=LICENSE
25 include $(INCLUDE_DIR)/package.mk
26
27
28 define Package/tcpproxy
29 SECTION:=net
30 CATEGORY:=Network
31 SUBMENU:=Routing and Redirection
32 TITLE:=IPv4/IPv6 tcp connection proxy
33 URL:=http://www.spreadspace.org/tcpproxy/
34 endef
35
36 define Package/tcpproxy/conffiles
37 /etc/config/tcpproxy
38 endef
39
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.
43 endef
44
45 define Package/tcpproxy/configure
46 endef
47
48 define Build/Configure
49 (cd $(PKG_BUILD_DIR)/src; \
50 touch include.mk; \
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 \
64 )
65 endef
66
67 define Build/Compile
68 $(MAKE) -C $(PKG_BUILD_DIR)/src \
69 $(TARGET_CONFIGURE_OPTS) \
70 TARGET=Linux \
71 CFLAGS="$(TARGET_CFLAGS)" \
72 LDFLAGS="$(TARGET_LDFLAGS)"
73 $(STRIP) $(PKG_BUILD_DIR)/src/tcpproxy
74 endef
75
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
83 endef
84
85 $(eval $(call BuildPackage,tcpproxy))