forked from acassen/keepalived
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keepalived.spec.in
237 lines (194 loc) · 9.21 KB
/
keepalived.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# Ugly, but we need headers from a kernel to rebuild against
%define kernel %(rpm -q kernel-devel --qf '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}\\n' 2>/dev/null | head -1)
Summary: HA monitor built upon LVS, VRRP and services poller
Name: keepalived
Version: @VERSION@
Release: 1
License: GPL
Group: Applications/System
URL: http://www.keepalived.org/
Source0: http://www.keepalived.org/software/keepalived-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: openssl-devel
# We need both of these for proper LVS support
BuildRequires: kernel-headers
BuildRequires: libnfnetlink-devel
BuildRequires: autoconf automake pkgconfig
@SNMP_TRUE@BuildRequires: net-snmp-devel
@WITH_DBUS_TRUE@BuildRequires: glib2-devel
@LIBIPTC_TRUE@BuildRequires: iptables-devel
@LIBIPSET_TRUE@BuildRequires: ipset-devel
@LIBNL1_TRUE@BuildRequires: libnl-devel
@LIBNL3_TRUE@BuildRequires: libnl3-devel
@NFTABLES_TRUE@BuildRequires: libnftnl-devel libmnl-devel
@INIT_SYSV_TRUE@Requires(post): /sbin/chkconfig
@INIT_SYSV_TRUE@Requires(preun): /sbin/service, /sbin/chkconfig
@INIT_SYSV_TRUE@Requires(postun): /sbin/service
@INIT_SYSTEMD_TRUE@BuildRequires: systemd-units
@WITH_REGEX_TRUE@BuildRequires: pcre2-devel
@SNMP_TRUE@Requires: net-snmp
@WITH_DBUS_TRUE@Requires: glib2
@LIBIPTC_TRUE@Requires: iptables-libs
@LIBIPSET_TRUE@Requires: ipset-libs
@LIBNL1_TRUE@Requires: libnl
@LIBNL3_TRUE@Requires: libnl3
@NFTABLES_TRUE@Requires: libnftnl libmnl
@WITH_REGEX_TRUE@Requires: pcre2
%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.
%prep
%setup
%build
CONFIG_OPTS=
@DEBUG_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-debug"
@PROFILE_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-profile"
@WITH_VRRP_FALSE@CONFIG_OPTS="$CONFIG_OPTS --disable-vrrp"
@WITH_IPVS_FALSE@CONFIG_OPTS="$CONFIG_OPTS --disable-lvs"
@NFTABLES_FALSE@CONFIG_OPTS="$CONFIG_OPTS --disable-nftables"
@IPTABLES_FALSE@CONFIG_OPTS="$CONFIG_OPTS --disable-iptables"
@IPTABLES_TRUE@@LIBIPTC_FALSE@CONFIG_OPTS="$CONFIG_OPTS --disable-libiptc"
@IPTABLES_TRUE@@LIBIPSET_FALSE@CONFIG_OPTS="$CONFIG_OPTS --disable-libipset"
@SNMP_KEEPALIVED_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-snmp"
@SNMP_KEEPALIVED_FALSE@@SNMP_VRRP_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-snmp-vrrp"
@SNMP_KEEPALIVED_FALSE@@SNMP_CHECKER_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-snmp-checker"
@SNMP_RFC_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-snmp-rfc"
@SNMP_RFC_FALSE@@SNMP_RFCV2_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-snmp-rfcv2"
@SNMP_RFC_FALSE@@SNMP_RFCV3_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-snmp-rfcv3"
@SNMP_REPLY_V3_FOR_V2_FALSE@CONFIG_OPTS="$CONFIG_OPTS --disable-snmp-reply-v3-for-v2"
@WITH_SHA1_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-sha1"
@WITH_DBUS_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-dbus"
@INIT_UPSTART_TRUE@CONFIG_OPTS="$CONFIG_OPTS --with-init=upstart"
@INIT_SYSTEMD_TRUE@CONFIG_OPTS="$CONFIG_OPTS --with-init=systemd"
@INIT_SYSV_TRUE@CONFIG_OPTS="$CONFIG_OPTS --with-init=SYSV"
@INIT_SUSE_TRUE@CONFIG_OPTS="$CONFIG_OPTS --with-init=SUSE"
@INIT_OPENRC_TRUE@CONFIG_OPTS="$CONFIG_OPTS --with-init=openrc"
@WITH_REGEX_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-regex"
@WITH_BFD_TRUE@CONFIG_OPTS="$CONFIG_OPTS --enable-bfd"
autoreconf -f -i
%configure $CONFIG_OPTS
%{__make} %{?_smp_mflags} STRIP=/bin/true
%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
# Remove "samples", as we include them in %%doc
%{__rm} -rf %{buildroot}%{_sysconfdir}/keepalived/samples/
# Likewise remove README
%{__rm} -f %{buildroot}%{_docdir}/%{name}/README
%check
# 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 "#define _WITH_LVS_ *1" lib/config.h; then
%{__echo} "ERROR: We do not want keepalived lacking LVS support."
exit 1
fi
%clean
%{__rm} -rf %{buildroot}
%post
if [ $1 -eq 1 ]; then
# Enable (but don't start) the units by default
@INIT_SYSV_TRUE@ /sbin/chkconfig --add keepalived
@INIT_SYSTEMD_TRUE@ /bin/systemctl enable keepalived.service >/dev/null 2>&1 || :
:
fi
%preun
if [ $1 -eq 0 ]; then
# Disable and stop the units
@INIT_SYSV_TRUE@ /sbin/service keepalived stop &>/dev/null || :
@INIT_SYSV_TRUE@ /sbin/chkconfig --del keepalived
@INIT_SYSTEMD_TRUE@ /bin/systemctl disable keepalived.service >/dev/null 2>&1 || :
@INIT_SYSTEMD_TRUE@ /bin/systemctl stop keepalived.service >/dev/null 2>&1 || :
@INIT_UPSTART_TRUE@ /sbin/stop keepalived >/dev/null 2>&1 || :
:
fi
%postun
if [ $1 -ge 1 ]; then
@INIT_SYSV_TRUE@ /sbin/service keepalived condrestart &>/dev/null || :
# On upgrade, reload init system configuration if we changed unit files
# and restart the daemon
@INIT_SYSTEMD_TRUE@ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
@INIT_SYSTEMD_TRUE@ /bin/systemctl try-restart keepalived.service >/dev/null 2>&1 || :
:
fi
%files
%defattr(-, root, root, -)
%doc AUTHOR ChangeLog CONTRIBUTORS COPYING README TODO
%doc doc/keepalived.conf.SYNOPSIS doc/samples/
%dir %{_sysconfdir}/keepalived/
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/keepalived/keepalived.conf
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/keepalived
@INIT_SYSTEMD_TRUE@%{_unitdir}/keepalived.service
@INIT_SYSV_TRUE@%{_initdir}/keepalived
@INIT_UPSTART_TRUE@%{_sysconfdir}/init/keepalived.conf
@SNMP_TRUE@%{_datadir}/snmp/mibs/KEEPALIVED-MIB.txt
@SNMP_RFCV2_TRUE@%{_datadir}/snmp/mibs/VRRP-MIB.txt
@SNMP_RFCV3_TRUE@%{_datadir}/snmp/mibs/VRRPv3-MIB.txt
%{_bindir}/genhash
%attr(0755,root,root) %{_sbindir}/keepalived
%{_mandir}/man1/genhash.1*
%{_mandir}/man5/keepalived.conf.5*
%{_mandir}/man8/keepalived.8*
@WITH_DBUS_TRUE@%attr(0644,root,root) %{_sysconfdir}/dbus-1/system.d/org.keepalived.Vrrp1.conf
@WITH_DBUS_TRUE@%attr(0644,root,root) %{_datarootdir}/dbus-1/interfaces/org.keepalived.Vrrp1.Instance.xml
@WITH_DBUS_TRUE@%attr(0644,root,root) %{_datarootdir}/dbus-1/interfaces/org.keepalived.Vrrp1.Vrrp.xml
%changelog
* Wed Nov 1 2017 Quentin Armitage <[email protected]> 1.3.9-1
- Fix installation of keepalived.service
* Tue Oct 17 2017 Quentin Armitage <[email protected]> 1.3.8-1
- Handle Fedora and CentOS differences for %{_docdir_fmt}
* Fri Sep 16 2016 Quentin Armitage <[email protected]> 1.2.24-2
- Fixes to allow building on a systemd based system
* Wed Sep 14 2016 Quentin Armitage <[email protected]> 1.2.24-1
- Add more BuildRequires
* Tue Sep 13 2016 Quentin Armitage <[email protected]> 1.2.24
- Update for changed format due of config.log due to using automake
- Add support for systemd and upstart based systems
* Thu Sep 13 2007 Alexandre Cassen <[email protected]> 1.1.14
- Merge work done by freshrpms.net... Thanks guys !!! ;)
* Wed Feb 14 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-5
- Add missing scriplet requirements.
* Tue Feb 13 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-4
- Add missing \n to the kernel define, for when multiple kernels are installed.
- Pass STRIP=/bin/true to "make" in order to get a useful debuginfo package.
* Tue Feb 13 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-3
- Add %%check section to make sure any build without LVS support will fail.
* Mon Feb 5 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-2
- Use our own init script, include a sysconfig entry used by it for options.
* Thu Jan 25 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-1
- Update to 1.1.13.
- Change mode of configuration file to 0600.
- Don't include all of "doc" since it meant re-including all man pages.
- Don't include samples in the main configuration path, they're in %%doc.
- Include patch to add an optional label to interfaces.
* Sat Apr 08 2006 Dries Verachtert <[email protected]> - 1.1.12-1.2
- Rebuild for Fedora Core 5.
* Sun Mar 12 2006 Dag Wieers <[email protected]> - 1.1.12-1
- Updated to release 1.1.12.
* Fri Mar 04 2005 Dag Wieers <[email protected]> - 1.1.11-1
- Updated to release 1.1.11.
* Wed Feb 23 2005 Dag Wieers <[email protected]> - 1.1.10-2
- Fixed IPVS/LVS support. (Joe Sauer)
* Tue Feb 15 2005 Dag Wieers <[email protected]> - 1.1.10-1
- Updated to release 1.1.10.
* Mon Feb 07 2005 Dag Wieers <[email protected]> - 1.1.9-1
- Updated to release 1.1.9.
* Sun Oct 17 2004 Dag Wieers <[email protected]> - 1.1.7-2
- Fixes to build with kernel IPVS support. (Tim Verhoeven)
* Fri Sep 24 2004 Dag Wieers <[email protected]> - 1.1.7-1
- Updated to release 1.1.7. (Mathieu Lubrano)
* Mon Feb 23 2004 Dag Wieers <[email protected]> - 1.1.6-0
- Updated to release 1.1.6.
* Mon Jan 26 2004 Dag Wieers <[email protected]> - 1.1.5-0
- Updated to release 1.1.5.
* Mon Dec 29 2003 Dag Wieers <[email protected]> - 1.1.4-0
- Updated to release 1.1.4.
* Fri Jun 06 2003 Dag Wieers <[email protected]> - 1.0.3-0
- Initial package. (using DAR)