Browse Source

new package: transproxy

Waldemar Brodkorb 11 years ago
parent
commit
f2a1d214b7

+ 29 - 0
package/transproxy/Makefile

@@ -0,0 +1,29 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		transproxy
+PKG_VERSION:=		1.6
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		02cc1160a9db9c49a40491f890083044
+PKG_DESCR:=		transparent HTTP proxy
+PKG_SECTION:=		proxy
+PKG_DEPENDS:=		iptables kmod-ip-nf-target-redirect
+PKG_URL:=		http://sourceforge.net/projects/transproxy/
+PKG_SITES:=		${MASTER_SITE_SOURCEFORGE:=transproxy/1.6/}
+
+DISTFILES:=             ${PKG_NAME}-${PKG_VERSION}.tgz
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,TRANSPROXY,transproxy,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIG_STYLE:=		manual
+
+transproxy-install:
+	$(INSTALL_DIR) $(IDIR_TRANSPROXY)/usr/sbin
+	$(INSTALL_BIN) $(WRKINST)/usr/sbin/tproxy* \
+		$(IDIR_TRANSPROXY)/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 35 - 0
package/transproxy/patches/patch-Makefile

@@ -0,0 +1,35 @@
+--- transproxy-1.6.orig/Makefile	2004-03-31 14:19:34.000000000 +0200
++++ transproxy-1.6/Makefile	2012-10-23 11:08:25.000000000 +0200
+@@ -64,17 +64,17 @@ OPTIONS += -DIPTABLES
+ #OPTIONS += -DHAVE_GETOPT_H
+ 
+ # You may need to touch PREFIX, CC and CFLAGS.
+-PREFIX = /usr/local
+-INSTALL_PROGRAM = install -c -m 555 -o bin -g bin
+-INSTALL_MAN = install -c -m 444 -o bin -g bin
++PREFIX ?= $(DESTDIR)/usr
++INSTALL_PROGRAM = install -c -m 555
++INSTALL_MAN = install -c -m 444
+ 
+ # Some make's don't define this.
+ RM      = rm -f
+ 
+ # Should be OK for GNU gcc.
+-CC      = gcc
+-CFLAGS  = -O2 -Wall
+-LDFLAGS = -s
++CC      ?= gcc
++CFLAGS  ?= -O2 -Wall
++LDFLAGS ?= -s
+ 
+ # For using BIND resolver instead of system resolver.
+ #LIBS    += -lresolv	# Really old Linux has this.
+@@ -103,7 +103,7 @@ clobber dist-clean:	clean
+ 	$(RM) tproxy
+ 
+ install:	tproxy
++	mkdir -p $(PREFIX)/sbin
+ 	$(INSTALL_PROGRAM) tproxy $(PREFIX)/sbin
+ 	$(INSTALL_PROGRAM) tproxyrun $(PREFIX)/sbin
+ 	$(INSTALL_PROGRAM) tproxywatch $(PREFIX)/sbin
+-	$(INSTALL_MAN) tproxy.8 $(PREFIX)/man/man8

+ 26 - 0
package/transproxy/patches/patch-Makefile.orig

@@ -0,0 +1,26 @@
+--- transproxy-1.6.orig/Makefile	2004-03-31 14:19:34.000000000 +0200
++++ transproxy-1.6/Makefile	2012-10-23 11:07:54.000000000 +0200
+@@ -64,17 +64,17 @@ OPTIONS += -DIPTABLES
+ #OPTIONS += -DHAVE_GETOPT_H
+ 
+ # You may need to touch PREFIX, CC and CFLAGS.
+-PREFIX = /usr/local
+-INSTALL_PROGRAM = install -c -m 555 -o bin -g bin
+-INSTALL_MAN = install -c -m 444 -o bin -g bin
++PREFIX ?= $(DESTDIR)/usr
++INSTALL_PROGRAM = install -c -m 555
++INSTALL_MAN = install -c -m 444
+ 
+ # Some make's don't define this.
+ RM      = rm -f
+ 
+ # Should be OK for GNU gcc.
+-CC      = gcc
+-CFLAGS  = -O2 -Wall
+-LDFLAGS = -s
++CC      ?= gcc
++CFLAGS  ?= -O2 -Wall
++LDFLAGS ?= -s
+ 
+ # For using BIND resolver instead of system resolver.
+ #LIBS    += -lresolv	# Really old Linux has this.

+ 29 - 0
package/transproxy/patches/patch-tproxyrun

@@ -0,0 +1,29 @@
+--- transproxy-1.6.orig/tproxyrun	2004-03-31 14:19:34.000000000 +0200
++++ transproxy-1.6/tproxyrun	2012-10-24 09:06:52.000000000 +0200
+@@ -50,7 +50,7 @@ Linux)
+ 	# I really have no idea about Linux, are these kernel versions correct
+ 	# for the type if network filtering supported? Is there a surefire way?
+ 	case `uname -r` in
+-	2.[3456789].*)
++	3.*|2.[3456789].*)
+ 		iptables -t nat -A PREROUTING -p tcp -d localhost --dport 80 -j ACCEPT
+ 		iptables -t nat -A PREROUTING -p tcp -d "$HOSTNAME1" --dport 80 -j ACCEPT
+ 		if [ -n "$HOSTNAME2" ]; then
+@@ -106,7 +106,7 @@ if [ -n "$FORCE_URL" ]; then
+ fi
+ 
+ # Start transproxy running.
+-/usr/local/sbin/tproxy -s "$TRANSPROXYPORT" -d $CMD "$PROXYNAME" "$PROXYPORT"
++/usr/sbin/tproxy -s "$TRANSPROXYPORT" -d $CMD "$PROXYNAME" "$PROXYPORT"
+ 
+ # Remove the filter rules.
+ case `uname` in
+@@ -121,7 +121,7 @@ FreeBSD)
+ 	;;
+ Linux)
+ 	case `uname -r` in
+-	2.[3456789].*)
++	3.*|2.[3456789].*)
+ 		iptables -t nat -D PREROUTING -p tcp -d localhost --dport 80 -j ACCEPT
+ 		iptables -t nat -D PREROUTING -p tcp -d "$HOSTNAME1" --dport 80 -j ACCEPT
+ 		if [ -n "$HOSTNAME2" ]; then