|
|
|
|
##
|
|
|
|
|
## haproxy.spec -- OpenPKG RPM Package Specification
|
|
|
|
|
## Copyright (c) 2000-2015 OpenPKG Foundation e.V. <http://openpkg.net/>
|
|
|
|
|
##
|
|
|
|
|
## Permission to use, copy, modify, and distribute this software for
|
|
|
|
|
## any purpose with or without fee is hereby granted, provided that
|
|
|
|
|
## the above copyright notice and this permission notice appear in all
|
|
|
|
|
## copies.
|
|
|
|
|
##
|
|
|
|
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
|
|
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
|
|
|
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
|
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
## SUCH DAMAGE.
|
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
# package version
|
|
|
|
|
%define V_major 1.6
|
|
|
|
|
%define V_minor 0
|
|
|
|
|
|
|
|
|
|
# package information
|
|
|
|
|
Name: haproxy
|
|
|
|
|
Summary: Hight-Availability TCP Proxy
|
|
|
|
|
URL: http://www.haproxy.org/
|
|
|
|
|
Vendor: Willy Tarreau
|
|
|
|
|
Packager: OpenPKG Foundation e.V.
|
|
|
|
|
Distribution: OpenPKG Community
|
|
|
|
|
Class: BASE
|
|
|
|
|
Group: Networking
|
|
|
|
|
License: GPL/LGPL
|
|
|
|
|
Version: %{V_major}.%{V_minor}
|
|
|
|
|
Release: 20151014
|
|
|
|
|
|
|
|
|
|
# package options
|
|
|
|
|
%option with_fsl yes
|
|
|
|
|
%option with_ssl no
|
|
|
|
|
|
|
|
|
|
# list of sources
|
|
|
|
|
Source0: http://www.haproxy.org/download/%{V_major}/src/haproxy-%{V_major}.%{V_minor}.tar.gz
|
|
|
|
|
Source1: haproxy.cfg
|
|
|
|
|
Source2: fsl.haproxy
|
|
|
|
|
Source3: rc.haproxy
|
|
|
|
|
|
|
|
|
|
# build information
|
|
|
|
|
BuildPreReq: OpenPKG, openpkg >= 20100101, make
|
|
|
|
|
PreReq: OpenPKG, openpkg >= 20100101
|
|
|
|
|
%if "%{with_fsl}" == "yes"
|
|
|
|
|
BuildPreReq: fsl
|
|
|
|
|
PreReq: fsl
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_ssl}" == "yes"
|
|
|
|
|
BuildPreReq: openssl
|
|
|
|
|
PreReq: openssl
|
|
|
|
|
%endif
|
|
|
|
|
BuildPreReq: pcre
|
|
|
|
|
PreReq: pcre
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
HAProxy is a free, very fast and reliable solution offering high
|
|
|
|
|
availability, load balancing, and proxying for TCP and HTTP-based
|
|
|
|
|
applications. It is particularly suited for web sites crawling under
|
|
|
|
|
very high loads while needing persistence or Layer7 processing.
|
|
|
|
|
Supporting tens of thousands of connections is clearly realistic
|
|
|
|
|
with todays hardware.
|
|
|
|
|
|
|
|
|
|
%track
|
|
|
|
|
prog haproxy = {
|
|
|
|
|
version = %{version}
|
|
|
|
|
url = http://www.haproxy.org/
|
|
|
|
|
regex = haproxy-(__VER__)\.tar\.gz
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n haproxy-%{V_major}.%{V_minor}
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
# build program
|
|
|
|
|
target="generic"
|
|
|
|
|
case "%{l_platform -t}" in
|
|
|
|
|
*-freebsd* ) target="freebsd" ;;
|
|
|
|
|
*-linux* ) target="linux26" ;;
|
|
|
|
|
*-sunos* ) target="solaris" ;;
|
|
|
|
|
esac
|
|
|
|
|
%{l_make} %{l_mflags} \
|
|
|
|
|
TARGET=$target \
|
|
|
|
|
CC="%{l_cc}" \
|
|
|
|
|
CFLAGS="%{l_cflags -O}" \
|
|
|
|
|
ADDINC="%{l_cppflags}" \
|
|
|
|
|
LDFLAGS="%{l_ldflags}" \
|
|
|
|
|
ADDLIB="%{l_fsl_ldflags} %{l_fsl_libs}" \
|
|
|
|
|
%if "%{with_ssl}" == "yes"
|
|
|
|
|
USE_OPENSSL=1 \
|
|
|
|
|
%endif
|
|
|
|
|
USE_STATIC_PCRE=1
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
# create installation hierarchy
|
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/sbin \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/man/cat1 \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/haproxy \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/haproxy
|
|
|
|
|
|
|
|
|
|
# install program
|
|
|
|
|
%{l_shtool} install -c -s -m 755 \
|
|
|
|
|
haproxy $RPM_BUILD_ROOT%{l_prefix}/sbin/
|
|
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
|
|
doc/configuration.txt $RPM_BUILD_ROOT%{l_prefix}/man/cat1/haproxy.1
|
|
|
|
|
|
|
|
|
|
# install default configuration
|
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
|
|
%{SOURCE haproxy.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/haproxy/
|
|
|
|
|
|
|
|
|
|
# install run-command script
|
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
|
|
%{SOURCE rc.haproxy} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
|
|
|
|
|
|
|
# install OSSP fsl configuration
|
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
|
|
%{SOURCE fsl.haproxy} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
|
|
|
|
|
|
|
|
|
|
# determine installation files
|
|
|
|
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
|
|
|
|
|
%{l_files_std} \
|
|
|
|
|
'%config %{l_prefix}/etc/haproxy/*' \
|
|
|
|
|
'%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/haproxy'
|
|
|
|
|
|
|
|
|
|
%files -f files
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
|