146 lines
4.1 KiB
RPMSpec
146 lines
4.1 KiB
RPMSpec
Summary: Common Address Redundancy Protocol (CARP) for Unix
|
|
Name: ucarp
|
|
Version: 1.2
|
|
Release: 4%{?dist}
|
|
License: BSD
|
|
Group: System Environment/Daemons
|
|
URL: http://www.ucarp.org/
|
|
Source0: http://download.pureftpd.org/pub/ucarp/ucarp-%{version}.tar.bz2
|
|
Source1: carp.init
|
|
Source2: vip-001.conf.example
|
|
Patch0: ucarp-1.3-pre.patch
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
|
Requires(post): /sbin/chkconfig
|
|
Requires(preun): /sbin/chkconfig, /sbin/service
|
|
Requires(postun): /sbin/service
|
|
BuildRequires: gettext
|
|
BuildRequires: autoconf, automake, libtool
|
|
# Use libpcap up to FC5, and libpcap-devel for FC6+ and non-Fedora
|
|
%if %{!?fedora:6}%{?fedora} >= 6
|
|
BuildRequires: libpcap-devel
|
|
%else
|
|
BuildRequires: libpcap
|
|
%endif
|
|
|
|
|
|
%description
|
|
UCARP allows a couple of hosts to share common virtual IP addresses in order
|
|
to provide automatic failover. It is a portable userland implementation of the
|
|
secure and patent-free Common Address Redundancy Protocol (CARP, OpenBSD's
|
|
alternative to the patents-bloated VRRP).
|
|
Strong points of the CARP protocol are: very low overhead, cryptographically
|
|
signed messages, interoperability between different operating systems and no
|
|
need for any dedicated extra network link between redundant hosts.
|
|
|
|
|
|
%prep
|
|
%setup
|
|
%patch -p1
|
|
|
|
|
|
%build
|
|
%configure
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
|
|
%install
|
|
%{__rm} -rf %{buildroot}
|
|
%makeinstall
|
|
%find_lang %{name}
|
|
|
|
# Install the init script
|
|
%{__install} -D -m 0755 %{SOURCE1} \
|
|
%{buildroot}/etc/rc.d/init.d/carp
|
|
|
|
# Install the example config file
|
|
%{__install} -D -m 0600 %{SOURCE2} \
|
|
%{buildroot}/etc/sysconfig/carp/vip-001.conf.example
|
|
|
|
# Install trivial interface up/down scripts
|
|
%{__cat} << 'EOF' > %{buildroot}/etc/sysconfig/carp/vip-up
|
|
#!/bin/sh
|
|
# We could use ifup directly, but it complains if the address is already used
|
|
#/sbin/ifup $1
|
|
. /etc/sysconfig/network-scripts/ifcfg-$1
|
|
#exec /sbin/ip addr add ${IPADDR}/${NETMASK} dev "$1"
|
|
exec /sbin/ifconfig $1 ${IPADDR} netmask ${NETMASK} up
|
|
EOF
|
|
%{__cat} << 'EOF' > %{buildroot}/etc/sysconfig/carp/vip-down
|
|
#!/bin/sh
|
|
#. /etc/sysconfig/network-scripts/ifcfg-$1
|
|
#exec /sbin/ip addr del ${IPADDR}/${NETMASK} dev "$1"
|
|
exec /sbin/ifconfig $1 down
|
|
EOF
|
|
|
|
|
|
%clean
|
|
%{__rm} -rf %{buildroot}
|
|
|
|
|
|
%post
|
|
if [ $1 -eq 1 ]; then
|
|
/sbin/chkconfig --add carp
|
|
fi
|
|
|
|
%preun
|
|
if [ $1 -eq 0 ]; then
|
|
/sbin/service carp stop >/dev/null 2>&1 || :
|
|
/sbin/chkconfig --del carp
|
|
fi
|
|
|
|
%postun
|
|
if [ $1 -ge 1 ]; then
|
|
/sbin/service carp condrestart >/dev/null 2>&1 || :
|
|
fi
|
|
|
|
|
|
%files -f %{name}.lang
|
|
%defattr(-, root, root, 0755)
|
|
%doc AUTHORS COPYING ChangeLog NEWS README examples/linux/*.sh
|
|
/etc/rc.d/init.d/carp
|
|
%dir /etc/sysconfig/carp/
|
|
/etc/sysconfig/carp/vip-001.conf.example
|
|
%attr(0700, root, root) %config(noreplace) /etc/sysconfig/carp/vip-up
|
|
%attr(0700, root, root) %config(noreplace) /etc/sysconfig/carp/vip-down
|
|
%{_sbindir}/ucarp
|
|
|
|
|
|
%changelog
|
|
* Mon Aug 28 2006 Matthias Saou <http://freshrpms.net/> 1.2-4
|
|
- FC6 rebuild.
|
|
|
|
* Tue Aug 22 2006 Matthias Saou <http://freshrpms.net/> 1.2-3
|
|
- Update to 1.3 snapshot, which includes the ARP fix, as well as fixes for the
|
|
segfaults reported in #200400 and #201596.
|
|
- Add autoconf, automake and libtool build reqs for the 1.3 patch.
|
|
|
|
* Thu Jul 27 2006 Matthias Saou <http://freshrpms.net/> 1.2-3
|
|
- Fix init script for recent find versions (#200395).
|
|
|
|
* Thu Jun 22 2006 Matthias Saou <http://freshrpms.net/> 1.2-2
|
|
- Include ARP patch backported from 1.3 snapshot (#196095).
|
|
- Make libpcap build requirement conditional to be able to share spec file.
|
|
|
|
* Wed Jun 21 2006 Matthias Saou <http://freshrpms.net/> 1.2-1
|
|
- Update to 1.2.
|
|
- BuildRequire libpcap-devel instead of libpcap now that it has been split.
|
|
|
|
* Mon Mar 6 2006 Matthias Saou <http://freshrpms.net/> 1.1-5
|
|
- FC5 rebuild.
|
|
|
|
* Thu Feb 9 2006 Matthias Saou <http://freshrpms.net/> 1.1-4
|
|
- Rebuild for new gcc/glibc.
|
|
|
|
* Thu Nov 17 2005 Matthias Saou <http://freshrpms.net/> 1.1-3
|
|
- Rebuild against new libpcap library.
|
|
|
|
* Fri Apr 1 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.1-2
|
|
- Add %%dir entry for /etc/sysconfig/carp directory.
|
|
|
|
* Thu Jan 13 2005 Matthias Saou <http://freshrpms.net/> 1.1-1
|
|
- Update to 1.1.
|
|
- Update source location.
|
|
|
|
* Fri Jul 9 2004 Matthias Saou <http://freshrpms.net/> 1.0-1
|
|
- Initial RPM release.
|
|
|