tspc: do not attempt patching the configuration file
This uses SED syntax which is unsupported most of the time, and we copy the sample configuration so we do not really care Signed-off-by: Florian Fainelli <florian@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/packages@39825 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
72ead3138c
commit
37ed46d819
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2006-2011 OpenWrt.org
|
# Copyright (C) 2006-2014 OpenWrt.org
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=tspc
|
PKG_NAME:=tspc
|
||||||
PKG_VERSION:=2.1.1
|
PKG_VERSION:=2.1.1
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
|
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
|
||||||
PKG_SOURCE_URL:=http://ftp.fr.debian.org/debian/pool/main/t/tspc/
|
PKG_SOURCE_URL:=http://ftp.fr.debian.org/debian/pool/main/t/tspc/
|
||||||
@ -33,6 +33,7 @@ endef
|
|||||||
|
|
||||||
MAKE_FLAGS += \
|
MAKE_FLAGS += \
|
||||||
CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/include -I$(PKG_BUILD_DIR)/platform/linux" \
|
CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/include -I$(PKG_BUILD_DIR)/platform/linux" \
|
||||||
|
SED="/bin/true" \
|
||||||
target=linux \
|
target=linux \
|
||||||
all
|
all
|
||||||
|
|
||||||
|
@ -1,8 +1,18 @@
|
|||||||
diff -Nur tspc2/conf/Makefile tspc2.owrt/conf/Makefile
|
--- a/conf/Makefile
|
||||||
--- tspc2/conf/Makefile 2004-03-29 17:37:56.000000000 +0200
|
+++ b/conf/Makefile
|
||||||
+++ tspc2.owrt/conf/Makefile 2007-02-19 16:07:05.000000000 +0100
|
@@ -34,15 +34,15 @@ tspc.conf.sample:
|
||||||
@@ -42,7 +42,7 @@
|
fi
|
||||||
sed -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+$(configdir)+" tspc.conf.in >$(BIN)/tspc.conf.sample; \
|
@if [ -z "$(configdir)" ]; then \
|
||||||
|
if [ -z "$(installdir)" ]; then \
|
||||||
|
- sed -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+`cd ..;pwd`+" tspc.conf.in>$(BIN)/tspc.conf.sample; \
|
||||||
|
+ $(SED) -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+`cd ..;pwd`+" tspc.conf.in>$(BIN)/tspc.conf.sample; \
|
||||||
|
else \
|
||||||
|
- sed -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+$(installdir)+" tspc.conf.in >$(BIN)/tspc.conf.sample; \
|
||||||
|
+ $(SED) -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+$(installdir)+" tspc.conf.in >$(BIN)/tspc.conf.sample; \
|
||||||
|
fi \
|
||||||
|
else \
|
||||||
|
- sed -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+$(configdir)+" tspc.conf.in >$(BIN)/tspc.conf.sample; \
|
||||||
|
+ $(SED) -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+$(configdir)+" tspc.conf.in >$(BIN)/tspc.conf.sample; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- chmod 700 $(BIN)/tspc.conf.sample
|
- chmod 700 $(BIN)/tspc.conf.sample
|
||||||
@ -10,9 +20,8 @@ diff -Nur tspc2/conf/Makefile tspc2.owrt/conf/Makefile
|
|||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
diff -Nur tspc2/conf/tspc.conf.in tspc2.owrt/conf/tspc.conf.in
|
--- a/conf/tspc.conf.in
|
||||||
--- tspc2/conf/tspc.conf.in 2004-06-15 17:01:01.000000000 +0200
|
+++ b/conf/tspc.conf.in
|
||||||
+++ tspc2.owrt/conf/tspc.conf.in 2007-02-19 16:07:05.000000000 +0100
|
|
||||||
@@ -18,13 +18,6 @@
|
@@ -18,13 +18,6 @@
|
||||||
# to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
# to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
# MA 02111-1307 USA
|
# MA 02111-1307 USA
|
||||||
@ -27,7 +36,7 @@ diff -Nur tspc2/conf/tspc.conf.in tspc2.owrt/conf/tspc.conf.in
|
|||||||
|
|
||||||
#
|
#
|
||||||
# authentication method:
|
# authentication method:
|
||||||
@@ -66,28 +59,19 @@
|
@@ -66,28 +59,19 @@ passwd=
|
||||||
|
|
||||||
#
|
#
|
||||||
# Name of the script:
|
# Name of the script:
|
||||||
@ -59,9 +68,8 @@ diff -Nur tspc2/conf/tspc.conf.in tspc2.owrt/conf/tspc.conf.in
|
|||||||
|
|
||||||
#
|
#
|
||||||
# 'server' is the tunnel broker identifier
|
# 'server' is the tunnel broker identifier
|
||||||
diff -Nur tspc2/platform/linux/tsp_local.c tspc2.owrt/platform/linux/tsp_local.c
|
--- a/platform/linux/tsp_local.c
|
||||||
--- tspc2/platform/linux/tsp_local.c 2004-07-07 21:25:47.000000000 +0200
|
+++ b/platform/linux/tsp_local.c
|
||||||
+++ tspc2.owrt/platform/linux/tsp_local.c 2007-02-19 16:07:18.000000000 +0100
|
|
||||||
@@ -59,13 +59,13 @@
|
@@ -59,13 +59,13 @@
|
||||||
|
|
||||||
/* these globals are defined by US used by alot of things in */
|
/* these globals are defined by US used by alot of things in */
|
||||||
@ -80,7 +88,7 @@ diff -Nur tspc2/platform/linux/tsp_local.c tspc2.owrt/platform/linux/tsp_local.c
|
|||||||
char DirSeparator = '/';
|
char DirSeparator = '/';
|
||||||
|
|
||||||
int Verbose = 0;
|
int Verbose = 0;
|
||||||
@@ -143,7 +143,7 @@
|
@@ -143,7 +143,7 @@ int tspStartLocal(SOCKET socket, tConf *
|
||||||
{
|
{
|
||||||
int tunfd;
|
int tunfd;
|
||||||
|
|
||||||
@ -89,10 +97,9 @@ diff -Nur tspc2/platform/linux/tsp_local.c tspc2.owrt/platform/linux/tsp_local.c
|
|||||||
|
|
||||||
if (daemon(0,0) == -1) {
|
if (daemon(0,0) == -1) {
|
||||||
Display(1, ELError, "tspStartLocal", "Unable to fork.");
|
Display(1, ELError, "tspStartLocal", "Unable to fork.");
|
||||||
diff -Nur tspc2/src/lib/config.c tspc2.owrt/src/lib/config.c
|
--- a/src/lib/config.c
|
||||||
--- tspc2/src/lib/config.c 2004-06-29 17:06:13.000000000 +0200
|
+++ b/src/lib/config.c
|
||||||
+++ tspc2.owrt/src/lib/config.c 2007-02-19 16:07:11.000000000 +0100
|
@@ -474,14 +474,17 @@ int tspVerifyConfig(tConf *Conf)
|
||||||
@@ -474,14 +474,17 @@
|
|
||||||
if(IsPresent(Conf->dns_server)) {
|
if(IsPresent(Conf->dns_server)) {
|
||||||
char *Server;
|
char *Server;
|
||||||
char *dns = strdup(Conf->dns_server);
|
char *dns = strdup(Conf->dns_server);
|
||||||
@ -111,10 +118,9 @@ diff -Nur tspc2/src/lib/config.c tspc2.owrt/src/lib/config.c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(dns);
|
free(dns);
|
||||||
diff -Nur tspc2/src/tsp/tsp_client.c tspc2.owrt/src/tsp/tsp_client.c
|
--- a/src/tsp/tsp_client.c
|
||||||
--- tspc2/src/tsp/tsp_client.c 2004-04-20 17:10:58.000000000 +0200
|
+++ b/src/tsp/tsp_client.c
|
||||||
+++ tspc2.owrt/src/tsp/tsp_client.c 2007-02-19 16:07:18.000000000 +0100
|
@@ -275,7 +275,7 @@ int tspSetupTunnel(tConf *conf, net_tool
|
||||||
@@ -275,7 +275,7 @@
|
|
||||||
|
|
||||||
start_show:
|
start_show:
|
||||||
|
|
||||||
@ -123,7 +129,7 @@ diff -Nur tspc2/src/tsp/tsp_client.c tspc2.owrt/src/tsp/tsp_client.c
|
|||||||
|
|
||||||
/* and start the show */
|
/* and start the show */
|
||||||
ret = tspStartLocal(socket, conf, &t, nt[conf->transport]);
|
ret = tspStartLocal(socket, conf, &t, nt[conf->transport]);
|
||||||
@@ -337,8 +337,8 @@
|
@@ -337,8 +337,8 @@ int tspMain(int argc, char *argv[])
|
||||||
LogInit("tspc", LogFile);
|
LogInit("tspc", LogFile);
|
||||||
|
|
||||||
Display( 1, ELInfo, "tspMain", "----- TSP Client Version %s Initializing -------------------------", TSP_CLIENT_VERSION);
|
Display( 1, ELInfo, "tspMain", "----- TSP Client Version %s Initializing -------------------------", TSP_CLIENT_VERSION);
|
||||||
@ -134,7 +140,7 @@ diff -Nur tspc2/src/tsp/tsp_client.c tspc2.owrt/src/tsp/tsp_client.c
|
|||||||
|
|
||||||
if((status = tspInitialize(argc, argv, &c)) != 0) { // *** we have no uninitialize
|
if((status = tspInitialize(argc, argv, &c)) != 0) { // *** we have no uninitialize
|
||||||
if (status == -1) {
|
if (status == -1) {
|
||||||
@@ -361,12 +361,12 @@
|
@@ -361,12 +361,12 @@ int tspMain(int argc, char *argv[])
|
||||||
|
|
||||||
/* first try with RUDP */
|
/* first try with RUDP */
|
||||||
c.transport = NET_TOOLS_T_RUDP;
|
c.transport = NET_TOOLS_T_RUDP;
|
||||||
@ -149,10 +155,9 @@ diff -Nur tspc2/src/tsp/tsp_client.c tspc2.owrt/src/tsp/tsp_client.c
|
|||||||
|
|
||||||
Display( 1, ELInfo, "tspMain", "Using TSP protocol version %s",
|
Display( 1, ELInfo, "tspMain", "Using TSP protocol version %s",
|
||||||
TspProtocolVersionStrings[version_index]);
|
TspProtocolVersionStrings[version_index]);
|
||||||
diff -Nur tspc2/template/linux.sh tspc2.owrt/template/linux.sh
|
--- a/template/linux.sh
|
||||||
--- tspc2/template/linux.sh 2004-06-23 23:29:20.000000000 +0200
|
+++ b/template/linux.sh
|
||||||
+++ tspc2.owrt/template/linux.sh 2007-02-19 16:08:39.000000000 +0100
|
@@ -135,9 +135,7 @@ if [ X"${TSP_HOST_TYPE}" = X"host" ] ||
|
||||||
@@ -135,9 +135,7 @@
|
|
||||||
#
|
#
|
||||||
# Default route
|
# Default route
|
||||||
Display 1 "Adding default route"
|
Display 1 "Adding default route"
|
||||||
@ -162,7 +167,7 @@ diff -Nur tspc2/template/linux.sh tspc2.owrt/template/linux.sh
|
|||||||
Exec $route -A inet6 add 2000::/3 dev $TSP_TUNNEL_INTERFACE
|
Exec $route -A inet6 add 2000::/3 dev $TSP_TUNNEL_INTERFACE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -147,9 +145,10 @@
|
@@ -147,9 +145,10 @@ if [ X"${TSP_HOST_TYPE}" = X"router" ];
|
||||||
Display 1 "Kernel setup"
|
Display 1 "Kernel setup"
|
||||||
if [ X"${TSP_PREFIXLEN}" != X"64" ]; then
|
if [ X"${TSP_PREFIXLEN}" != X"64" ]; then
|
||||||
#Better way on linux to avoid loop with the remaining /48?
|
#Better way on linux to avoid loop with the remaining /48?
|
||||||
@ -175,7 +180,7 @@ diff -Nur tspc2/template/linux.sh tspc2.owrt/template/linux.sh
|
|||||||
Display 1 "Adding prefix to $TSP_HOME_INTERFACE"
|
Display 1 "Adding prefix to $TSP_HOME_INTERFACE"
|
||||||
OLDADDR=`$ifconfig $TSP_HOME_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"`
|
OLDADDR=`$ifconfig $TSP_HOME_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"`
|
||||||
if [ ! -z $OLDADDR ]; then
|
if [ ! -z $OLDADDR ]; then
|
||||||
@@ -157,28 +156,28 @@
|
@@ -157,28 +156,28 @@ if [ X"${TSP_HOST_TYPE}" = X"router" ];
|
||||||
Exec $ifconfig $TSP_HOME_INTERFACE inet6 del $OLDADDR
|
Exec $ifconfig $TSP_HOME_INTERFACE inet6 del $OLDADDR
|
||||||
fi
|
fi
|
||||||
Exec $ifconfig $TSP_HOME_INTERFACE add $TSP_PREFIX::1/64
|
Exec $ifconfig $TSP_HOME_INTERFACE add $TSP_PREFIX::1/64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user