[packages] ucarp: update to 1.5.2, add missing libpcap depends, select the ip addr...
authorswalker <swalker@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 6 Mar 2010 17:03:32 +0000 (17:03 +0000)
committerswalker <swalker@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 6 Mar 2010 17:03:32 +0000 (17:03 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@20017 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/ucarp/Makefile
net/ucarp/files/ucarp.conf
net/ucarp/files/ucarp.init
net/ucarp/patches/100-configure-cross-compilation.patch

index b02000f..444005f 100644 (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))
index db099ea..86480f5 100644 (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
index a422d0d..aa8ad9f 100644 (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
-
-   /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
+       chmod a+x /var/run/ucarp-vip-down
 
-   if [ "${MODE}" = "test" ]
-   then
-       echo "UCARP has exited."
-   else
-       echo "UCARP has been started."
-   fi
+       /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
+}
 
-else 
-   echo "UCARP is not enabled"
-   exit 0
-fi
+stop() {
+       killall ucarp
+}
index 82d8ce6..f6b0a14 100644 (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