Update vpnc to 0.4.0, thanks to Swen Kuhnlein
authorFlorian Fainelli <florian@openwrt.org>
Mon, 26 Feb 2007 22:01:03 +0000 (22:01 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Mon, 26 Feb 2007 22:01:03 +0000 (22:01 +0000)
SVN-Revision: 6393

net/vpnc/Makefile
net/vpnc/patches/01-cross.patch
net/vpnc/patches/02-vpn_script.patch [new file with mode: 0644]

index 7f8b30e..6156171 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vpnc
-PKG_VERSION:=0.3.3
+PKG_VERSION:=0.4.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.unix-ag.uni-kl.de/~massar/vpnc/
-PKG_MD5SUM:=e7518cff21326fe7eb9795b60c25ae6a
+PKG_MD5SUM:=604807e7dd90fce00a4e2344ee29c76d
 PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
@@ -31,7 +31,7 @@ define Package/vpnc
 endef
 
 define Package/vpnc/conffiles
-/etc/vpnc/vpnc.conf
+/etc/vpnc/default.conf
 /etc/vpnc/vpnc-script
 endef
 
@@ -52,7 +52,7 @@ define Package/vpnc/install
                $(PKG_INSTALL_DIR)/usr/sbin/vpnc-disconnect \
                $(1)/usr/sbin/
        install -d -m0700 $(1)/etc/vpnc
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vpnc/vpnc.conf $(1)/etc/vpnc/
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vpnc/default.conf $(1)/etc/vpnc/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/vpnc/vpnc-script $(1)/etc/vpnc/
 endef
 
index ff96a83..0ee9a4e 100644 (file)
@@ -1,44 +1,28 @@
-diff -Nur vpnc-0.3.3/Makefile vpnc-0.3.3.patched/Makefile
---- vpnc-0.3.3/Makefile        2005-05-01 22:30:35.000000000 +0200
-+++ vpnc-0.3.3.patched/Makefile        2005-12-23 23:43:55.222055250 +0100
-@@ -17,31 +17,32 @@
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+diff -Nur vpnc-0.4.0/Makefile vpnc-0.4.0.patched/Makefile
+--- vpnc-0.4.0/Makefile        2007-02-19 21:51:12.000000000 +0100
++++ vpnc-0.4.0.patched/Makefile        2007-02-25 10:40:25.000000000 +0100
+@@ -20,7 +20,7 @@
+ # $Id: Makefile 148 2007-02-19 20:51:14Z Maurice Massar $
  
  DESTDIR=
 -PREFIX=/usr/local
 +PREFIX=/usr
  ETCDIR=/etc/vpnc
+ BINDIR=$(PREFIX)/bin
  SBINDIR=$(PREFIX)/sbin
- MANDIR=$(PREFIX)/share/man
+@@ -35,12 +35,11 @@
+ RELEASE_VERSION := $(shell cat VERSION)
  
  CC=gcc
--CFLAGS=-W -Wall -O -g '-DVERSION="$(shell cat VERSION)"' $(shell libgcrypt-config --cflags)
--LDFLAGS=-g $(shell libgcrypt-config --libs)
-+CFLAGS=-W -Wall -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include $(OFLAGS) '-DVERSION="$(shell cat VERSION)"'
-+LDFLAGS=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -lgcrypt -lgpg-error
+-CFLAGS += -W -Wall -O3 -Wmissing-declarations -Wwrite-strings -g
++CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include $(OFLAGS) '-DVERSION="$(shell cat VERSION)"'
+ CPPFLAGS = -DVERSION=\"$(VERSION)\"
+-LDFLAGS = -g $(shell libgcrypt-config --libs)
+-CFLAGS +=  $(shell libgcrypt-config --cflags)
++LDFLAGS = -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -lgcrypt -lgpg-error
  
--ifeq ($(shell uname -s), Linux)
-+OS=$(shell uname -s)
-+ifeq ($(OS), Linux)
- SYSDEP=sysdep-linux.o
- endif
--ifeq ($(shell uname -s), FreeBSD)
-+ifeq ($(OS), FreeBSD)
- CFLAGS += -DSOCKADDR_IN_SIN_LEN -DHAVE_SA_LEN
- SYSDEP=sysdep-bsd.o
- endif
--ifeq ($(shell uname -s), NetBSD)
-+ifeq ($(OS), NetBSD)
- CFLAGS += -DSOCKADDR_IN_SIN_LEN -DHAVE_SA_LEN
- SYSDEP=sysdep-bsd.o
- endif
--ifeq ($(shell uname -s), OpenBSD)
-+ifeq ($(OS), OpenBSD)
- CFLAGS += -DSOCKADDR_IN_SIN_LEN -DHAVE_SA_LEN -DNEED_IPLEN_FIX -DNEW_TUN
- SYSDEP=sysdep-bsd.o
- endif
 -ifeq ($(shell uname -s), SunOS)
 +ifeq ($(OS), SunOS)
- CFLAGS += -DNEED_IPLEN_FIX
  LDFLAGS += -lnsl -lresolv -lsocket
- SYSDEP=sysdep-svr4.o
+ endif
diff --git a/net/vpnc/patches/02-vpn_script.patch b/net/vpnc/patches/02-vpn_script.patch
new file mode 100644 (file)
index 0000000..46b408f
--- /dev/null
@@ -0,0 +1,41 @@
+--- vpnc-0.4.0/vpnc-script     2007-02-18 12:52:03.000000000 +0100
++++ vpnc-0.4.0.patched/vpnc-script     2007-02-25 11:34:06.000000000 +0100
+@@ -107,7 +107,7 @@
+ }
+ do_ifconfig() {
+-      ifconfig "$TUNDEV" inet "$INTERNAL_IP4_ADDRESS" $ifconfig_syntax_ptp "$INTERNAL_IP4_ADDRESS" netmask 255.255.255.255 mtu 1412 up
++      ifconfig "$TUNDEV" "$INTERNAL_IP4_ADDRESS" $ifconfig_syntax_ptp "$INTERNAL_IP4_ADDRESS" netmask 255.255.255.255 mtu 1412 up
+ }
+ destroy_tun_device() {
+@@ -388,6 +388,18 @@
+       fi
+ }
++start_vpn_nat() {
++      iptables -A forwarding_rule -o $TUNDEV -j ACCEPT
++      iptables -A forwarding_rule -i $TUNDEV -j ACCEPT
++      iptables -t nat -A postrouting_rule -o $TUNDEV -j MASQUERADE
++}
++
++stop_vpn_nat() {
++      iptables -t nat -D postrouting_rule -o $TUNDEV -j MASQUERADE
++      iptables -D forwarding_rule -i $TUNDEV -j ACCEPT
++      iptables -D forwarding_rule -o $TUNDEV -j ACCEPT
++}
++
+ ####
+ if [ -z "$reason" ]; then
+@@ -401,8 +413,10 @@
+               ;;
+       connect)
+               do_connect
++              start_vpn_nat
+               ;;
+       disconnect)
++              stop_vpn_nat
+               do_disconnect
+               ;;
+       *)