[package] update miredo to 1.2.3, packaged miredo-privproc, add client-hook script, patch from Alexander Khrykin

git-svn-id: svn://svn.openwrt.org/openwrt/packages@22763 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2010-08-22 16:36:35 +00:00
parent 781558328a
commit a753f9759d
2 changed files with 78 additions and 4 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=miredo
PKG_VERSION:=1.1.7
PKG_RELEASE:=4
PKG_VERSION:=1.2.3
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.remlab.net/files/miredo/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_MD5SUM:=4fb5e7df6a6255528e4c5380401ad3ea
PKG_MD5SUM:=6ba484ad5e331514a8a3452da2b144e7
PKG_FIXUP:=libtool
PKG_INSTALL:=1
@ -76,11 +76,14 @@ MAKE_FLAGS := \
define Package/miredo-common/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lib{teredo,tun6}.so.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/miredo
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/miredo/miredo-privproc $(1)/usr/lib/miredo
endef
define Package/miredo-server/install
$(INSTALL_DIR) $(1)/etc/miredo
$(CP) $(PKG_INSTALL_DIR)/usr/share/doc/miredo/examples/miredo-server.conf $(1)/etc/miredo/miredo-server.conf
$(INSTALL_BIN) ./files/client-hook $(1)/etc/miredo/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/miredo-server.init $(1)/etc/init.d/miredo-server
$(INSTALL_DIR) $(1)/usr/sbin
@ -90,6 +93,7 @@ endef
define Package/miredo-client/install
$(INSTALL_DIR) $(1)/etc/miredo
$(CP) $(PKG_INSTALL_DIR)/usr/share/doc/miredo/examples/miredo.conf $(1)/etc/miredo/miredo.conf
$(INSTALL_BIN) ./files/client-hook $(1)/etc/miredo/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/miredo.init $(1)/etc/init.d/miredo
$(INSTALL_DIR) $(1)/usr/sbin

View File

@ -0,0 +1,70 @@
#! /bin/sh
#
# Miredo client hook script for Linux/iproute2
# Copyright © 2007 Rémi Denis-Courmont.
# Distributed under the terms of the GNU General Public License version 2.
# Linux iproute2 path:
IP="/usr/sbin/ip"
# Linux default route default metric is 1024
# (we put 1029 so that Teredo is used as a last resort):
METRIC=1029
# Linux routing table ID
# (possible values: 1-252 from /etc/iproute/rt_tables):
TABLE="teredo"
# Linux routing rule priority
# (possible values: 1-32765, lowest number is highest priority):
PRIO=32765
# MTU for the tunnel interface
# (default: specified by the Teredo server, or 1280)
#MTU=1400
if ! test -x "$IP"; then
echo "$0: iproute2 is required! Please install it." >&2
exit 1
fi
# Nothing to do with destroy event
if test "$STATE" = "destroy"; then exit 0; fi
# If the source routing table is not configured, ignore it.
if ! "$IP" route show table "$TABLE" >/dev/null 2>&1; then
unset TABLE
else
if test "$OLD_ADDRESS"; then
"$IP" -6 rule del from "$OLD_ADDRESS" \
prio "$PRIO" table "$TABLE" 2>/dev/null
fi
"$IP" -6 route flush table "$TABLE" 2>/dev/null
fi
"$IP" -6 route flush dev "$IFACE" 2>/dev/null
"$IP" -6 address flush dev "$IFACE" 2>/dev/null
"$IP" -6 link set dev "$IFACE" "$STATE"
if test "$MTU"; then
"$IP" link set dev "$IFACE" mtu "$MTU"
fi
case "$STATE" in
up)
"$IP" -6 address add "${LLADDRESS}/64" dev "$IFACE"
"$IP" -6 address add "${ADDRESS}/32" dev "$IFACE"
"$IP" -6 route add default dev "$IFACE" metric "$METRIC"
if test "$TABLE"; then
"$IP" -6 route add default dev "$IFACE" table "$TABLE"
"$IP" -6 rule add from "$ADDRESS" \
prio "$PRIO" table "$TABLE"
fi
esac
# This should be required when changing policy routing rules, but it
# seems to confuse certain kernels into removing our default route!
#"$IP" -6 route flush cache 2>/dev/null
exit 0