--- /dev/null
+###############################################################################
+# IPFire.org - An Open Source Firewall Solution #
+# Copyright (C) - IPFire Development Team <info@ipfire.org> #
+###############################################################################
+
+name = keepalived
+version = 1.2.2
+release = 1
+
+groups = Applications/System
+url = http://www.keepalived.org/
+license = GPLv2+
+summary = High Availability monitor built upon LVS, VRRP and service pollers.
+
+description
+ The main goal of the keepalived project is to add a strong & robust keepalive
+ facility to the Linux Virtual Server project. This project is written in C with
+ multilayer TCP/IP stack checks. Keepalived implements a framework based on
+ three family checks : Layer3, Layer4 & Layer5/7. This framework gives the
+ daemon the ability to check the state of an LVS server pool. When one of the
+ servers of the LVS server pool is down, keepalived informs the linux kernel via
+ a setsockopt call to remove this server entry from the LVS topology. In
+ addition keepalived implements an independent VRRPv2 stack to handle director
+ failover. So in short keepalived is a userspace daemon for LVS cluster nodes
+ healthchecks and LVS directors failover.
+end
+
+source_dl = http://www.keepalived.org/software/
+
+build
+ requires
+ libnl-devel
+ openssl-devel
+ popt-devel
+ end
+
+ configure_options += \
+ --sysconfdir=/etc
+
+# --with-kernel-dir=$(ls -1d --sort t /lib/modules/*/build | head 1)
+
+ make_targets += STRIP=/bin/true
+
+ test
+ # A build could silently have LVS support disabled if the kernel includes can't
+ # be properly found, we need to avoid that.
+ if ! grep -q "IPVS_SUPPORT='_WITH_LVS_'" config.log; then
+ echo "ERROR: We do not want keeepalived lacking LVS support."
+ exit 1
+ fi
+ end
+
+ install_cmds
+ rm -rvf %{BUILDROOT}/etc/rc.d \
+ %{BUILDROOT}/etc/keepalived/samples
+ end
+end
+
+packages
+ package %{name}
+ postin
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+ end
+
+ postun
+ /bin/systemctl --no-reload disabled keepalived.service >/dev/null 2>&1 || :
+ /bin/systemctl stop keepalived.service >/dev/null 2>&1 || :
+ end
+
+ postup
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+ /bin/systemctl try-restart keepalived.service >/dev/null 2>&1 || :
+ end
+ end
+end
--- /dev/null
+diff -Naupr keepalived-1.1.14.orig/keepalived/Makefile.in keepalived-1.1.14/keepalived/Makefile.in
+--- keepalived-1.1.14.orig/keepalived/Makefile.in 2007-09-13 15:44:39.000000000 +0200
++++ keepalived-1.1.14/keepalived/Makefile.in 2007-09-14 12:38:43.000000000 +0200
+@@ -99,13 +99,13 @@ uninstall:
+
+ install:
+ install -d $(DESTDIR)$(sbindir)
+- install -m 700 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/
++ install -m 755 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/
+ install -d $(DESTDIR)$(init_dir)
+ install -m 755 etc/init.d/keepalived.init $(DESTDIR)$(init_dir)/keepalived
+ install -d $(DESTDIR)$(sysconf_dir)
+- install -m 755 etc/init.d/keepalived.sysconfig $(DESTDIR)$(sysconf_dir)/keepalived
++ install -m 644 etc/init.d/keepalived.sysconfig $(DESTDIR)$(sysconf_dir)/keepalived
+ install -d $(DESTDIR)$(sysconfdir)/keepalived/samples
+- install -m 644 etc/keepalived/keepalived.conf $(DESTDIR)$(sysconfdir)/keepalived/
++ install -m 640 etc/keepalived/keepalived.conf $(DESTDIR)$(sysconfdir)/keepalived/
+ install -m 644 ../doc/samples/* $(DESTDIR)$(sysconfdir)/keepalived/samples/
+ install -d $(DESTDIR)$(mandir)/man5
+ install -d $(DESTDIR)$(mandir)/man8
--- /dev/null
+diff -Naupr keepalived-1.1.19.orig/keepalived/check/ipvswrapper.c keepalived-1.1.19/keepalived/check/ipvswrapper.c
+--- keepalived-1.1.19.orig/keepalived/check/ipvswrapper.c 2009-09-28 13:03:40.000000000 +0200
++++ keepalived-1.1.19/keepalived/check/ipvswrapper.c 2009-11-24 22:41:56.220195007 +0100
+@@ -789,7 +789,7 @@ string_to_number(const char *s, int min,
+ static int
+ modprobe_ipvs(void)
+ {
+- char *argv[] = { "/sbin/modprobe", "-s", "-k", "--", "ip_vs", NULL };
++ char *argv[] = { "/sbin/modprobe", "-s", "--", "ip_vs", NULL };
+ int child;
+ int status;
+ int rc;
--- /dev/null
+diff -up keepalived-1.2.2/configure.pathfix keepalived-1.2.2/configure
+--- keepalived-1.2.2/configure.pathfix 2011-09-19 12:31:19.615258629 -0400
++++ keepalived-1.2.2/configure 2011-09-19 12:31:38.872000057 -0400
+@@ -3973,7 +3973,7 @@ $as_echo "$as_me: WARNING: Cannot determ
+
+ IPVS_SUPPORT="_WITHOUT_LVS_"
+ if test "$enable_lvs" != "no"; then
+- ac_fn_c_check_header_mongrel "$LINENO" "net/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default"
++ ac_fn_c_check_header_mongrel "$LINENO" "linux/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default"
+ if test "x$ac_cv_header_net_ip_vs_h" = x""yes; then :
+ IPVS_SUPPORT="_WITH_LVS_"
+ else
--- /dev/null
+[Unit]
+Description=LVS and VRRP High Availability Monitor
+After=syslog.target network.target
+
+[Service]
+Type=forking
+EnvironmentFile=-/etc/sysconfig/keepalived
+ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS
+
+[Install]
+WantedBy=multi-user.target