summaryrefslogtreecommitdiff
path: root/net/vpnc
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>2006-01-03 21:48:09 +0000
committerhubertf <hubertf@pkgsrc.org>2006-01-03 21:48:09 +0000
commit4e3b054b94a66267b6a9efc1258414f2a413dc0e (patch)
tree34343b36332d6305abdce40b9fb406fb74fc564b /net/vpnc
parent07d9a333bb103844be347a16f6cc9f16d05e4749 (diff)
downloadpkgsrc-4e3b054b94a66267b6a9efc1258414f2a413dc0e.tar.gz
Update vpnc to 0.3.3. Changes:
* ignore \r in config files * (hopefuly) fixed 64bit bugs (Nicolas Boichat and Zach Brown) * added support for "Split-Net" Routing * introduced vpnc-script and removed vpnc-connect * always search for configfiles in /etc/vpnc/ expect if the filename contains at least one "/" * only read /etc/vpnc/default.conf and /etc/vpnc.conf if no other configfiles are provided * various other fixes contributed by Anton Altaparmakov, Randy Chou, "krabat", Andre Vanha and Nikolay Sturm
Diffstat (limited to 'net/vpnc')
-rw-r--r--net/vpnc/Makefile19
-rw-r--r--net/vpnc/PLIST4
-rw-r--r--net/vpnc/distinfo11
-rw-r--r--net/vpnc/patches/patch-aa36
-rw-r--r--net/vpnc/patches/patch-ac109
5 files changed, 157 insertions, 22 deletions
diff --git a/net/vpnc/Makefile b/net/vpnc/Makefile
index f0672b31ae9..2541094a96f 100644
--- a/net/vpnc/Makefile
+++ b/net/vpnc/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2005/11/01 03:40:34 tv Exp $
+# $NetBSD: Makefile,v 1.9 2006/01/03 21:48:17 hubertf Exp $
#
-DISTNAME= vpnc-0.3.2
+DISTNAME= vpnc-0.3.3
CATEGORIES= net security
MASTER_SITES= http://www.unix-ag.uni-kl.de/~massar/vpnc/
@@ -15,15 +15,22 @@ USE_TOOLS+= gmake
BUILD_TARGET= vpnc
INSTALLATION_DIRS= bin man/man8
+USE_PKGINSTALL= yes
+EGDIR= ${PREFIX}/share/examples/${PKGBASE}
+CONF_FILES+= ${EGDIR}/vpnc.conf ${PKG_SYSCONFDIR}/vpnc.conf
+CONF_FILES+= ${EGDIR}/vpnc-script ${PKG_SYSCONFDIR}/vpnc-script
+CONF_FILES_MODE= 755 # vpn-script must be executable!
+
do-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/vpnc
+ ${INSTALL_DATA_DIR} ${EGDIR}
+ :
${INSTALL_PROGRAM} ${WRKSRC}/vpnc ${PREFIX}/bin
- ${INSTALL_SCRIPT} ${WRKSRC}/vpnc-connect ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/vpnc-disconnect ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/vpnc.8 ${PREFIX}/man/man8
- ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/vpnc
${INSTALL_MAN} ${WRKSRC}/README ${PREFIX}/share/doc/vpnc
- ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/vpnc
- ${INSTALL_MAN} ${WRKSRC}/vpnc.conf ${PREFIX}/share/examples/vpnc
+ ${INSTALL_MAN} ${WRKSRC}/vpnc.conf ${EGDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/vpnc-script ${EGDIR}
.include "../../security/libgcrypt/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/net/vpnc/PLIST b/net/vpnc/PLIST
index a9ef3506b4d..17833a13a00 100644
--- a/net/vpnc/PLIST
+++ b/net/vpnc/PLIST
@@ -1,9 +1,9 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2004/09/20 22:58:52 wiz Exp $
+@comment $NetBSD: PLIST,v 1.2 2006/01/03 21:48:17 hubertf Exp $
bin/vpnc
-bin/vpnc-connect
bin/vpnc-disconnect
man/man8/vpnc.8
share/doc/vpnc/README
share/examples/vpnc/vpnc.conf
+share/examples/vpnc/vpnc-script
@dirrm share/examples/vpnc
@dirrm share/doc/vpnc
diff --git a/net/vpnc/distinfo b/net/vpnc/distinfo
index 603f2511440..1572116133a 100644
--- a/net/vpnc/distinfo
+++ b/net/vpnc/distinfo
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.3 2005/02/24 12:14:06 agc Exp $
+$NetBSD: distinfo,v 1.4 2006/01/03 21:48:17 hubertf Exp $
-SHA1 (vpnc-0.3.2.tar.gz) = 71276f606ff56108797654cf4711bef4b3c34d88
-RMD160 (vpnc-0.3.2.tar.gz) = 50700b7abdb5699235febf794578abc4c0b6b930
-Size (vpnc-0.3.2.tar.gz) = 56669 bytes
-SHA1 (patch-aa) = f4bd96493ff8be6e500d425d40d6403509eee6b2
+SHA1 (vpnc-0.3.3.tar.gz) = 95559e1c5b1f4bc78dc1a0b9f95e1a2d65a84c0a
+RMD160 (vpnc-0.3.3.tar.gz) = ffcb229fb8cac18f8d6dea0e67f88cec420f31da
+Size (vpnc-0.3.3.tar.gz) = 59939 bytes
+SHA1 (patch-aa) = b7645f093f1c3bfbdf81871b3582273a1e6ddda0
SHA1 (patch-ab) = e14e97c977badc03501c9206c6c2e3c89b20d9a7
+SHA1 (patch-ac) = 5eb5aca439e3fbc2404a15f74403f024e5fc386a
diff --git a/net/vpnc/patches/patch-aa b/net/vpnc/patches/patch-aa
index 30bebfe7932..8a6172d02be 100644
--- a/net/vpnc/patches/patch-aa
+++ b/net/vpnc/patches/patch-aa
@@ -1,15 +1,33 @@
-$NetBSD: patch-aa,v 1.2 2004/11/26 23:03:54 hubertf Exp $
+$NetBSD: patch-aa,v 1.3 2006/01/03 21:48:17 hubertf Exp $
---- config.c.orig 2004-11-22 01:11:48.000000000 +0100
+--- config.c.orig 2005-05-01 16:06:36.000000000 -0400
+++ config.c
-@@ -484,8 +484,8 @@ void do_config(int argc, char **argv)
- }
+@@ -125,7 +125,7 @@ static const char *config_def_app_versio
+
+ static const char *config_def_script(void)
+ {
+- return "/etc/vpnc/vpnc-script";
++ return PKG_SYSCONFDIR "/vpnc-script";
+ }
+
+ static const char *config_def_pid_file(void)
+@@ -325,7 +325,7 @@ static void read_config_file(const char
+ if (index(name, '/'))
+ realname = strdup(name);
+ else
+- asprintf(&realname, "/etc/vpnc/%s", name);
++ asprintf(&realname, PKG_SYSCONFDIR "/vpnc/%s", name);
+ f = fopen(realname, "r");
+ if (missingok && f == NULL && errno == ENOENT) {
+ free(realname);
+@@ -520,8 +520,8 @@ void do_config(int argc, char **argv)
}
-- read_config_file("/etc/vpnc/default.conf", config, 1);
-- read_config_file("/etc/vpnc.conf", config, 1);
-+ read_config_file(PKG_SYSCONFDIR "/vpnc/default.conf", config, 1);
-+ read_config_file(PKG_SYSCONFDIR "/vpnc.conf", config, 1);
+ if (!got_conffile) {
+- read_config_file("/etc/vpnc/default.conf", config, 1);
+- read_config_file("/etc/vpnc.conf", config, 1);
++ read_config_file(PKG_SYSCONFDIR "/vpnc/default.conf", config, 1);
++ read_config_file(PKG_SYSCONFDIR "/vpnc.conf", config, 1);
+ }
if (!print_config) {
- for (i = 0; config_names[i].name != NULL; i++)
diff --git a/net/vpnc/patches/patch-ac b/net/vpnc/patches/patch-ac
new file mode 100644
index 00000000000..3f04ffdff11
--- /dev/null
+++ b/net/vpnc/patches/patch-ac
@@ -0,0 +1,109 @@
+$NetBSD: patch-ac,v 1.1 2006/01/03 21:48:17 hubertf Exp $
+
+--- vpnc-script.orig 2006-01-03 22:36:27.000000000 +0100
++++ vpnc-script
+@@ -19,10 +19,12 @@
+ #set -x
+
+ OS="`uname -s`"
+-DEFAULT_ROUTE_FILE=/var/run/vpnc/defaultroute
+-RESOLV_CONF_BACKUP=/var/run/vpnc/resolv.conf-backup
++STATEDIR=/var/run/vpnc
++DEFAULT_ROUTE_FILE=$STATEDIR/defaultroute
++RESOLV_CONF_BACKUP=$STATEDIR/resolv.conf-backup
+
+-IPROUTE="`which ip 2> /dev/null`"
++# stupid SunOS: no blubber in /usr/local/bin ... (on stdout)
++IPROUTE="`which ip | grep '^/' 2> /dev/null`"
+
+ if [ "$OS" = "Linux" ]; then
+ ifconfig_syntax_ptp="pointopoint"
+@@ -56,7 +58,9 @@ do_pre_init() {
+ fi
+ fi
+ elif [ "$OS" = "FreeBSD" ]; then
+- :
++ if [ ! -e /dev/tun ]; then
++ kldload if_tun
++ fi
+ elif [ "$OS" = "NetBSD" ]; then
+ :
+ elif [ "$OS" = "OpenBSD" ]; then
+@@ -64,6 +68,8 @@ do_pre_init() {
+ elif [ "$OS" = "SunOS" ]; then
+ :
+ fi
++
++ mkdir -p $STATEDIR
+ }
+
+ do_ifconfig() {
+@@ -72,7 +78,7 @@ do_ifconfig() {
+
+ if [ -n "$IPROUTE" ]; then
+ fix_ip_get_output () {
+- sed 's/cache//;s/metric[0-9]\+ [0-9]\+//g'
++ sed 's/cache//;s/metric \?[0-9]\+ [0-9]\+//g'
+ }
+
+ set_vpngateway_route() {
+@@ -117,7 +123,10 @@ if [ -n "$IPROUTE" ]; then
+ }
+ else
+ get_default_gw() {
+- netstat -r -n | grep '^0.0.0.0' | awk '{print $2}'
++ # Let's assume the first default gateway is IPv4...
++ # (On NetBSD '-f inet' and on Linux and probably Solaris,
++ # '-A inet' could be used to make sure... - HF)
++ netstat -rn | awk '/^(default|0.0.0.0)/{ print $2 ; exit } '
+ }
+
+ set_vpngateway_route() {
+@@ -131,7 +140,7 @@ else
+ set_default_route() {
+ DEFAULTGW="`get_default_gw`"
+ echo "$DEFAULTGW" > "$DEFAULT_ROUTE_FILE"
+- route $route_syntax_del default
++ route $route_syntax_del default "$DEFAULTGW"
+ route add default $route_syntax_gw "$INTERNAL_IP4_ADDRESS"
+ }
+
+@@ -219,11 +228,13 @@ do_connect() {
+ do_ifconfig
+ set_vpngateway_route
+ if [ -n "$CISCO_SPLIT_INC" ]; then
+- for ((i = 0 ; i < CISCO_SPLIT_INC ; i++ )) ; do
++ i=0
++ while [ $i -lt $CISCO_SPLIT_INC ] ; do
+ eval NETWORK="\${CISCO_SPLIT_INC_${i}_ADDR}"
+ eval NETMASK="\${CISCO_SPLIT_INC_${i}_MASK}"
+ eval NETMASKLEN="\${CISCO_SPLIT_INC_${i}_MASKLEN}"
+ set_network_route "$NETWORK" "$NETMASK" "$NETMASKLEN"
++ i=`expr $i + 1`
+ done
+ for i in $INTERNAL_IP4_DNS ; do
+ set_network_route "$i" "255.255.255.255" "32"
+@@ -239,11 +250,13 @@ do_connect() {
+
+ do_disconnect() {
+ if [ -n "$CISCO_SPLIT_INC" ]; then
+- for ((i = 0 ; i < CISCO_SPLIT_INC ; i++ )) ; do
++ i=0
++ while [ $i -lt $CISCO_SPLIT_INC ] ; do
+ eval NETWORK="\${CISCO_SPLIT_INC_${i}_ADDR}"
+ eval NETMASK="\${CISCO_SPLIT_INC_${i}_MASK}"
+ eval NETMASKLEN="\${CISCO_SPLIT_INC_${i}_MASKLEN}"
+ del_network_route "$NETWORK" "$NETMASK" "$NETMASKLEN"
++ i=`expr $i + 1`
+ done
+ for i in $INTERNAL_IP4_DNS ; do
+ del_network_route "$i" "255.255.255.255" "32"
+@@ -260,6 +273,8 @@ do_disconnect() {
+ if [ -n "$INTERNAL_IP4_DNS" ]; then
+ reset_resolvconf
+ fi
++
++ rm -fr -- $STATEDIR
+ }
+
+ ####