From d765df4d8c08582bcba528116ea36e3683a718d4 Mon Sep 17 00:00:00 2001 From: Stephen Walker Date: Sat, 6 Mar 2010 17:03:32 +0000 Subject: [PATCH] ucarp: update to 1.5.2, add missing libpcap depends, select the ip addr symbols needed by the init script, cleanup the init script SVN-Revision: 20017 --- net/ucarp/Makefile | 24 +++++-- net/ucarp/files/ucarp.conf | 6 +- net/ucarp/files/ucarp.init | 66 ++++++------------- .../100-configure-cross-compilation.patch | 8 +-- 4 files changed, 46 insertions(+), 58 deletions(-) diff --git a/net/ucarp/Makefile b/net/ucarp/Makefile index b02000f59..444005fab 100644 --- a/net/ucarp/Makefile +++ b/net/ucarp/Makefile @@ -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)) diff --git a/net/ucarp/files/ucarp.conf b/net/ucarp/files/ucarp.conf index db099eafc..86480f541 100644 --- a/net/ucarp/files/ucarp.conf +++ b/net/ucarp/files/ucarp.conf @@ -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 diff --git a/net/ucarp/files/ucarp.init b/net/ucarp/files/ucarp.init index a422d0d5a..aa8ad9f70 100644 --- a/net/ucarp/files/ucarp.init +++ b/net/ucarp/files/ucarp.init @@ -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 < /var/run/ucarp-vip-up <> /var/run/ucarp-vip-up < /var/run/ucarp-vip-down < /var/run/ucarp-vip-down <