You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

266 lines
6.4 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=keepalived
  9. PKG_VERSION:=2.0.18
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://www.keepalived.org/software
  13. PKG_HASH:=1423a2b1b8e541211029b9e1e1452e683bbe5f4b0b287eddd609aaf5ff024fd0
  14. PKG_CPE_ID:=cpe:/a:keepalived:keepalived
  15. PKG_LICENSE:=GPL-2.0+
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_MAINTAINER:=Ben Kelly <ben@benjii.net> \
  18. Florian Eckert <fe@dev.tdt.de>
  19. PKG_CONFIG_DEPENDS += \
  20. KEEPALIVED_VRRP \
  21. KEEPALIVED_LVS \
  22. KEEPALIVED_IPTABLES \
  23. KEEPALIVED_BFD \
  24. KEEPALIVED_SNMP_VRRP \
  25. KEEPALIVED_SNMP_CHECKER \
  26. KEEPALIVED_SNMP_RFC2 \
  27. KEEPALIVED_SNMP_RFC3 \
  28. KEEPALIVED_SNMP_REPLY_V3_FOR_V2 \
  29. KEEPALIVED_DBUS \
  30. KEEPALIVED_JSON \
  31. KEEPALIVED_ROUTES \
  32. IPV6
  33. PKG_INSTALL:=1
  34. include $(INCLUDE_DIR)/package.mk
  35. include $(INCLUDE_DIR)/kernel.mk
  36. define Package/keepalived/config
  37. source "$(SOURCE)/Config.in"
  38. endef
  39. # specifying +(IPV6&&KEEPALIVED_IPTABLES) in the DEPENDS definition doesn't work
  40. ifeq ($(CONFIG_KEEPALIVED_IPTABLES)$(CONFIG_IPV6),yy)
  41. KEEPALIVED_DEPENDS_LIBIP6TC=+libip6tc
  42. endif
  43. # The +kmod-nf-ipvs line should be +KEEPALIVED_LVS:kmod-nf-ipvs,
  44. # but make menuconfig then reports :error: recursive dependency detected!
  45. # !!FIXME DEPENDS:= +KEEPALIVED_LVS:kmod-nf-ipvs
  46. define Package/keepalived
  47. SECTION:=net
  48. CATEGORY:=Network
  49. TITLE:=VRRP with failover and monitoring daemon for LVS clusters
  50. URL:=http://www.keepalived.org/
  51. DEPENDS:= \
  52. +libnl-genl \
  53. +libmagic \
  54. +KEEPALIVED_VRRP:kmod-macvlan \
  55. +KEEPALIVED_VRRP:libnl-route \
  56. +KEEPALIVED_VRRP:libnfnetlink \
  57. +KEEPALIVED_SHA1:libopenssl \
  58. +KEEPALIVED_IPTABLES:libip4tc \
  59. $(KEEPALIVED_DEPENDS_LIBIP6TC) \
  60. +KEEPALIVED_IPTABLES:libxtables \
  61. +KEEPALIVED_IPTABLES:libipset \
  62. +(KEEPALIVED_SNMP_VRRP||KEEPALIVED_SNMP_CHECKER||KEEPALIVED_SNMP_RFC2||KEEPALIVED_SNMP_RFC3):libnetsnmp \
  63. +KEEPALIVED_JSON:libjson-c \
  64. +KEEPALIVED_DBUS:glib2
  65. endef
  66. define Package/keepalived/description
  67. VRRP with failover and monitoring daemon for Linux Virtual Server (LVS) clusters.
  68. endef
  69. define Package/keepalived/conffiles
  70. /etc/keepalived/keepalived.conf
  71. /etc/config/keepalived
  72. /etc/keepalived.user
  73. endef
  74. CONFIGURE_ARGS+= \
  75. --with-init=SYSV \
  76. --disable-nftables
  77. ifeq ($(CONFIG_KEEPALIVED_VRRP),)
  78. CONFIGURE_ARGS += \
  79. --disable-vrrp
  80. endif
  81. ifeq ($(CONFIG_KEEPALIVED_LVS),)
  82. CONFIGURE_ARGS += \
  83. --disable-lvs
  84. endif
  85. ifeq ($(CONFIG_KEEPALIVED_BFD),y)
  86. CONFIGURE_ARGS += \
  87. --enable-bfd
  88. endif
  89. ifeq ($(CONFIG_KEEPALIVED_SHA1),y)
  90. CONFIGURE_ARGS += \
  91. --enable-sha1
  92. endif
  93. ifeq ($(CONFIG_KEEPALIVED_VRRP),y)
  94. ifeq ($(CONFIG_KEEPALIVED_IPTABLES),)
  95. CONFIGURE_ARGS += \
  96. --disable-iptables
  97. endif
  98. ifeq ($(CONFIG_KEEPALIVED_IPSETS),)
  99. CONFIGURE_ARGS += \
  100. --disable-libipset-dynamic
  101. endif
  102. ifeq ($(CONFIG_KEEPALIVED_SNMP_VRRP),y)
  103. CONFIGURE_ARGS += \
  104. --enable-snmp-vrrp
  105. endif
  106. ifeq ($(CONFIG_KEEPALIVED_SNMP_RFC2),y)
  107. CONFIGURE_ARGS += \
  108. --enable-snmp-rfcv2
  109. endif
  110. ifeq ($(CONFIG_KEEPALIVED_SNMP_RFC3),y)
  111. CONFIGURE_ARGS += \
  112. --enable-snmp-rfcv3
  113. endif
  114. ifeq ($(CONFIG_KEEPALIVED_SNMP_RFC3),y)
  115. ifeq ($(CONFIG_KEEPALIVED_SNMP_REPLY_V3_FOR_V2),)
  116. CONFIGURE_ARGS += \
  117. --disable-snmp-reply-v3-for-v2
  118. endif
  119. endif # CONFIG_KEEPALIVED_SNMP_RFC3
  120. ifeq ($(CONFIG_KEEPALIVED_JSON),y)
  121. CONFIGURE_ARGS += \
  122. --enable-json
  123. endif
  124. ifeq ($(CONFIG_KEEPALIVED_VRRP_AUTH),)
  125. CONFIGURE_ARGS += \
  126. --disable-vrrp-auth
  127. endif
  128. ifeq ($(CONFIG_KEEPALIVED_CHECKSUM_COMPAT),)
  129. CONFIGURE_ARGS += \
  130. --disable-checksum-compat
  131. endif
  132. ifeq ($(CONFIG_KEEPALIVED_DBUS),y)
  133. CONFIGURE_ARGS += \
  134. --enable-dbus
  135. endif
  136. ifeq ($(CONFIG_KEEPALIVED_LINKBEAT),)
  137. CONFIGURE_ARGS += \
  138. --disable-linkbeat
  139. endif
  140. ifeq ($(CONFIG_KEEPALIVED_ROUTES),)
  141. CONFIGURE_ARGS += \
  142. --disable-routes
  143. endif
  144. endif # CONFIG_KEEPALIVED_VRRP
  145. ifeq ($(CONFIG_KEEPALIVED_LVS),y)
  146. ifeq ($(CONFIG_KEEPALIVED_LVS_SYNCD),)
  147. CONFIGURE_ARGS += \
  148. --disable-lvs-syncd
  149. endif
  150. ifeq ($(CONFIG_KEEPALIVED_LVS_64BIT_STATS),)
  151. CONFIGURE_ARGS += \
  152. --disable-lvs-64bit-stats
  153. endif
  154. ifeq ($(CONFIG_KEEPALIVED_FWMARK),)
  155. CONFIGURE_ARGS += \
  156. --disable-fwmark
  157. endif
  158. ifeq ($(CONFIG_KEEPALIVED_SNMP_CHECKER),y)
  159. CONFIGURE_ARGS += \
  160. --enable-snmp-checker
  161. endif
  162. endif # CONFIG_KEEPALIVED_LVS
  163. MAKE_FLAGS += STRIP="/bin/true"
  164. TARGET_CFLAGS += -I$(LINUX_DIR)
  165. define Package/keepalived/install
  166. $(INSTALL_DIR) $(1)/usr/sbin
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keepalived \
  168. $(1)/usr/sbin/
  169. $(INSTALL_DIR) $(1)/usr/bin
  170. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/genhash \
  171. $(1)/usr/bin/
  172. $(INSTALL_DIR) $(1)/etc/keepalived
  173. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/keepalived/keepalived.conf \
  174. $(1)/etc/keepalived/
  175. $(INSTALL_DIR) $(1)/etc/init.d
  176. $(INSTALL_BIN) ./files/keepalived.init \
  177. $(1)/etc/init.d/keepalived
  178. $(INSTALL_DIR) $(1)/etc/config
  179. $(INSTALL_CONF) ./files/keepalived.config \
  180. $(1)/etc/config/keepalived
  181. $(INSTALL_DIR) $(1)/etc
  182. $(INSTALL_CONF) ./files/keepalived.user \
  183. $(1)/etc/keepalived.user
  184. $(INSTALL_DIR) $(1)/etc/hotplug.d/keepalived
  185. $(INSTALL_DATA) ./files/hotplug-user \
  186. $(1)/etc/hotplug.d/keepalived/01-user
  187. ifneq ($(CONFIG_KEEPALIVED_SNMP_VRRP)$(CONFIG_KEEPALIVED_SNMP_CHECKER)$(CONFIG_KEEPALIVED_SNMP_RFC2)$(CONFIG_KEEPALIVED_SNMP_RFC3),)
  188. $(INSTALL_DIR) $(1)/usr/share/snmp/mibs
  189. endif
  190. ifneq ($(CONFIG_KEEPALIVED_SNMP_VRRP)$(CONFIG_KEEPALIVED_SNMP_CHECKER),)
  191. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/KEEPALIVED-MIB.txt \
  192. $(1)/usr/share/snmp/mibs/KEEPALIVED-MIB.txt
  193. endif
  194. ifeq ($(CONFIG_KEEPALIVED_SNMP_RFC2),y)
  195. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/VRRP-MIB.txt \
  196. $(1)/usr/share/snmp/mibs/VRRP-MIB.txt
  197. endif
  198. ifeq ($(CONFIG_KEEPALIVED_SNMP_RFC3),y)
  199. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/VRRPv3-MIB.txt \
  200. $(1)/usr/share/snmp/mibs/VRRPv3-MIB.txt
  201. endif
  202. ifeq ($(CONFIG_KEEPALIVED_DBUS),y)
  203. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
  204. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/org.keepalived.Vrrp1.conf \
  205. $(1)/etc/dbus-1/system.d/org.keepalived.Vrrp1.conf
  206. $(INSTALL_DIR) $(1)/usr/share/dbus-1/interfaces
  207. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/dbus-1/interfaces/org.keepalived.Vrrp1.Instance.xml \
  208. $(1)/usr/share/dbus-1/interfaces/org.keepalived.Vrrp1.Instance.xml
  209. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/dbus-1/interfaces/org.keepalived.Vrrp1.Vrrp.xml \
  210. $(1)/usr/share/dbus-1/interfaces/org.keepalived.Vrrp1.Vrrp.xml
  211. endif
  212. endef
  213. $(eval $(call BuildPackage,keepalived))