[packages] ucarp: update to 1.5.2, add missing libpcap depends, select the ip addr symbols needed by the init script, cleanup the init script

git-svn-id: svn://svn.openwrt.org/openwrt/packages@20017 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
swalker 2010-03-06 17:03:32 +00:00
parent ccecf2f30a
commit 7ccddf3423
4 changed files with 46 additions and 58 deletions

View File

@ -8,12 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ucarp
PKG_VERSION:=1.5.1
PKG_VERSION:=1.5.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.pureftpd.org/pub/ucarp
PKG_MD5SUM:=9219ea8214198e8af751353a132087bb
PKG_MD5SUM:=723636dbf79fc6abd329a71ec4ddf79d
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
@ -21,6 +23,7 @@ define Package/ucarp
SECTION:=net
CATEGORY:=Network
TITLE:=Lets several hosts share one IP
DEPENDS:=+libpcap
URL:=http://www.ucarp.org/project/ucarp
endef
@ -30,9 +33,22 @@ define Package/ucarp/description
secure and patent-free Common Address Redundancy Protocol
endef
define Package/ucarp/conffiles
/etc/ucarp.conf
endef
define Package/ucarp/config
select BUSYBOX_CONFIG_IP
select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS
endef
define Package/ucarp/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ucarp $(1)/sbin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) ./files/ucarp.conf $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/ucarp.init $(1)/etc/init.d/ucarp
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ucarp $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,ucarp))

View File

@ -1,7 +1,5 @@
# Usage for AirOS:
# 1) Edit this file and copy it to /etc/persistent/ucarp.conf
# 2) Run: ucarp.init test
# 3) Run: cfgmtd -w -p /etc/ && reboot
# Run in background
BACKGROUND=1
# Interface to run CARP on
IF=br-lan

View File

@ -1,64 +1,40 @@
#!/bin/sh
#!/bin/sh /etc/rc.common
CONF=/etc/persistent/ucarp.conf
MODE="$1"
START=50
CONF=/etc/ucarp.conf
if [ "${MODE}" = "stop" ]
then
echo "Killing them all and letting init sort them out"
killall ucarp
exit 0
fi
start() {
. ${CONF}
if [ -f "${CONF}" ]
then
if [ "${MODE}" = "test" ]
then
daemon=""
else
echo "Starting UCARP using ${CONF} as a daemon, use test parameter to run in foreground"
daemon="--daemonize"
fi
[ ${BACKGROUND} = 1 ] && daemon="--daemonize"
. ${CONF}
cat > /var/run/ucarp-vip-up <<EOF
cat > /var/run/ucarp-vip-up <<EOF
#!/bin/sh
/bin/ip addr add ${VIP}/${VMASK} dev ${IF}
EOF
for ip in ${PINGIP}
do
for ip in ${PINGIP}
do
cat >> /var/run/ucarp-vip-up <<EOF
${arping}/bin/arping -c 2 -I ${IF} -s ${VIP} ${ip}
/usr/bin/arping -c 2 -I ${IF} -s ${VIP} ${ip}
EOF
done
done
chmod a+x /var/run/ucarp-vip-up
chmod a+x /var/run/ucarp-vip-up
cat > /var/run/ucarp-vip-down <<EOF
cat > /var/run/ucarp-vip-down <<EOF
#!/bin/sh
/bin/ip addr del ${VIP}/${VMASK} dev ${IF}
EOF
chmod a+x /var/run/ucarp-vip-down
chmod a+x /var/run/ucarp-vip-down
/sbin/ucarp --interface=${IF} --srcip=${MYIP} --vhid=1 --pass=${PASSWORD} \
--addr=${VIP} --nomcast $daemon \
--upscript=/var/run/ucarp-vip-up --downscript=/var/run/ucarp-vip-down
/usr/sbin/ucarp --interface=${IF} --srcip=${MYIP} --vhid=1 --pass=${PASSWORD} \
--addr=${VIP} --nomcast $daemon \
--upscript=/var/run/ucarp-vip-up --downscript=/var/run/ucarp-vip-down
}
if [ "${MODE}" = "test" ]
then
echo "UCARP has exited."
else
echo "UCARP has been started."
fi
else
echo "UCARP is not enabled"
exit 0
fi
stop() {
killall ucarp
}

View File

@ -1,8 +1,6 @@
Only in ucarp-1.5.1: autom4te.cache
diff -ur ucarp-1.5.1.clean/configure ucarp-1.5.1/configure
--- ucarp-1.5.1.clean/configure 2010-01-30 00:03:55.000000000 +0100
+++ ucarp-1.5.1/configure 2010-01-30 00:36:06.000000000 +0100
@@ -30117,174 +30117,11 @@
--- a/configure
+++ b/configure
@@ -30129,174 +30129,11 @@ _ACEOF
fi