add keepalived (closes: #2590)
[packages.git] / net / keepalived / Makefile
1
2 # Copyright (C) 2006-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=keepalived
12 PKG_VERSION:=1.1.15
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:= http://www.keepalived.org/software
17 PKG_MD5SUM:=4c93f5d8b6bfabe84b02828a5bbb7aa0
18
19 include $(INCLUDE_DIR)/package.mk
20 include $(INCLUDE_DIR)/kernel.mk
21
22 define Package/keepalived
23   SECTION:=net
24   CATEGORY:=Network
25   TITLE:=Failover and monitoring daemon for LVS clusters
26   URL:=http://www.keepalived.org/
27   SUBMENU:=HA
28   DEPENDS:=+libpopt +libopenssl
29 endef
30
31 define Package/keepalived/description
32  Failover and monitoring daemon for Linux Virtual Server (LVS) clusters.
33 endef
34
35 define Package/keepalived/conffiles
36  /etc/keepalived/keepalived.conf
37 endef
38
39 acvar=$(subst -,_,$(subst .,_,$(subst /,_,$(1))))
40
41 CONFIGURE_ARGS+= \
42         --enable-shared \
43         --disable-static \
44         --disable-debug \
45         --disable-strip \
46         --disable-lvs \
47         --disable-lvs-syncd \
48         --with-kernel-dir="$(LINUX_DIR)" \
49
50 CONFIGURE_VARS+= \
51         ac_cv_file_$(call acvar,$(LINUX_DIR)/net/core/link_watch.c)=no \
52
53 define Build/Compile
54         rm -rf $(PKG_INSTALL_DIR)
55         mkdir -p $(PKG_INSTALL_DIR)
56         $(MAKE) -C $(PKG_BUILD_DIR) \
57                 DESTDIR="$(PKG_INSTALL_DIR)" \
58                 STRIP="/bin/true" \
59                 all install
60 endef
61
62 define Package/keepalived/install
63         $(INSTALL_DIR) $(1)/usr/sbin
64         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/keepalived $(1)/usr/sbin/
65         $(INSTALL_DIR) $(1)/usr/bin
66         $(CP) $(PKG_INSTALL_DIR)/usr/bin/genhash $(1)/usr/bin/
67         $(INSTALL_DIR) $(1)/etc/keepalived
68         $(CP) $(PKG_INSTALL_DIR)/etc/keepalived/keepalived.conf $(1)/etc/keepalived/keepalived.conf
69         $(INSTALL_DIR) $(1)/etc/init.d
70         $(INSTALL_BIN) ./files/keepalived.init $(1)/etc/init.d/keepalived
71 endef
72
73 $(eval $(call BuildPackage,keepalived))