Name: haproxy
Version: 1.5.17
Release: el6
Summary: The Reliable, High Performance TCP/HTTP Load Balancer
Group: System Environment/Daemons
License: GPL
URL: http://www.haproxy.org
Source: haproxy-1.5.17.tar.gz
Vendor: Willy Tarreau
BuildRequires: gcc gcc-c++ autoconf automake cmake openssl openssl-devel pcre pcre-devel pcre-static
Requires: pcre pcre-devel pcre-static openssl openssl-devel
%description
HAProxy is a free, very fast and reliable solution offering high availability,
load balancing, and proxying for TCP and HTTP-based applications.
%prep
tar xzvf $RPM_SOURCE_DIR/haproxy-1.5.17.tar.gz
%build
cd haproxy-1.5.17/
make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_CPU_AFFINITY=1
%install
rm -rf $RPM_BUILD_ROOT
cd haproxy-1.5.17/
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/init.d
cp examples/haproxy.init $RPM_BUILD_ROOT/etc/init.d/haproxy
chmod 755 $RPM_BUILD_ROOT/etc/init.d/haproxy
mkdir -p $RPM_BUILD_ROOT/etc/haproxy
cp examples/examples.cfg $RPM_BUILD_ROOT/etc/haproxy/haproxy.cfg
mkdir -p $RPM_BUILD_ROOT/var/lib/haproxy
touch $RPM_BUILD_ROOT/var/lib/haproxy/stats
%clean
rm -rf $RPM_BUILD_DIR/haproxy-1.5.17
%preun
rm -f /usr/sbin/haproxy
%postun
userdel haproxy
%files
/etc/haproxy
/etc/init.d/haproxy
/usr/local/doc/haproxy
/usr/local/sbin/haproxy
/usr/local/share/man/man1/haproxy.1
/var/lib/haproxy
%post
useradd haproxy -M -d /var/lib/haproxy
ln -sf /usr/local/sbin/haproxy /usr/sbin/haproxy
%changelog