From 2659772f68dcaec5f9621f4674ce5aecc66a5fd7 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Sun, 13 Apr 2008 16:34:48 +0000 Subject: [PATCH] add keepalived (closes: #2590) SVN-Revision: 10820 --- net/keepalived/Makefile | 73 ++++++++++++++++++++++++++++ net/keepalived/files/keepalived.init | 13 +++++ 2 files changed, 86 insertions(+) create mode 100644 net/keepalived/Makefile create mode 100644 net/keepalived/files/keepalived.init diff --git a/net/keepalived/Makefile b/net/keepalived/Makefile new file mode 100644 index 0000000000..8a93be54b6 --- /dev/null +++ b/net/keepalived/Makefile @@ -0,0 +1,73 @@ +# +# Copyright (C) 2006-2008 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:=keepalived +PKG_VERSION:=1.1.15 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= http://www.keepalived.org/software +PKG_MD5SUM:=4c93f5d8b6bfabe84b02828a5bbb7aa0 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/keepalived + SECTION:=net + CATEGORY:=Network + TITLE:=Failover and monitoring daemon for LVS clusters + URL:=http://www.keepalived.org/ + SUBMENU:=HA + DEPENDS:=+libpopt +libopenssl +endef + +define Package/keepalived/description + Failover and monitoring daemon for Linux Virtual Server (LVS) clusters. +endef + +define Package/keepalived/conffiles + /etc/keepalived/keepalived.conf +endef + +acvar=$(subst -,_,$(subst .,_,$(subst /,_,$(1)))) + +CONFIGURE_ARGS+= \ + --enable-shared \ + --disable-static \ + --disable-debug \ + --disable-strip \ + --disable-lvs \ + --disable-lvs-syncd \ + --with-kernel-dir="$(LINUX_DIR)" \ + +CONFIGURE_VARS+= \ + ac_cv_file_$(call acvar,$(LINUX_DIR)/net/core/link_watch.c)=no \ + +define Build/Compile + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + all install +endef + +define Package/keepalived/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/keepalived $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/genhash $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/keepalived + $(CP) $(PKG_INSTALL_DIR)/etc/keepalived/keepalived.conf $(1)/etc/keepalived/keepalived.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/keepalived.init $(1)/etc/init.d/keepalived +endef + +$(eval $(call BuildPackage,keepalived)) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init new file mode 100644 index 0000000000..c98984bcf2 --- /dev/null +++ b/net/keepalived/files/keepalived.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2008 OpenWrt.org + +START=70 + +start() { + [ -f /etc/keepalived/keepalived ] && /usr/sbin/keepalived +} + +stop() { + killall keepalived +} + -- 2.30.2