Port vrrpd to -ng
authorFlorian Fainelli <florian@openwrt.org>
Fri, 11 Aug 2006 17:08:54 +0000 (17:08 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Fri, 11 Aug 2006 17:08:54 +0000 (17:08 +0000)
SVN-Revision: 4563

net/vrrpd/Config.in [new file with mode: 0644]
net/vrrpd/Makefile [new file with mode: 0644]
net/vrrpd/files/vrrpd.default [new file with mode: 0644]
net/vrrpd/files/vrrpd.init [new file with mode: 0644]

diff --git a/net/vrrpd/Config.in b/net/vrrpd/Config.in
new file mode 100644 (file)
index 0000000..767e2dd
--- /dev/null
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_VRRPD
+        prompt "vrrpd............................. Virtual Router Redundancy Protocol daemon"
+       tristate
+       default m if CONFIG_DEVEL
+       help
+         VRRPd is an implementation of Virtual Router Redundancy
+         Protocol as specified in rfc2338.  VRRPd is interoperable with
+         other RFC-based VRRP implementations, including Cisco and
+         Juniper, and is included as a standard feature on ImageStream
+         routers.
+         
+         http://www.sourceforge.net/projects/vrrpd
+
diff --git a/net/vrrpd/Makefile b/net/vrrpd/Makefile
new file mode 100644 (file)
index 0000000..17344c0
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=vrrpd
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
+PKG_MD5SUM:=6d5066ea1a6ced817376ca0f54765447
+
+PKG_SOURCE_URL:=@SF/vrrpd
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_CAT:=zcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/vrrpd
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Virtual Router Redundancy Protocol daemon
+  DESCRIPTION:=VRRPd is an implementation of Virtual Router Redundancy\\\
+  Protocol as specified in rfc2338.  VRRPd is interoperable with\\\
+  other RFC-based VRRP implementations, including Cisco and\\\
+  Juniper, and is included as a standard feature on ImageStream\\\
+  routers.\\\
+  URL:=http://www.sourceforge.net/projects/vrrpd
+endef
+
+define Package/vrrpd/conffiles
+/etc/default/vrrpd
+endef
+
+define Build/Compile   
+$(call Build/Compile/Default,CC="$(TARGET_CC)" \
+               DBG_OPT="" \
+               MAIN_OPT="$(TARGET_CFLAGS)" \
+               vrrpd)
+endef
+
+define Package/vrrpd/install   
+       install -d -m0755 $(1)/etc/default
+       install -m0644 ./files/vrrpd.default $(1)/etc/default/vrrpd
+       install -d -m0755 $(1)/etc/init.d
+       install -m0755 ./files/vrrpd.init $(1)/etc/init.d/vrrpd
+       install -d -m0755 $(1)/usr/sbin
+       install -m0755 $(PKG_BUILD_DIR)/vrrpd $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,vrrpd))
diff --git a/net/vrrpd/files/vrrpd.default b/net/vrrpd/files/vrrpd.default
new file mode 100644 (file)
index 0000000..0dfee0c
--- /dev/null
@@ -0,0 +1,4 @@
+ID=1
+IF=vlan1
+IP=10.0.0.1
+OPTIONS="-i $IF -v $ID $IP"
diff --git a/net/vrrpd/files/vrrpd.init b/net/vrrpd/files/vrrpd.init
new file mode 100644 (file)
index 0000000..5afc734
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+BIN=vrrpd
+DEFAULT=/etc/default/$BIN
+[ -f $DEFAULT ] && . $DEFAULT
+RUN_D=/var/run
+PID_F=$RUN_D/$BIN_${IF}_${ID}.pid
+
+case $1 in
+ start)
+  $BIN $OPTIONS
+  ;;
+ stop)
+  [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
+  ;;
+ *)
+  echo "usage: $0 (start|stop)"
+  exit 1
+esac
+
+exit $?